mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
move the library tab bar to the bottom above the mini player
This commit is contained in:
@@ -316,10 +316,10 @@ fun LibraryScreen(
|
|||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
val statusBarTop = with(density) { WindowInsets.statusBars.getTop(this).toDp() }
|
val statusBarTop = with(density) { WindowInsets.statusBars.getTop(this).toDp() }
|
||||||
val filtersActive = listQuery.starred != StarredFilter.Any || search.isNotEmpty()
|
val filtersActive = listQuery.starred != StarredFilter.Any || search.isNotEmpty()
|
||||||
val listBottomInset = bottomInset + if (searchActive) SEARCH_BAR_CLEARANCE else FAB_CLEARANCE
|
var tabBarHeightPx by remember { mutableFloatStateOf(0f) }
|
||||||
|
val tabBarHeight = with(density) { tabBarHeightPx.toDp() }
|
||||||
var headerHeightPx by remember { mutableFloatStateOf(0f) }
|
val listTopInset = statusBarTop
|
||||||
val listTopInset = with(density) { headerHeightPx.toDp() }
|
val listBottomInset = bottomInset + tabBarHeight + if (searchActive) SEARCH_BAR_CLEARANCE else FAB_CLEARANCE
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier =
|
modifier =
|
||||||
@@ -406,9 +406,8 @@ fun LibraryScreen(
|
|||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.align(Alignment.TopStart)
|
.align(Alignment.BottomCenter)
|
||||||
.onSizeChanged { headerHeightPx = it.height.toFloat() }
|
.onSizeChanged { tabBarHeightPx = it.height.toFloat() },
|
||||||
.padding(top = statusBarTop + 2.dp, bottom = 2.dp),
|
|
||||||
) {
|
) {
|
||||||
LibraryTabs(
|
LibraryTabs(
|
||||||
pagerState = pagerState,
|
pagerState = pagerState,
|
||||||
@@ -443,7 +442,7 @@ fun LibraryScreen(
|
|||||||
onClick = { showOptions = true },
|
onClick = { showOptions = true },
|
||||||
containerColor = artwork?.scheme?.primary ?: MaterialTheme.colorScheme.surfaceContainerHigh,
|
containerColor = artwork?.scheme?.primary ?: MaterialTheme.colorScheme.surfaceContainerHigh,
|
||||||
contentColor = artwork?.scheme?.onPrimary ?: MaterialTheme.colorScheme.onBackground,
|
contentColor = artwork?.scheme?.onPrimary ?: MaterialTheme.colorScheme.onBackground,
|
||||||
modifier = Modifier.align(Alignment.BottomEnd).padding(16.dp),
|
modifier = Modifier.align(Alignment.BottomEnd).padding(end = 16.dp, bottom = tabBarHeight + 16.dp),
|
||||||
) {
|
) {
|
||||||
Box {
|
Box {
|
||||||
Icon(Icons.Filled.Sort, contentDescription = "List options")
|
Icon(Icons.Filled.Sort, contentDescription = "List options")
|
||||||
@@ -687,6 +686,7 @@ private fun LibraryTabs(
|
|||||||
Box(
|
Box(
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
.background(headerColor)
|
.background(headerColor)
|
||||||
.padding(8.dp),
|
.padding(8.dp),
|
||||||
) {
|
) {
|
||||||
@@ -704,6 +704,7 @@ private fun LibraryTabs(
|
|||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
) {
|
) {
|
||||||
@@ -726,12 +727,7 @@ private fun LibraryTabs(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Box(
|
Spacer(Modifier.weight(1f))
|
||||||
Modifier
|
|
||||||
.width(1.dp)
|
|
||||||
.height(24.dp)
|
|
||||||
.background(MaterialTheme.colorScheme.onBackground.copy(alpha = 0.2f)),
|
|
||||||
)
|
|
||||||
if (syncing) {
|
if (syncing) {
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
modifier = Modifier.padding(end = 4.dp).size(20.dp),
|
modifier = Modifier.padding(end = 4.dp).size(20.dp),
|
||||||
|
|||||||
Reference in New Issue
Block a user