Changing wifi connection dialog per UX
- Added an advanced options checkbox and moving WPS, DHCP, Proxy to there - Minor string changes Change-Id: I7a135a483435379692a54ea0ef2663136c468945
This commit is contained in:
@@ -26,37 +26,6 @@
|
|||||||
<LinearLayout android:id="@+id/info"
|
<LinearLayout android:id="@+id/info"
|
||||||
style="@style/wifi_section" />
|
style="@style/wifi_section" />
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/setup_fields"
|
|
||||||
style="@style/wifi_item"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/wifi_item_label"
|
|
||||||
android:text="@string/wifi_network_setup" />
|
|
||||||
|
|
||||||
<Spinner android:id="@+id/network_setup"
|
|
||||||
style="@style/wifi_item_content"
|
|
||||||
android:prompt="@string/wifi_network_setup"
|
|
||||||
android:entries="@array/wifi_network_setup" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/wps_fields"
|
|
||||||
style="@style/wifi_item"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/wifi_item_label"
|
|
||||||
android:text="@string/wifi_wps_pin" />
|
|
||||||
|
|
||||||
<EditText android:id="@+id/wps_pin"
|
|
||||||
style="@style/wifi_item_content"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:inputType="textPassword" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/type"
|
<LinearLayout android:id="@+id/type"
|
||||||
style="@style/wifi_section"
|
style="@style/wifi_section"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
@@ -190,6 +159,50 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout android:id="@+id/wifi_advanced_toggle"
|
||||||
|
style="@style/wifi_item"
|
||||||
|
android:visibility="gone">
|
||||||
|
<CheckBox android:id="@+id/wifi_advanced_togglebox"
|
||||||
|
style="@style/wifi_item_content"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:text="@string/wifi_show_advanced" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout android:id="@+id/wifi_advanced_fields"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
<LinearLayout android:id="@+id/setup_fields"
|
||||||
|
style="@style/wifi_item"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/wifi_item_label"
|
||||||
|
android:text="@string/wifi_network_setup" />
|
||||||
|
|
||||||
|
<Spinner android:id="@+id/network_setup"
|
||||||
|
style="@style/wifi_item_content"
|
||||||
|
android:prompt="@string/wifi_network_setup"
|
||||||
|
android:entries="@array/wifi_network_setup" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout android:id="@+id/wps_fields"
|
||||||
|
style="@style/wifi_item"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/wifi_item_label"
|
||||||
|
android:text="@string/wifi_wps_pin" />
|
||||||
|
|
||||||
|
<EditText android:id="@+id/wps_pin"
|
||||||
|
style="@style/wifi_item_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:inputType="textPassword" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/proxy_settings_fields"
|
<LinearLayout android:id="@+id/proxy_settings_fields"
|
||||||
style="@style/wifi_item"
|
style="@style/wifi_item"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
@@ -337,6 +350,6 @@
|
|||||||
android:inputType="textNoSuggestions" />
|
android:inputType="textNoSuggestions" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@@ -457,13 +457,13 @@
|
|||||||
<!-- Note that adding/removing/moving items will need wifi settings code change. -->
|
<!-- Note that adding/removing/moving items will need wifi settings code change. -->
|
||||||
<string-array name="wifi_network_setup">
|
<string-array name="wifi_network_setup">
|
||||||
<!-- Manual wifi configuration [CHAR LIMIT=25]-->
|
<!-- Manual wifi configuration [CHAR LIMIT=25]-->
|
||||||
<item>Manual</item>
|
<item>Off</item>
|
||||||
<!-- WPS is a new standard that allowes secure connection establishment to a home wireless network using a simplified process. WPS push button based configuration involves pushing a button on the router and the device [CHAR LIMIT=25]-->
|
<!-- WPS is a new standard that allowes secure connection establishment to a home wireless network using a simplified process. WPS push button based configuration involves pushing a button on the router and the device [CHAR LIMIT=25]-->
|
||||||
<item>WPS push button</item>
|
<item>Push button</item>
|
||||||
<!-- WPS pin method based configuration. This requires entering a pin obtained from the access point [CHAR LIMIT=25] -->
|
<!-- WPS pin method based configuration. This requires entering a pin obtained from the access point [CHAR LIMIT=25] -->
|
||||||
<item>WPS pin from access point</item>
|
<item>Pin from access point</item>
|
||||||
<!-- WPS pin method based configuration. This requires generating a pin from this device [CHAR LIMIT=25] -->
|
<!-- WPS pin method based configuration. This requires generating a pin from this device [CHAR LIMIT=25] -->
|
||||||
<item>WPS pin from this device</item>
|
<item>Pin from this device</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Wi-Fi IP settings. -->
|
<!-- Wi-Fi IP settings. -->
|
||||||
|
@@ -1165,8 +1165,10 @@
|
|||||||
<string name="wifi_empty_list_wifi_off">To see available networks, turn Wi-Fi on.</string>
|
<string name="wifi_empty_list_wifi_off">To see available networks, turn Wi-Fi on.</string>
|
||||||
|
|
||||||
<!-- Dialog for Access Points --> <skip />
|
<!-- Dialog for Access Points --> <skip />
|
||||||
|
<!-- Label to show/hide advanced options -->
|
||||||
|
<string name="wifi_show_advanced">Show advanced options</string>
|
||||||
<!-- Label for network setup [CHAR LIMIT=50] -->
|
<!-- Label for network setup [CHAR LIMIT=50] -->
|
||||||
<string name="wifi_network_setup">Network Setup</string>
|
<string name="wifi_network_setup">WPS</string>
|
||||||
<!-- Label for the text view for WPS pin input [CHAR LIMIT=50] -->
|
<!-- Label for the text view for WPS pin input [CHAR LIMIT=50] -->
|
||||||
<string name="wifi_wps_pin">Enter pin from access point</string>
|
<string name="wifi_wps_pin">Enter pin from access point</string>
|
||||||
<!-- Title for the WPS setup dialog [CHAR LIMIT=50] -->
|
<!-- Title for the WPS setup dialog [CHAR LIMIT=50] -->
|
||||||
|
@@ -182,8 +182,6 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
addRow(group, R.string.wifi_status, Summary.get(mConfigUi.getContext(), state));
|
addRow(group, R.string.wifi_status, Summary.get(mConfigUi.getContext(), state));
|
||||||
}
|
}
|
||||||
|
|
||||||
addRow(group, R.string.wifi_security, mAccessPoint.getSecurityString(false));
|
|
||||||
|
|
||||||
int level = mAccessPoint.getLevel();
|
int level = mAccessPoint.getLevel();
|
||||||
if (level != -1) {
|
if (level != -1) {
|
||||||
String[] signal = resources.getStringArray(R.array.wifi_signal);
|
String[] signal = resources.getStringArray(R.array.wifi_signal);
|
||||||
@@ -195,10 +193,14 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
addRow(group, R.string.wifi_speed, info.getLinkSpeed() + WifiInfo.LINK_SPEED_UNITS);
|
addRow(group, R.string.wifi_speed, info.getLinkSpeed() + WifiInfo.LINK_SPEED_UNITS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addRow(group, R.string.wifi_security, mAccessPoint.getSecurityString(false));
|
||||||
|
|
||||||
|
boolean showAdvancedFields = false;
|
||||||
if (mAccessPoint.networkId != INVALID_NETWORK_ID) {
|
if (mAccessPoint.networkId != INVALID_NETWORK_ID) {
|
||||||
WifiConfiguration config = mAccessPoint.getConfig();
|
WifiConfiguration config = mAccessPoint.getConfig();
|
||||||
if (config.ipAssignment == IpAssignment.STATIC) {
|
if (config.ipAssignment == IpAssignment.STATIC) {
|
||||||
mIpSettingsSpinner.setSelection(STATIC_IP);
|
mIpSettingsSpinner.setSelection(STATIC_IP);
|
||||||
|
showAdvancedFields = true;
|
||||||
} else {
|
} else {
|
||||||
mIpSettingsSpinner.setSelection(DHCP);
|
mIpSettingsSpinner.setSelection(DHCP);
|
||||||
}
|
}
|
||||||
@@ -210,6 +212,7 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
|
|
||||||
if (config.proxySettings == ProxySettings.STATIC) {
|
if (config.proxySettings == ProxySettings.STATIC) {
|
||||||
mProxySettingsSpinner.setSelection(PROXY_STATIC);
|
mProxySettingsSpinner.setSelection(PROXY_STATIC);
|
||||||
|
showAdvancedFields = true;
|
||||||
} else {
|
} else {
|
||||||
mProxySettingsSpinner.setSelection(PROXY_NONE);
|
mProxySettingsSpinner.setSelection(PROXY_NONE);
|
||||||
}
|
}
|
||||||
@@ -224,6 +227,12 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
showSecurityFields();
|
showSecurityFields();
|
||||||
showIpConfigFields();
|
showIpConfigFields();
|
||||||
showProxyFields();
|
showProxyFields();
|
||||||
|
mView.findViewById(R.id.wifi_advanced_toggle).setVisibility(View.VISIBLE);
|
||||||
|
mView.findViewById(R.id.wifi_advanced_togglebox).setOnClickListener(this);
|
||||||
|
if (showAdvancedFields) {
|
||||||
|
((CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox)).setChecked(true);
|
||||||
|
mView.findViewById(R.id.wifi_advanced_fields).setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEdit) {
|
if (mEdit) {
|
||||||
@@ -726,10 +735,18 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
if (view.getId() == R.id.show_password) {
|
||||||
mPasswordView.setInputType(
|
mPasswordView.setInputType(
|
||||||
InputType.TYPE_CLASS_TEXT | (((CheckBox) view).isChecked() ?
|
InputType.TYPE_CLASS_TEXT | (((CheckBox) view).isChecked() ?
|
||||||
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
|
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
|
||||||
InputType.TYPE_TEXT_VARIATION_PASSWORD));
|
InputType.TYPE_TEXT_VARIATION_PASSWORD));
|
||||||
|
} else if (view.getId() == R.id.wifi_advanced_togglebox) {
|
||||||
|
if (((CheckBox) view).isChecked()) {
|
||||||
|
mView.findViewById(R.id.wifi_advanced_fields).setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mView.findViewById(R.id.wifi_advanced_fields).setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user