mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
trim the library header, enlarge artist art, fix album title color
This commit is contained in:
@@ -42,7 +42,7 @@ import com.subtracks.ui.components.CoverArt
|
|||||||
import org.koin.compose.viewmodel.koinViewModel
|
import org.koin.compose.viewmodel.koinViewModel
|
||||||
import org.koin.core.parameter.parametersOf
|
import org.koin.core.parameter.parametersOf
|
||||||
|
|
||||||
private val ART_HEIGHT = 320.dp
|
private val ART_HEIGHT = 420.dp
|
||||||
private val SCRIM_HEIGHT = 128.dp
|
private val SCRIM_HEIGHT = 128.dp
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -102,14 +102,6 @@ fun ArtistDetailScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item(span = { GridItemSpan(maxLineSpan) }) {
|
|
||||||
Text(
|
|
||||||
text = "${albums.size} albums",
|
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
||||||
modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 4.dp),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
itemsIndexed(albums, key = { _, album -> album.id }) { index, album ->
|
itemsIndexed(albums, key = { _, album -> album.id }) { index, album ->
|
||||||
Column(
|
Column(
|
||||||
modifier =
|
modifier =
|
||||||
@@ -127,6 +119,7 @@ fun ArtistDetailScreen(
|
|||||||
Text(
|
Text(
|
||||||
text = album.name,
|
text = album.name,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onBackground,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
modifier = Modifier.padding(top = 6.dp),
|
modifier = Modifier.padding(top = 6.dp),
|
||||||
|
|||||||
@@ -155,13 +155,13 @@ fun LibraryScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
val titleHeight = TopAppBarDefaults.TopAppBarExpandedHeight
|
|
||||||
val titleLineHeight =
|
val titleLineHeight =
|
||||||
with(density) {
|
with(density) {
|
||||||
MaterialTheme.typography.headlineLarge.lineHeight
|
MaterialTheme.typography.headlineLarge.lineHeight
|
||||||
.toDp()
|
.toDp()
|
||||||
}
|
}
|
||||||
val titleTop = ((titleHeight - titleLineHeight) / 2).coerceAtLeast(0.dp)
|
val titleTop = ((TopAppBarDefaults.TopAppBarExpandedHeight - titleLineHeight) / 2).coerceAtLeast(0.dp)
|
||||||
|
val titleHeight = titleTop + titleLineHeight + 4.dp
|
||||||
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()
|
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()
|
||||||
SideEffect { scrollBehavior.state.heightOffsetLimit = -with(density) { titleHeight.toPx() } }
|
SideEffect { scrollBehavior.state.heightOffsetLimit = -with(density) { titleHeight.toPx() } }
|
||||||
val titleFraction = scrollBehavior.state.collapsedFraction
|
val titleFraction = scrollBehavior.state.collapsedFraction
|
||||||
|
|||||||
Reference in New Issue
Block a user