Skip to content

Commit

Permalink
Replace AnchorDrawable with Foundation's 1.7.0
Browse files Browse the repository at this point in the history
Fixes #35
  • Loading branch information
alexstyl committed Oct 26, 2024
1 parent 689fefb commit 49ad6f5
Show file tree
Hide file tree
Showing 21 changed files with 7,429 additions and 980 deletions.
15 changes: 10 additions & 5 deletions core/src/androidMain/kotlin/Modal.android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ internal actual fun Modal(
?: error("Attempted to get the dialog's window without content. This should never happen and it's a bug in the library. Kindly open an issue with the steps to reproduce so that we fix it ASAP: https://github.com/composablehorizons/compose-unstyled/issues/new")
CompositionLocalProvider(LocalModalWindow provides localWindow) {
Box(Modifier.onKeyEvent(onKeyEvent)) {
BackHandler {
val backKeyDown = NativeKeyEvent(NativeKeyEvent.ACTION_DOWN, NativeKeyEvent.KEYCODE_BACK)
val backPress = KeyEvent(backKeyDown)
onKeyEvent(backPress)
}
BackHandler(
onBack = {
val backKeyDown = NativeKeyEvent(
NativeKeyEvent.ACTION_DOWN, NativeKeyEvent.KEYCODE_BACK
)
val backPress = KeyEvent(backKeyDown)
onKeyEvent(backPress)
}
)
content()
}
}
Expand All @@ -78,6 +82,7 @@ internal actual fun Modal(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)
} else {
@Suppress("DEPRECATION")
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
}

Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 49ad6f5

Please sign in to comment.