Merge "[WifiSetup] Make dialogs immersive"
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.wifi;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.net.wifi.WifiConfiguration;
|
||||
import android.os.Bundle;
|
||||
@@ -29,6 +30,7 @@ import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SetupWizardUtils;
|
||||
|
||||
/**
|
||||
* This customized version of WifiSettings is shown to the user only during Setup Wizard. Menu
|
||||
@@ -118,6 +120,13 @@ public class WifiSettingsForSetupWizard extends WifiSettings {
|
||||
// Do not show menu during setup wizard
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(int dialogId) {
|
||||
final Dialog dialog = super.onCreateDialog(dialogId);
|
||||
SetupWizardUtils.applyImmersiveFlags(dialog);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void connect(final WifiConfiguration config) {
|
||||
WifiSetupActivity activity = (WifiSetupActivity) getActivity();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user