Reorganize actions location in LocalPlaylistSongs

This commit is contained in:
vfsfitvnm
2022-10-06 09:11:13 +02:00
parent 8f588f6dce
commit f68726710b

View File

@@ -39,6 +39,8 @@ import it.vfsfitvnm.vimusic.ui.components.themed.Header
import it.vfsfitvnm.vimusic.ui.components.themed.HeaderIconButton
import it.vfsfitvnm.vimusic.ui.components.themed.IconButton
import it.vfsfitvnm.vimusic.ui.components.themed.InPlaylistMediaItemMenu
import it.vfsfitvnm.vimusic.ui.components.themed.Menu
import it.vfsfitvnm.vimusic.ui.components.themed.MenuEntry
import it.vfsfitvnm.vimusic.ui.components.themed.PrimaryButton
import it.vfsfitvnm.vimusic.ui.components.themed.SecondaryTextButton
import it.vfsfitvnm.vimusic.ui.components.themed.TextFieldDialog
@@ -163,11 +165,18 @@ fun LocalPlaylistSongs(
.weight(1f)
)
playlistWithSongs?.playlist?.browseId?.let { browseId ->
HeaderIconButton(
icon = R.drawable.sync,
icon = R.drawable.ellipsis_horizontal,
color = colorPalette.text,
onClick = {
menuState.display {
Menu {
playlistWithSongs?.playlist?.browseId?.let { browseId ->
MenuEntry(
icon = R.drawable.sync,
text = "Sync",
onClick = {
menuState.hide()
transaction {
runBlocking(Dispatchers.IO) {
withContext(Dispatchers.IO) {
@@ -194,16 +203,26 @@ fun LocalPlaylistSongs(
)
}
HeaderIconButton(
MenuEntry(
icon = R.drawable.pencil,
color = colorPalette.text,
onClick = { isRenaming = true }
text = "Rename",
onClick = {
menuState.hide()
isRenaming = true
}
)
HeaderIconButton(
MenuEntry(
icon = R.drawable.trash,
color = colorPalette.text,
onClick = { isDeleting = true }
text = "Delete",
onClick = {
menuState.hide()
isDeleting = true
}
)
}
}
}
)
}
}