1
0
Fork 0

attempt to fix the random zero insets on Android 15

This commit is contained in:
sspanak 2025-02-20 18:04:42 +02:00 committed by Dimo Karaivanov
parent cabf69fa27
commit 1c7bbc7508
2 changed files with 14 additions and 0 deletions

View file

@ -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();

View file

@ -282,5 +282,7 @@ class MainLayoutNumpad extends BaseMainLayout {
for (SoftKey key : getKeys()) {
key.render();
}
preventEdgeToEdge();
}
}