Make Favorites, History collections easier to discover in HomeScreen

This commit is contained in:
vfsfitvnm 2022-06-05 18:20:55 +02:00
parent b6ecc8a887
commit a848122b2d

View file

@ -275,7 +275,7 @@ fun HomeScreen(intentVideoId: String?) {
item { item {
Row( Row(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.Bottom,
modifier = Modifier modifier = Modifier
.zIndex(1f) .zIndex(1f)
.padding(horizontal = 8.dp) .padding(horizontal = 8.dp)
@ -298,17 +298,28 @@ fun HomeScreen(intentVideoId: String?) {
.animateContentSize() .animateContentSize()
) )
Image( val songCollections = enumValues<SongCollection>()
painter = painterResource(R.drawable.repeat), val nextSongCollection = songCollections[(preferences.homePageSongCollection.ordinal + 1) % songCollections.size]
contentDescription = null,
colorFilter = ColorFilter.tint(colorPalette.textSecondary), BasicText(
text = when (nextSongCollection) {
SongCollection.MostPlayed -> "Most played"
SongCollection.Favorites -> "Favorites"
SongCollection.History -> "History"
},
style = typography.xxs.secondary.bold,
modifier = Modifier modifier = Modifier
.clickable { .clickable(
val values = SongCollection.values() indication = rememberRipple(bounded = true),
preferences.onHomePageSongCollectionChange(values[(preferences.homePageSongCollection.ordinal + 1) % values.size]) interactionSource = remember { MutableInteractionSource() }
) {
preferences.onHomePageSongCollectionChange(
nextSongCollection
)
} }
.padding(horizontal = 8.dp, vertical = 8.dp) // .alignByBaseline()
.size(16.dp) .padding(horizontal = 16.dp)
.animateContentSize()
) )
} }