Move playing song menu button to the bottom
This commit is contained in:
@@ -20,8 +20,11 @@ import it.vfsfitvnm.vimusic.ui.styling.LocalAppearance
|
||||
@Composable
|
||||
fun PlayerBottomSheet(
|
||||
layoutState: BottomSheetState,
|
||||
isShowingLyrics: Boolean,
|
||||
onShowLyrics: () -> Unit,
|
||||
isShowingStatsForNerds: Boolean,
|
||||
onShowStatsForNerds: () -> Unit,
|
||||
onShowMenu: () -> Unit,
|
||||
onGlobalRouteEmitted: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
@@ -54,6 +57,12 @@ fun PlayerBottomSheet(
|
||||
.padding(all = 8.dp)
|
||||
.size(20.dp)
|
||||
)
|
||||
|
||||
Spacer(
|
||||
modifier = Modifier
|
||||
.padding(all = 8.dp)
|
||||
.size(20.dp)
|
||||
)
|
||||
}
|
||||
|
||||
Image(
|
||||
@@ -72,7 +81,7 @@ fun PlayerBottomSheet(
|
||||
Image(
|
||||
painter = painterResource(R.drawable.text),
|
||||
contentDescription = null,
|
||||
colorFilter = ColorFilter.tint(colorPalette.text),
|
||||
colorFilter = ColorFilter.tint(if (isShowingLyrics) colorPalette.text else colorPalette.textDisabled),
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onShowLyrics)
|
||||
.padding(all = 8.dp)
|
||||
@@ -82,12 +91,22 @@ fun PlayerBottomSheet(
|
||||
Image(
|
||||
painter = painterResource(R.drawable.information),
|
||||
contentDescription = null,
|
||||
colorFilter = ColorFilter.tint(colorPalette.text),
|
||||
colorFilter = ColorFilter.tint(if (isShowingStatsForNerds) colorPalette.text else colorPalette.textDisabled),
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onShowStatsForNerds)
|
||||
.padding(all = 8.dp)
|
||||
.size(20.dp)
|
||||
)
|
||||
|
||||
Image(
|
||||
painter = painterResource(R.drawable.ellipsis_horizontal),
|
||||
contentDescription = null,
|
||||
colorFilter = ColorFilter.tint(colorPalette.text),
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onShowMenu)
|
||||
.padding(all = 8.dp)
|
||||
.size(20.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,19 +255,19 @@ fun PlayerView(
|
||||
}
|
||||
}
|
||||
|
||||
TopAppBar {
|
||||
Spacer(
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
.size(24.dp)
|
||||
)
|
||||
|
||||
Image(
|
||||
painter = painterResource(R.drawable.ellipsis_horizontal),
|
||||
contentDescription = null,
|
||||
colorFilter = ColorFilter.tint(colorPalette.text),
|
||||
modifier = Modifier
|
||||
.clickable {
|
||||
PlayerBottomSheet(
|
||||
layoutState = rememberBottomSheetState(64.dp, layoutState.upperBound),
|
||||
isShowingLyrics = isShowingLyrics,
|
||||
onShowLyrics = {
|
||||
isShowingStatsForNerds = false
|
||||
isShowingLyrics = !isShowingLyrics
|
||||
},
|
||||
isShowingStatsForNerds = isShowingStatsForNerds,
|
||||
onShowStatsForNerds = {
|
||||
isShowingLyrics = false
|
||||
isShowingStatsForNerds = !isShowingStatsForNerds
|
||||
},
|
||||
onShowMenu = {
|
||||
menuState.display {
|
||||
val resultRegistryOwner = LocalActivityResultRegistryOwner.current
|
||||
|
||||
@@ -319,21 +319,6 @@ fun PlayerView(
|
||||
onGlobalRouteEmitted = layoutState::collapseSoft,
|
||||
)
|
||||
}
|
||||
}
|
||||
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
.size(24.dp)
|
||||
)
|
||||
}
|
||||
|
||||
PlayerBottomSheet(
|
||||
layoutState = rememberBottomSheetState(64.dp, layoutState.upperBound),
|
||||
onShowLyrics = {
|
||||
isShowingStatsForNerds = false
|
||||
isShowingLyrics = !isShowingLyrics
|
||||
},
|
||||
onShowStatsForNerds = {
|
||||
isShowingLyrics = false
|
||||
isShowingStatsForNerds = !isShowingStatsForNerds
|
||||
},
|
||||
onGlobalRouteEmitted = layoutState::collapseSoft,
|
||||
modifier = Modifier
|
||||
|
||||
Reference in New Issue
Block a user