Disable insets unless android >= 15
This commit is contained in:
parent
bdbf551132
commit
a48aaffec4
1 changed files with 5 additions and 2 deletions
|
@ -67,8 +67,9 @@ public class MainActivity extends BridgeActivity {
|
||||||
});
|
});
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
var useInsets = Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
|
var useInsets = Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
|
||||||
WindowCompat.setDecorFitsSystemWindows(getWindow(), useInsets);
|
Log.i("Insets","Using insets:"+useInsets+", sdk_int:"+Build.VERSION.SDK_INT+" "+Build.VERSION_CODES.UPSIDE_DOWN_CAKE);
|
||||||
|
WindowCompat.setDecorFitsSystemWindows(getWindow(), !useInsets);
|
||||||
if(useInsets) {
|
if(useInsets) {
|
||||||
Databridge.addResponder("insets", (responder) -> {
|
Databridge.addResponder("insets", (responder) -> {
|
||||||
var view = getWindow().getDecorView();
|
var view = getWindow().getDecorView();
|
||||||
|
@ -80,6 +81,8 @@ public class MainActivity extends BridgeActivity {
|
||||||
Log.i("insets", "Inset sizes are:" + topInsetPxSize + " bottom:" + bottomInsetPxSize);
|
Log.i("insets", "Inset sizes are:" + topInsetPxSize + " bottom:" + bottomInsetPxSize);
|
||||||
Databridge.sendAnswerTo(responder, json);
|
Databridge.sendAnswerTo(responder, json);
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
Log.i("insets","Not enabling insets, version to low");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue