Permalink
Browse files

Android: Reset immersive after native dialogs.

Not sure why it only happens on OpenGL, but it implies we need to reset
the state after the alert is dismissed.  Fixes #10177.
  • Loading branch information...
unknownbrackets committed Dec 4, 2017
1 parent a5998e6 commit 2e87a652a47b34a47aa87f633dbe8fafdb26bf8f
Showing with 35 additions and 13 deletions.
  1. +35 −13 android/src/org/ppsspp/ppsspp/NativeActivity.java
@@ -1006,18 +1006,38 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
@TargetApi(11)
@SuppressWarnings("deprecation")
private AlertDialog.Builder createDialogBuilderWithTheme() {
return new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_DARK);
return new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_DARK);
}
@TargetApi(14)
@SuppressWarnings("deprecation")
private AlertDialog.Builder createDialogBuilderWithDeviceTheme() {
return new AlertDialog.Builder(this, AlertDialog.THEME_DEVICE_DEFAULT_DARK);
return new AlertDialog.Builder(this, AlertDialog.THEME_DEVICE_DEFAULT_DARK);
}
@TargetApi(17)
@SuppressWarnings("deprecation")
private AlertDialog.Builder createDialogBuilderWithDeviceThemeAndUiVisibility() {
AlertDialog.Builder bld = new AlertDialog.Builder(this, AlertDialog.THEME_DEVICE_DEFAULT_DARK);
bld.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
updateSystemUiVisibility();
}
});
return bld;
}
@TargetApi(23)
private AlertDialog.Builder createDialogBuilderNew() {
return new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_Dialog_Alert);
AlertDialog.Builder bld = new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_Dialog_Alert);
bld.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
updateSystemUiVisibility();
}
});
return bld;
}
// The return value is sent elsewhere. TODO in java, in SendMessage in C++.
@@ -1034,16 +1054,18 @@ public void inputBox(final String title, String defaultText, String defaultActio
input.setText(defaultText);
input.selectAll();
// Lovely!
AlertDialog.Builder bld;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)
bld = new AlertDialog.Builder(this);
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH)
bld = createDialogBuilderWithTheme();
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
bld = createDialogBuilderWithDeviceTheme();
else
bld = createDialogBuilderNew();
// Lovely!
AlertDialog.Builder bld;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)
bld = new AlertDialog.Builder(this);
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH)
bld = createDialogBuilderWithTheme();
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
bld = createDialogBuilderWithDeviceTheme();
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
bld = createDialogBuilderWithDeviceThemeAndUiVisibility();
else
bld = createDialogBuilderNew();
AlertDialog dlg = bld
.setView(fl)

0 comments on commit 2e87a65

Please sign in to comment.