Use stickyHeader in HomeScreen and ArtistScreen
This commit is contained in:
parent
f4edfaefd2
commit
3c7d3da639
2 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
package it.vfsfitvnm.vimusic.ui.screens
|
package it.vfsfitvnm.vimusic.ui.screens
|
||||||
|
|
||||||
import androidx.compose.animation.ExperimentalAnimationApi
|
import androidx.compose.animation.ExperimentalAnimationApi
|
||||||
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
@ -48,6 +49,7 @@ import kotlinx.coroutines.flow.map
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
|
||||||
|
|
||||||
|
@ExperimentalFoundationApi
|
||||||
@ExperimentalAnimationApi
|
@ExperimentalAnimationApi
|
||||||
@Composable
|
@Composable
|
||||||
fun ArtistScreen(
|
fun ArtistScreen(
|
||||||
|
@ -210,13 +212,14 @@ fun ArtistScreen(
|
||||||
} ?: LoadingOrError()
|
} ?: LoadingOrError()
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
stickyHeader("songs") {
|
||||||
if (songs.isEmpty()) return@item
|
if (songs.isEmpty()) return@stickyHeader
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.background(colorPalette.background)
|
||||||
.zIndex(1f)
|
.zIndex(1f)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 8.dp)
|
.padding(horizontal = 8.dp)
|
||||||
|
|
|
@ -379,10 +379,11 @@ fun HomeScreen() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
stickyHeader("songs") {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.background(colorPalette.background)
|
||||||
.zIndex(1f)
|
.zIndex(1f)
|
||||||
.padding(horizontal = 8.dp)
|
.padding(horizontal = 8.dp)
|
||||||
.padding(top = 32.dp)
|
.padding(top = 32.dp)
|
||||||
|
|
Loading…
Add table
Reference in a new issue