Request focus in wifi screen in add network and secure wifi
Request focus from parent view in controller. Based on framework patch, it can be placed in a parent and focus will go to whatever view is the default focusable in that hierarchy. Fixes: 68776177 Fixes: 72882629 Test: RunSettingsRobotests and Manual test Change-Id: I3bcdc4ec814f68079a00e40435f46bdfa53f4425
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
android:scrollIndicators="top|bottom">
|
android:scrollIndicators="top|bottom">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/l_wifidialog"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
@@ -363,6 +363,9 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
if (mConfigUi.getSubmitButton() != null) {
|
if (mConfigUi.getSubmitButton() != null) {
|
||||||
enableSubmitIfAppropriate();
|
enableSubmitIfAppropriate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// After done view show and hide, request focus from parent view
|
||||||
|
mView.findViewById(R.id.l_wifidialog).requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
@@ -230,6 +230,22 @@ public class WifiConfigControllerTest {
|
|||||||
// No Crash
|
// No Crash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void ssidGetFocus_addNewNetwork_shouldReturnTrue() {
|
||||||
|
mController = new TestWifiConfigController(mConfigUiBase, mView, null /* accessPoint */,
|
||||||
|
WifiConfigUiBase.MODE_CONNECT);
|
||||||
|
final TextView ssid = mView.findViewById(R.id.ssid);
|
||||||
|
// Verify ssid text get focus when add new network (accesspoint is null)
|
||||||
|
assertThat(ssid.isFocused()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void passwordGetFocus_connectSecureWifi_shouldReturnTrue() {
|
||||||
|
final TextView password = mView.findViewById(R.id.password);
|
||||||
|
// Verify password get focus when connect to secure wifi without eap type
|
||||||
|
assertThat(password.isFocused()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
public class TestWifiConfigController extends WifiConfigController {
|
public class TestWifiConfigController extends WifiConfigController {
|
||||||
|
|
||||||
private TestWifiConfigController(
|
private TestWifiConfigController(
|
||||||
|
Reference in New Issue
Block a user