Android: Setup UI callback earlier if possible.

This commit is contained in:
Unknown W. Brackets authored and Henrik Rydgård committed 2019-10-15 10:17:41 +02:00
1 parent ccfc704199
commit 648dccb49e
1 file changed
+7 -1
@@ -838,8 +838,10 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
@Override
public void onAttachedToWindow() {
Log.i(TAG, "onAttachedToWindow");
super.onAttachedToWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
Log.i(TAG, "onAttachedToWindow");
DisplayCutout cutout = getWindow().getDecorView().getRootWindowInsets().getDisplayCutout();
if (cutout != null) {
safeInsetLeft = cutout.getSafeInsetLeft();
@@ -855,6 +857,10 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
safeInsetBottom = 0;
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setupSystemUiCallback();
}
}
@Override