mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 20:19:05 +01:00
Fix banners-related issues (#9143)
This is most likely Compose issue so these changes will be reevaluated when new Compose ver is out.
This commit is contained in:
@@ -69,7 +69,8 @@ fun AppStateBanners(
|
||||
val mainInsets = WindowInsets.statusBars
|
||||
val mainInsetsTop = mainInsets.getTop(density)
|
||||
SubcomposeLayout(modifier = modifier) { constraints ->
|
||||
val indexingPlaceable = subcompose(0) {
|
||||
val indexingId = if (indexing) 0 else -1
|
||||
val indexingPlaceable = subcompose(indexingId) {
|
||||
AnimatedVisibility(
|
||||
visible = indexing,
|
||||
enter = expandVertically(),
|
||||
@@ -82,7 +83,8 @@ fun AppStateBanners(
|
||||
}.fastMap { it.measure(constraints) }
|
||||
val indexingHeight = indexingPlaceable.fastMaxBy { it.height }?.height ?: 0
|
||||
|
||||
val downloadedOnlyPlaceable = subcompose(1) {
|
||||
val downloadedId = if (indexing) 1 else 0
|
||||
val downloadedOnlyPlaceable = subcompose(downloadedId) {
|
||||
AnimatedVisibility(
|
||||
visible = downloadedOnlyMode,
|
||||
enter = expandVertically(),
|
||||
@@ -96,7 +98,12 @@ fun AppStateBanners(
|
||||
}.fastMap { it.measure(constraints) }
|
||||
val downloadedOnlyHeight = downloadedOnlyPlaceable.fastMaxBy { it.height }?.height ?: 0
|
||||
|
||||
val incognitoPlaceable = subcompose(2) {
|
||||
val incognitoId = when {
|
||||
indexing && downloadedOnlyMode -> 3
|
||||
indexing || downloadedOnlyMode -> 2
|
||||
else -> 1
|
||||
}
|
||||
val incognitoPlaceable = subcompose(incognitoId) {
|
||||
AnimatedVisibility(
|
||||
visible = incognitoMode,
|
||||
enter = expandVertically(),
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.kanade.presentation.util
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.ProvidableCompositionLocal
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.ui.Modifier
|
||||
import cafe.adriel.voyager.core.screen.Screen
|
||||
import cafe.adriel.voyager.core.screen.ScreenKey
|
||||
import cafe.adriel.voyager.core.screen.uniqueScreenKey
|
||||
@@ -33,7 +34,7 @@ interface AssistContentScreen {
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun DefaultNavigatorScreenTransition(navigator: Navigator) {
|
||||
fun DefaultNavigatorScreenTransition(navigator: Navigator, modifier: Modifier = Modifier) {
|
||||
val slideDistance = rememberSlideDistance()
|
||||
ScreenTransition(
|
||||
navigator = navigator,
|
||||
@@ -43,5 +44,6 @@ fun DefaultNavigatorScreenTransition(navigator: Navigator) {
|
||||
slideDistance = slideDistance,
|
||||
)
|
||||
},
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user