diff --git a/build.gradle.kts b/build.gradle.kts index 692d432..af7bbdd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "xyz.regulad" -version = "1.4.2" +version = "1.4.3" nexusPublishing { repositories { diff --git a/compose/src/main/java/xyz/regulad/regulib/compose/navigationMode.kt b/compose/src/main/java/xyz/regulad/regulib/compose/navigationMode.kt index 4ca9ebd..29e8184 100644 --- a/compose/src/main/java/xyz/regulad/regulib/compose/navigationMode.kt +++ b/compose/src/main/java/xyz/regulad/regulib/compose/navigationMode.kt @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.runtime.* import androidx.compose.ui.Modifier +import androidx.compose.ui.composed import androidx.compose.ui.platform.LocalContext enum class NavigationMode { @@ -53,9 +54,8 @@ fun rememberNavigationMode(): State { * This is useful for [Scaffold]s that do not respect the system navigation bar visibility in terms of their padding. */ @RequiresApi(Build.VERSION_CODES.M) -@Composable @Suppress("unused") -fun Modifier.navigationAwarePadding(paddingValues: PaddingValues): Modifier { +fun Modifier.navigationAwarePadding(paddingValues: PaddingValues): Modifier = composed { val navigationMode by rememberNavigationMode() val systemBarsVisible by rememberContextIsImmersive() @@ -65,7 +65,7 @@ fun Modifier.navigationAwarePadding(paddingValues: PaddingValues): Modifier { } } - return if (!shouldNotUsePadding) { + return@composed if (!shouldNotUsePadding) { this.padding(paddingValues) } else { this diff --git a/compose/src/main/java/xyz/regulad/regulib/compose/viewState.kt b/compose/src/main/java/xyz/regulad/regulib/compose/viewState.kt index 4324057..f43b867 100644 --- a/compose/src/main/java/xyz/regulad/regulib/compose/viewState.kt +++ b/compose/src/main/java/xyz/regulad/regulib/compose/viewState.kt @@ -139,10 +139,10 @@ fun ImmersiveFullscreenContent() { @RequiresApi(Build.VERSION_CODES.M) @Composable fun rememberContextIsImmersive(): State { - val numberOfImmersiveComposables = immersiveFullscreenContentComposablesInComposition.collectAsState() + val numberOfImmersiveComposables by immersiveFullscreenContentComposablesInComposition.collectAsState() return remember { derivedStateOf { - numberOfImmersiveComposables.value > 0 + numberOfImmersiveComposables > 0 } } }