respect the nav bar inset for the tab bar and apply the artwork theme globally

This commit is contained in:
austinried
2026-10-04 00:29:57 +00:00
parent 9736d51955
commit 4530335bd7
2 changed files with 164 additions and 159 deletions
@@ -61,6 +61,7 @@ import com.subtracks.ui.playback.NowPlayingRoute
import com.subtracks.ui.playback.QueueRoute
import com.subtracks.ui.settings.AddSourceRoute
import com.subtracks.ui.settings.SettingsRoute
import com.subtracks.ui.theme.ArtworkTheme
import com.subtracks.ui.theme.rememberArtworkColors
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.SharingStarted
@@ -156,6 +157,8 @@ private fun MainNavigation() {
val keyboardUp = WindowInsets.imeAnimationTarget.getBottom(density) > 0
val showMiniPlayer = playerVisible && !keyboardUp
val artwork = rememberArtworkColors(playbackController.coverArt(playback.item, thumbnail = true))
ArtworkTheme(artwork) {
Box(Modifier.fillMaxSize()) {
Column(Modifier.fillMaxSize().imePadding()) {
NavHost(
@@ -328,6 +331,7 @@ private fun MainNavigation() {
)
}
}
}
BackHandler(enabled = showingQueue) { showingQueue = false }
BackHandler(enabled = nowPlayingOpen && !showingQueue) {
@@ -407,6 +407,7 @@ fun LibraryScreen(
Modifier
.fillMaxWidth()
.align(Alignment.BottomCenter)
.padding(bottom = bottomInset)
.onSizeChanged { tabBarHeightPx = it.height.toFloat() },
) {
LibraryTabs(