mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-08-01 00:59:27 +00:00
ref: adjust header top inset
This commit is contained in:
parent
5060d23c14
commit
39c32c1c96
3 changed files with 18 additions and 0 deletions
|
|
@ -55,7 +55,9 @@ import androidx.compose.ui.layout.ContentScale
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.max
|
||||
import androidx.compose.ui.zIndex
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
|
|
@ -1327,6 +1329,12 @@ private fun MainAppContent(
|
|||
val isTabletLayout = maxWidth >= 768.dp
|
||||
val useNativeBottomTabs =
|
||||
liquidGlassNativeTabBarSupported && liquidGlassNativeTabBarEnabled && initialHomeReady
|
||||
val topChromePadding = if (isTabletLayout && !useNativeBottomTabs) {
|
||||
val statusBarPadding = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
|
||||
max(statusBarPadding + 24.dp, 48.dp) + 64.dp
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val tabsRouteActive = currentBackStackEntry?.destination?.hasRoute<TabsRoute>() == true
|
||||
val onProfileSelected: (NuvioProfile) -> Unit = { profile ->
|
||||
profileSwitchLoading = true
|
||||
|
|
@ -1386,6 +1394,7 @@ private fun MainAppContent(
|
|||
.fillMaxSize()
|
||||
.padding(innerPadding),
|
||||
selectedTab = selectedTab,
|
||||
topChromePadding = topChromePadding,
|
||||
searchFocusRequestCount = searchFocusRequestCount,
|
||||
rootActionsEnabled = tabsRouteActive,
|
||||
homeScrollToTopRequests = homeScrollToTopRequests,
|
||||
|
|
@ -2808,6 +2817,7 @@ private fun rememberGuardedPopBackStack(
|
|||
private fun AppTabHost(
|
||||
selectedTab: AppScreenTab,
|
||||
modifier: Modifier = Modifier,
|
||||
topChromePadding: Dp? = null,
|
||||
searchFocusRequestCount: Int = 0,
|
||||
rootActionsEnabled: Boolean = true,
|
||||
homeScrollToTopRequests: Flow<Unit>,
|
||||
|
|
@ -2865,6 +2875,7 @@ private fun AppTabHost(
|
|||
AppScreenTab.Search -> {
|
||||
SearchScreen(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
topChromePadding = topChromePadding,
|
||||
onPosterClick = onPosterClick,
|
||||
onPosterLongClick = onPosterLongClick,
|
||||
searchFocusRequestCount = searchFocusRequestCount,
|
||||
|
|
@ -2875,6 +2886,7 @@ private fun AppTabHost(
|
|||
AppScreenTab.Library -> {
|
||||
LibraryScreen(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
topChromePadding = topChromePadding,
|
||||
scrollToTopRequests = libraryScrollToTopRequests,
|
||||
onPosterClick = onLibraryPosterClick,
|
||||
onPosterLongClick = onLibraryPosterLongClick,
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ import org.jetbrains.compose.resources.stringResource
|
|||
@Composable
|
||||
fun LibraryScreen(
|
||||
modifier: Modifier = Modifier,
|
||||
topChromePadding: Dp? = null,
|
||||
scrollToTopRequests: Flow<Unit> = emptyFlow(),
|
||||
onPosterClick: ((LibraryItem) -> Unit)? = null,
|
||||
onPosterLongClick: ((LibraryItem, LibrarySection) -> Unit)? = null,
|
||||
|
|
@ -174,6 +175,7 @@ fun LibraryScreen(
|
|||
NuvioScreen(
|
||||
modifier = modifier,
|
||||
horizontalPadding = 0.dp,
|
||||
topPadding = if (topChromePadding != null) 0.dp else null,
|
||||
listState = listState,
|
||||
) {
|
||||
stickyHeader {
|
||||
|
|
@ -192,6 +194,7 @@ fun LibraryScreen(
|
|||
stringResource(Res.string.library_title)
|
||||
},
|
||||
modifier = Modifier.padding(horizontal = 16.dp),
|
||||
topPadding = topChromePadding,
|
||||
)
|
||||
LibrarySourceSwitch(
|
||||
selectedMode = sourceMode,
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ import org.jetbrains.compose.resources.stringResource
|
|||
@Composable
|
||||
fun SearchScreen(
|
||||
modifier: Modifier = Modifier,
|
||||
topChromePadding: Dp? = null,
|
||||
onPosterClick: ((MetaPreview) -> Unit)? = null,
|
||||
onPosterLongClick: ((MetaPreview) -> Unit)? = null,
|
||||
searchFocusRequestCount: Int = 0,
|
||||
|
|
@ -238,6 +239,7 @@ fun SearchScreen(
|
|||
|
||||
NuvioScreen(
|
||||
horizontalPadding = 0.dp,
|
||||
topPadding = if (topChromePadding != null) 0.dp else null,
|
||||
listState = listState,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
) {
|
||||
|
|
@ -251,6 +253,7 @@ fun SearchScreen(
|
|||
NuvioScreenHeader(
|
||||
title = headerTitle,
|
||||
modifier = Modifier.padding(horizontal = 16.dp),
|
||||
topPadding = topChromePadding,
|
||||
)
|
||||
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(6.dp))
|
||||
androidx.compose.foundation.layout.Box(modifier = Modifier.padding(horizontal = 16.dp)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue