File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
examples/ExpoMessaging/plugins Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const requiredImports = [
44 'import android.os.Build' ,
55 'import android.os.Bundle' ,
66 'import android.view.View' ,
7+ 'import androidx.core.graphics.Insets' ,
78 'import androidx.core.view.ViewCompat' ,
89 'import androidx.core.view.WindowInsetsCompat' ,
910 'import androidx.core.view.updatePadding' ,
@@ -13,19 +14,22 @@ const customInsetHandler = `
1314 if (Build.VERSION.SDK_INT >= 35) {
1415 val rootView = findViewById<View>(android.R.id.content)
1516
17+ val initial = Insets.of(
18+ rootView.paddingLeft,
19+ rootView.paddingTop,
20+ rootView.paddingRight,
21+ rootView.paddingBottom
22+ )
23+
1624 ViewCompat.setOnApplyWindowInsetsListener(rootView) { view, insets ->
17- val bars = insets.getInsets(
18- WindowInsetsCompat.Type.systemBars()
19- or WindowInsetsCompat.Type.displayCutout()
20- or WindowInsetsCompat.Type.ime()
21- )
25+ val ime = insets.getInsets(WindowInsetsCompat.Type.ime())
2226 rootView.updatePadding(
23- left = bars .left,
24- top = bars .top,
25- right = bars .right,
26- bottom = bars .bottom
27+ left = initial .left,
28+ top = initial .top,
29+ right = initial .right,
30+ bottom = initial.bottom + ime .bottom
2731 )
28- WindowInsetsCompat.CONSUMED
32+ insets
2933 }
3034 }
3135` ;
You can’t perform that action at this time.
0 commit comments