Fix minor animation issue with ReorderingLazyColumn
This commit is contained in:
@@ -112,7 +112,7 @@ fun LocalPlaylistScreen(playlistId: Long) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
extraItemCount = 3
|
extraItemCount = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
var isRenaming by rememberSaveable {
|
var isRenaming by rememberSaveable {
|
||||||
@@ -157,111 +157,109 @@ fun LocalPlaylistScreen(playlistId: Long) {
|
|||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
) {
|
) {
|
||||||
item {
|
item {
|
||||||
TopAppBar(
|
Column {
|
||||||
modifier = Modifier
|
TopAppBar(
|
||||||
.height(52.dp)
|
|
||||||
) {
|
|
||||||
Image(
|
|
||||||
painter = painterResource(R.drawable.chevron_back),
|
|
||||||
contentDescription = null,
|
|
||||||
colorFilter = ColorFilter.tint(colorPalette.text),
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable(onClick = pop)
|
.height(52.dp)
|
||||||
.padding(vertical = 8.dp, horizontal = 16.dp)
|
) {
|
||||||
.size(24.dp)
|
Image(
|
||||||
)
|
painter = painterResource(R.drawable.chevron_back),
|
||||||
}
|
contentDescription = null,
|
||||||
}
|
colorFilter = ColorFilter.tint(colorPalette.text),
|
||||||
|
modifier = Modifier
|
||||||
|
.clickable(onClick = pop)
|
||||||
|
.padding(vertical = 8.dp, horizontal = 16.dp)
|
||||||
|
.size(24.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
Column(
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.padding(top = 16.dp, bottom = 8.dp)
|
|
||||||
.padding(horizontal = 16.dp)
|
|
||||||
) {
|
|
||||||
BasicText(
|
|
||||||
text = playlistWithSongs.playlist.name,
|
|
||||||
style = typography.m.semiBold
|
|
||||||
)
|
|
||||||
|
|
||||||
BasicText(
|
|
||||||
text = "${playlistWithSongs.songs.size} songs",
|
|
||||||
style = typography.xxs.semiBold.secondary
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
item {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.End,
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.zIndex(1f)
|
|
||||||
.padding(horizontal = 8.dp)
|
|
||||||
) {
|
|
||||||
Image(
|
|
||||||
painter = painterResource(R.drawable.shuffle),
|
|
||||||
contentDescription = null,
|
|
||||||
colorFilter = ColorFilter.tint(colorPalette.text),
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable(enabled = playlistWithSongs.songs.isNotEmpty()) {
|
.padding(top = 16.dp, bottom = 8.dp)
|
||||||
binder?.stopRadio()
|
.padding(horizontal = 16.dp)
|
||||||
binder?.player?.forcePlayFromBeginning(
|
) {
|
||||||
playlistWithSongs.songs
|
BasicText(
|
||||||
.shuffled()
|
text = playlistWithSongs.playlist.name,
|
||||||
.map(DetailedSong::asMediaItem)
|
style = typography.m.semiBold
|
||||||
)
|
)
|
||||||
}
|
|
||||||
.padding(horizontal = 8.dp, vertical = 8.dp)
|
|
||||||
.size(20.dp)
|
|
||||||
)
|
|
||||||
|
|
||||||
Image(
|
BasicText(
|
||||||
painter = painterResource(R.drawable.ellipsis_horizontal),
|
text = "${playlistWithSongs.songs.size} songs",
|
||||||
contentDescription = null,
|
style = typography.xxs.semiBold.secondary
|
||||||
colorFilter = ColorFilter.tint(colorPalette.text),
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.End,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable {
|
.fillMaxWidth()
|
||||||
menuState.display {
|
.zIndex(1f)
|
||||||
Menu {
|
.padding(horizontal = 8.dp)
|
||||||
MenuEntry(
|
) {
|
||||||
icon = R.drawable.enqueue,
|
Image(
|
||||||
text = "Enqueue",
|
painter = painterResource(R.drawable.shuffle),
|
||||||
isEnabled = playlistWithSongs.songs.isNotEmpty(),
|
contentDescription = null,
|
||||||
onClick = {
|
colorFilter = ColorFilter.tint(colorPalette.text),
|
||||||
menuState.hide()
|
modifier = Modifier
|
||||||
binder?.player?.enqueue(
|
.clickable(enabled = playlistWithSongs.songs.isNotEmpty()) {
|
||||||
playlistWithSongs.songs.map(
|
binder?.stopRadio()
|
||||||
DetailedSong::asMediaItem
|
binder?.player?.forcePlayFromBeginning(
|
||||||
|
playlistWithSongs.songs
|
||||||
|
.shuffled()
|
||||||
|
.map(DetailedSong::asMediaItem)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
.padding(horizontal = 8.dp, vertical = 8.dp)
|
||||||
|
.size(20.dp)
|
||||||
|
)
|
||||||
|
|
||||||
|
Image(
|
||||||
|
painter = painterResource(R.drawable.ellipsis_horizontal),
|
||||||
|
contentDescription = null,
|
||||||
|
colorFilter = ColorFilter.tint(colorPalette.text),
|
||||||
|
modifier = Modifier
|
||||||
|
.clickable {
|
||||||
|
menuState.display {
|
||||||
|
Menu {
|
||||||
|
MenuEntry(
|
||||||
|
icon = R.drawable.enqueue,
|
||||||
|
text = "Enqueue",
|
||||||
|
isEnabled = playlistWithSongs.songs.isNotEmpty(),
|
||||||
|
onClick = {
|
||||||
|
menuState.hide()
|
||||||
|
binder?.player?.enqueue(
|
||||||
|
playlistWithSongs.songs.map(
|
||||||
|
DetailedSong::asMediaItem
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
|
|
||||||
MenuEntry(
|
MenuEntry(
|
||||||
icon = R.drawable.pencil,
|
icon = R.drawable.pencil,
|
||||||
text = "Rename",
|
text = "Rename",
|
||||||
onClick = {
|
onClick = {
|
||||||
menuState.hide()
|
menuState.hide()
|
||||||
isRenaming = true
|
isRenaming = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
MenuEntry(
|
MenuEntry(
|
||||||
icon = R.drawable.trash,
|
icon = R.drawable.trash,
|
||||||
text = "Delete",
|
text = "Delete",
|
||||||
onClick = {
|
onClick = {
|
||||||
menuState.hide()
|
menuState.hide()
|
||||||
isDeleting = true
|
isDeleting = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.padding(horizontal = 8.dp, vertical = 8.dp)
|
||||||
.padding(horizontal = 8.dp, vertical = 8.dp)
|
.size(20.dp)
|
||||||
.size(20.dp)
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user