attempt to fix the random zero insets on Android 15
This commit is contained in:
parent
cabf69fa27
commit
1c7bbc7508
2 changed files with 14 additions and 0 deletions
|
|
@ -87,6 +87,18 @@ abstract class BaseMainLayout {
|
|||
}
|
||||
|
||||
|
||||
protected void preventEdgeToEdge() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM || tt9 == null || tt9.isInputLimited()) {
|
||||
return;
|
||||
}
|
||||
|
||||
WindowInsets insets = view != null ? view.getRootWindowInsets() : null;
|
||||
if (insets != null) {
|
||||
preventEdgeToEdge(view, insets);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void requestPreventEdgeToEdge() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM && view != null) {
|
||||
view.requestApplyInsets();
|
||||
|
|
|
|||
|
|
@ -282,5 +282,7 @@ class MainLayoutNumpad extends BaseMainLayout {
|
|||
for (SoftKey key : getKeys()) {
|
||||
key.render();
|
||||
}
|
||||
|
||||
preventEdgeToEdge();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue