[Wi-Fi] Request focus on input field when config a WiFi network
For better user experience, recover the dialog focus command to get password field focused. Bug: 158393164 Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiConfigController2Test Change-Id: I343a7b43bd1ad2478991051b0bd8ef6082f75dc1
This commit is contained in:
@@ -113,8 +113,7 @@ public class ConfigureWifiEntryFragment extends InstrumentedFragment implements
|
||||
mSubmitBtn.setOnClickListener(view -> handleSubmitAction());
|
||||
mCancelBtn.setOnClickListener(view -> handleCancelAction());
|
||||
|
||||
mUiController = new WifiConfigController2(this, rootView, mWifiEntry,
|
||||
getMode(), false /* requestFocus */);
|
||||
mUiController = new WifiConfigController2(this, rootView, mWifiEntry, getMode());
|
||||
|
||||
/**
|
||||
* For this add WifiEntry UI, need to remove the Home button, so set related feature as
|
||||
|
@@ -193,7 +193,6 @@ public class WifiConfigController2 implements TextWatcher,
|
||||
private ProxySettings mProxySettings = ProxySettings.UNASSIGNED;
|
||||
private ProxyInfo mHttpProxy = null;
|
||||
private StaticIpConfiguration mStaticIpConfiguration = null;
|
||||
private boolean mRequestFocus = true;
|
||||
|
||||
private String[] mLevels;
|
||||
private int mMode;
|
||||
@@ -208,17 +207,10 @@ public class WifiConfigController2 implements TextWatcher,
|
||||
|
||||
public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
|
||||
int mode) {
|
||||
this (parent, view, wifiEntry, mode, true /* requestFocus */);
|
||||
}
|
||||
|
||||
public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
|
||||
int mode, boolean requestFocus) {
|
||||
mConfigUi = parent;
|
||||
|
||||
mView = view;
|
||||
mWifiEntry = wifiEntry;
|
||||
mContext = mConfigUi.getContext();
|
||||
mRequestFocus = requestFocus;
|
||||
|
||||
// Init Wi-Fi manager
|
||||
mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
|
||||
@@ -443,10 +435,8 @@ public class WifiConfigController2 implements TextWatcher,
|
||||
enableSubmitIfAppropriate();
|
||||
}
|
||||
|
||||
// After done view show and hide, request focus from parameter.
|
||||
if (mRequestFocus) {
|
||||
mView.findViewById(R.id.l_wifidialog).requestFocus();
|
||||
}
|
||||
// After done view show and hide, request focus
|
||||
mView.findViewById(R.id.l_wifidialog).requestFocus();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
Reference in New Issue
Block a user