mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
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.
This commit is contained in:
@@ -1006,18 +1006,38 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
|
||||
@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 abstract class NativeActivity extends Activity implements SurfaceHolder.C
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user