[WifiSetup] Make dialogs immersive

Added a dialog specific applyImmersiveFlags method that adds
immersive flags without the LAYOUT_ flags. The LAYOUT_ flags causes
the dialog to not resize when IME is visible, and the dialog doesn't
need to be drawn under the navigation / status bars anyway.

Bug: 17759269
Change-Id: I0186e85d9f398af73c511b1a5ec6e83febe97f83
This commit is contained in:
Maurice Lam
2015-01-22 11:33:28 -08:00
parent 342d08537f
commit 3f7c09bd5a
3 changed files with 38 additions and 11 deletions

View File

@@ -263,24 +263,26 @@ public class WifiSetupActivity extends WifiPickerActivity
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
int messageRes = getArguments().getInt("messageRes");
return new AlertDialog.Builder(getActivity())
final AlertDialog dialog = new AlertDialog.Builder(getActivity())
.setMessage(messageRes)
.setCancelable(false)
.setPositiveButton(R.string.wifi_skip_anyway,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
WifiSetupActivity activity = (WifiSetupActivity) getActivity();
activity.finishOrNext(RESULT_SKIP);
}
})
@Override
public void onClick(DialogInterface dialog, int id) {
WifiSetupActivity activity = (WifiSetupActivity) getActivity();
activity.finishOrNext(RESULT_SKIP);
}
})
.setNegativeButton(R.string.wifi_dont_skip,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
}
})
@Override
public void onClick(DialogInterface dialog, int id) {
}
})
.create();
SetupWizardUtils.applyImmersiveFlags(dialog);
return dialog;
}
}
}