Merge "Set WifiDialog to light theme in setup flow" into qt-dev

This commit is contained in:
Pasty Chang
2019-04-16 02:53:29 +00:00
committed by Android (Google) Code Review
5 changed files with 60 additions and 5 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.wifi;
import android.annotation.StyleRes;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -64,11 +65,21 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
public static WifiDialog createModal(Context context, WifiDialogListener listener,
AccessPoint accessPoint, int mode) {
return new WifiDialog(context, listener, accessPoint, mode, 0 /* style */,
mode == WifiConfigUiBase.MODE_VIEW /* hideSubmitButton*/);
mode == WifiConfigUiBase.MODE_VIEW /* hideSubmitButton */);
}
/**
* Creates a WifiDialog with customized style. It displays as a dialog above the current
* view.
*/
public static WifiDialog createModal(Context context, WifiDialogListener listener,
AccessPoint accessPoint, int mode, @StyleRes int style) {
return new WifiDialog(context, listener, accessPoint, mode, style,
mode == WifiConfigUiBase.MODE_VIEW /* hideSubmitButton */);
}
/* package */ WifiDialog(Context context, WifiDialogListener listener, AccessPoint accessPoint,
int mode, int style, boolean hideSubmitButton) {
int mode, @StyleRes int style, boolean hideSubmitButton) {
super(context, style);
mMode = mode;
mListener = listener;

View File

@@ -28,6 +28,7 @@ import android.util.Log;
import androidx.annotation.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.wifi.dpp.WifiDppUtils;
import com.android.settingslib.wifi.AccessPoint;
@@ -74,8 +75,13 @@ public class WifiDialogActivity extends Activity implements WifiDialog.WifiDialo
accessPoint = new AccessPoint(this, accessPointState);
}
mDialog = WifiDialog.createModal(
this, this, accessPoint, WifiConfigUiBase.MODE_CONNECT);
if (WizardManagerHelper.isAnySetupWizard(getIntent())) {
mDialog = WifiDialog.createModal(this, this, accessPoint,
WifiConfigUiBase.MODE_CONNECT, R.style.SuwAlertDialogThemeCompat_Light);
} else {
mDialog = WifiDialog.createModal(
this, this, accessPoint, WifiConfigUiBase.MODE_CONNECT);
}
mDialog.show();
mDialog.setOnDismissListener(this);
}