Skip to content

Commit

Permalink
Remove protectNavBars property (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfomer authored Oct 29, 2024
1 parent 6ba0313 commit 42685f3
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 16 deletions.
9 changes: 0 additions & 9 deletions core/src/androidMain/kotlin/Modal.android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.input.key.KeyEvent
import androidx.compose.ui.input.key.NativeKeyEvent
import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.lifecycle.findViewTreeLifecycleOwner
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import androidx.lifecycle.setViewTreeLifecycleOwner
Expand All @@ -29,7 +26,6 @@ import java.util.*

@Composable
internal actual fun Modal(
protectNavBars: Boolean,
onKeyEvent: (KeyEvent) -> Boolean,
content: @Composable () -> Unit
) {
Expand Down Expand Up @@ -86,11 +82,6 @@ internal actual fun Modal(
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
}

if (protectNavBars) {
window.navigationBarColor = Color.Black.copy(alpha = 0.33f).toArgb()
WindowInsetsControllerCompat(window, contentView).isAppearanceLightNavigationBars = false
}

window.setDimAmount(0f)
window.setWindowAnimations(-1)

Expand Down
1 change: 0 additions & 1 deletion core/src/appleMain/kotlin/Modal.apple.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import androidx.compose.ui.window.DialogProperties
@OptIn(ExperimentalComposeUiApi::class)
@Composable
internal actual fun Modal(
protectNavBars: Boolean,
onKeyEvent: (KeyEvent) -> Boolean,
content: @Composable () -> Unit
) = androidx.compose.ui.window.Dialog(
Expand Down
1 change: 0 additions & 1 deletion core/src/commonMain/kotlin/Modal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.ui.input.key.KeyEvent

@Composable
internal expect fun Modal(
protectNavBars: Boolean = false,
onKeyEvent: (KeyEvent) -> Boolean = { false },
content: @Composable () -> Unit
)
4 changes: 2 additions & 2 deletions core/src/commonMain/kotlin/ModalBottomSheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import kotlinx.coroutines.delay

public data class ModalSheetProperties(
val dismissOnBackPress: Boolean = true,
val dismissOnClickOutside: Boolean = true
val dismissOnClickOutside: Boolean = true,
)

@Composable
Expand Down Expand Up @@ -163,7 +163,7 @@ public fun ModalBottomSheet(
{ false }
}

Modal(protectNavBars = true, onKeyEvent = onKeyEvent) {
Modal(onKeyEvent = onKeyEvent) {
Box(Modifier
.fillMaxSize()
.let {
Expand Down
1 change: 0 additions & 1 deletion core/src/jsMain/kotlin/Modal.js.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import androidx.compose.ui.window.DialogProperties
@OptIn(ExperimentalComposeUiApi::class)
@Composable
internal actual fun Modal(
protectNavBars: Boolean,
onKeyEvent: (KeyEvent) -> Boolean,
content: @Composable () -> Unit
) = androidx.compose.ui.window.Dialog(
Expand Down
1 change: 0 additions & 1 deletion core/src/jvmMain/kotlin/Modal.jvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import androidx.compose.ui.window.DialogProperties
@OptIn(ExperimentalComposeUiApi::class)
@Composable
internal actual fun Modal(
protectNavBars: Boolean,
onKeyEvent: (KeyEvent) -> Boolean,
content: @Composable () -> Unit
) = androidx.compose.ui.window.Dialog(
Expand Down
1 change: 0 additions & 1 deletion core/src/wasmJsMain/kotlin/Modal.wasmJs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import androidx.compose.ui.window.DialogProperties
@OptIn(ExperimentalComposeUiApi::class)
@Composable
internal actual fun Modal(
protectNavBars: Boolean,
onKeyEvent: (KeyEvent) -> Boolean,
content: @Composable () -> Unit
) = androidx.compose.ui.window.Dialog(
Expand Down

0 comments on commit 42685f3

Please sign in to comment.