Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 133017c

Browse files
authored
Merge pull request #1785 from reicast/skmp/fix-fullscreen-resize
Android: Remove View.SYSTEM_UI_FLAG_LAYOUT_STABLE, move IMMERSIVE logic to activity
2 parents 79b45a5 + a0b41ac commit 133017c

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

reicast/android-studio/reicast/src/main/java/com/reicast/emulator/NativeGLActivity.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package com.reicast.emulator;
22

3+
import android.annotation.TargetApi;
34
import android.app.Activity;
45
import android.app.AlertDialog;
56
import android.content.DialogInterface;
7+
import android.os.Build;
68
import android.os.Bundle;
79
import android.os.Handler;
810
import android.os.Looper;
911
import android.support.annotation.Nullable;
12+
import android.view.View;
1013
import android.view.ViewGroup;
1114
import android.view.Window;
1215
import android.widget.RelativeLayout;
@@ -120,4 +123,20 @@ public void onClick(DialogInterface dialog, int id) {
120123

121124
return 1;
122125
}
126+
127+
@TargetApi(19)
128+
@Override
129+
public void onWindowFocusChanged(boolean hasFocus) {
130+
super.onWindowFocusChanged(hasFocus);
131+
if (hasFocus && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
132+
View decorView = getWindow().getDecorView();
133+
decorView.setSystemUiVisibility(
134+
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
135+
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
136+
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
137+
| View.SYSTEM_UI_FLAG_FULLSCREEN
138+
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
139+
/* not using SYSTEM_UI_FLAG_LAYOUT_STABLE as it seems to be buggy on Pixel3a ~ skmp*/
140+
}
141+
}
123142
}

reicast/android-studio/reicast/src/main/java/com/reicast/emulator/emu/NativeGLView.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,6 @@ public void resume() {
120120
}
121121
}
122122

123-
@TargetApi(19)
124-
@Override
125-
public void onWindowFocusChanged(boolean hasFocus) {
126-
super.onWindowFocusChanged(hasFocus);
127-
if (hasFocus && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
128-
setSystemUiVisibility(
129-
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
130-
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
131-
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
132-
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
133-
| View.SYSTEM_UI_FLAG_FULLSCREEN
134-
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
135-
requestLayout();
136-
}
137-
}
138-
139123
public void readCustomVjoyValues() {
140124
vjoyDelegate.readCustomVjoyValues();
141125
}

0 commit comments

Comments
 (0)