Support inset on older devices. Although, in the case of no camera cutout, the insets are a little large because the nav bar becomes the minimum for symmetry..

This commit is contained in:
Henrik Rydgård committed 2026-03-14 22:24:54 +01:00
1 parent 0c6c0e5efc
commit 60eb1e5b8c
1 file changed
+2 -6
@@ -900,16 +900,12 @@ public class PpssppActivity extends AppCompatActivity implements SensorEventList
private void setInsetsListener(SurfaceView surfaceView) {
ViewCompat.setOnApplyWindowInsetsListener(surfaceView, (v, insets) -> {
if (Build.VERSION.SDK_INT >= 28) {
int orientation = getResources().getConfiguration().orientation;
updateInsets(insets, orientation); // replace your updateInsets() to support WindowInsetsCompat
}
updateInsets(insets); // replace your updateInsets() to support WindowInsetsCompat
return insets; // or WindowInsetsCompat.CONSUMED if you want to stop propagation
});
}
@RequiresApi(Build.VERSION_CODES.P)
private void updateInsets(WindowInsetsCompat insetCompat, int orientation) {
private void updateInsets(WindowInsetsCompat insetCompat) {
if (insetCompat == null) {
return;
}