mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
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:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user