Disable insets unless android >= 15
This commit is contained in:
parent
4bb7346a3b
commit
bdbf551132
1 changed files with 13 additions and 11 deletions
|
|
@ -67,7 +67,9 @@ public class MainActivity extends BridgeActivity {
|
|||
});
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
|
||||
var useInsets = Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
|
||||
WindowCompat.setDecorFitsSystemWindows(getWindow(), useInsets);
|
||||
if(useInsets) {
|
||||
Databridge.addResponder("insets", (responder) -> {
|
||||
var view = getWindow().getDecorView();
|
||||
var insets = view.getRootWindowInsets();
|
||||
|
|
@ -78,7 +80,7 @@ public class MainActivity extends BridgeActivity {
|
|||
Log.i("insets", "Inset sizes are:" + topInsetPxSize + " bottom:" + bottomInsetPxSize);
|
||||
Databridge.sendAnswerTo(responder, json);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
getOnBackInvokedDispatcher().registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_OVERLAY,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue