Skip to content

Commit

Permalink
whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
regulad committed Oct 24, 2024
1 parent 118f31b commit d463d4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "xyz.regulad"
version = "1.4.2"
version = "1.4.3"

nexusPublishing {
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -53,9 +54,8 @@ fun rememberNavigationMode(): State<NavigationMode> {
* 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()

Expand All @@ -65,7 +65,7 @@ fun Modifier.navigationAwarePadding(paddingValues: PaddingValues): Modifier {
}
}

return if (!shouldNotUsePadding) {
return@composed if (!shouldNotUsePadding) {
this.padding(paddingValues)
} else {
this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ fun ImmersiveFullscreenContent() {
@RequiresApi(Build.VERSION_CODES.M)
@Composable
fun rememberContextIsImmersive(): State<Boolean> {
val numberOfImmersiveComposables = immersiveFullscreenContentComposablesInComposition.collectAsState()
val numberOfImmersiveComposables by immersiveFullscreenContentComposablesInComposition.collectAsState()
return remember {
derivedStateOf {
numberOfImmersiveComposables.value > 0
numberOfImmersiveComposables > 0
}
}
}
Expand Down

0 comments on commit d463d4d

Please sign in to comment.