DO NOT MERGE Proxy and IP fixes

Fix dual display of IP addresses for static IP
Fix inputType for proxy and IP fields
Add hint texts for IP fields

Change-Id: I5b556a07c2a5b69ecec959c933f2872e70496946
This commit is contained in:
Irfan Sheriff
2011-03-02 14:39:32 -08:00
committed by Irfan SHeriff
parent d61737b560
commit 00615cf5dc
4 changed files with 32 additions and 7 deletions

View File

@@ -232,6 +232,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:inputType="textNoSuggestions"
android:hint="@string/proxy_hostname_hint" /> android:hint="@string/proxy_hostname_hint" />
<TextView android:layout_width="fill_parent" <TextView android:layout_width="fill_parent"
@@ -242,6 +243,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:inputType="number"
android:hint="@string/proxy_port_hint" /> android:hint="@string/proxy_port_hint" />
<TextView android:layout_width="fill_parent" <TextView android:layout_width="fill_parent"
@@ -252,6 +254,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:inputType="textNoSuggestions"
android:hint="@string/proxy_exclusionlist_hint" /> android:hint="@string/proxy_exclusionlist_hint" />
</LinearLayout> </LinearLayout>
@@ -288,6 +291,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:hint="wifi_ip_address_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
<TextView <TextView
@@ -299,6 +303,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:hint="wifi_gateway_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
<TextView <TextView
@@ -310,7 +315,8 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:inputType="textNoSuggestions" /> android:hint="wifi_network_prefix_length_hint"
android:inputType="number" />
<TextView <TextView
android:layout_width="fill_parent" android:layout_width="fill_parent"
@@ -321,6 +327,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:hint="wifi_dns1_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
<TextView <TextView
@@ -332,6 +339,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:hint="wifi_dns2_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
</LinearLayout> </LinearLayout>

View File

@@ -227,6 +227,7 @@
<EditText android:id="@+id/proxy_hostname" <EditText android:id="@+id/proxy_hostname"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:hint="@string/proxy_hostname_hint" android:hint="@string/proxy_hostname_hint"
android:inputType="textNoSuggestions"
android:singleLine="true" /> android:singleLine="true" />
</LinearLayout> </LinearLayout>
<LinearLayout style="@style/wifi_item"> <LinearLayout style="@style/wifi_item">
@@ -237,6 +238,7 @@
<EditText android:id="@+id/proxy_port" <EditText android:id="@+id/proxy_port"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:hint="@string/proxy_port_hint" android:hint="@string/proxy_port_hint"
android:inputType="number"
android:singleLine="true" /> android:singleLine="true" />
</LinearLayout> </LinearLayout>
<LinearLayout style="@style/wifi_item"> <LinearLayout style="@style/wifi_item">
@@ -247,6 +249,7 @@
<EditText android:id="@+id/proxy_exclusionlist" <EditText android:id="@+id/proxy_exclusionlist"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:hint="@string/proxy_exclusionlist_hint" android:hint="@string/proxy_exclusionlist_hint"
android:inputType="textNoSuggestions"
android:singleLine="true" /> android:singleLine="true" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
@@ -278,6 +281,7 @@
<EditText android:id="@+id/ipaddress" <EditText android:id="@+id/ipaddress"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:singleLine="true" android:singleLine="true"
android:hint="@string/wifi_ip_address_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
</LinearLayout> </LinearLayout>
@@ -290,6 +294,7 @@
<EditText android:id="@+id/gateway" <EditText android:id="@+id/gateway"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:singleLine="true" android:singleLine="true"
android:hint="@string/wifi_gateway_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
</LinearLayout> </LinearLayout>
@@ -302,7 +307,8 @@
<EditText android:id="@+id/network_prefix_length" <EditText android:id="@+id/network_prefix_length"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:singleLine="true" android:singleLine="true"
android:inputType="textNoSuggestions" /> android:hint="@string/wifi_network_prefix_length_hint"
android:inputType="number" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
style="@style/wifi_item" > style="@style/wifi_item" >
@@ -313,6 +319,7 @@
<EditText android:id="@+id/dns1" <EditText android:id="@+id/dns1"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:singleLine="true" android:singleLine="true"
android:hint="@string/wifi_dns1_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
</LinearLayout> </LinearLayout>
@@ -325,6 +332,7 @@
<EditText android:id="@+id/dns2" <EditText android:id="@+id/dns2"
style="@style/wifi_item_content" style="@style/wifi_item_content"
android:singleLine="true" android:singleLine="true"
android:hint="@string/wifi_dns2_hint"
android:inputType="textNoSuggestions" /> android:inputType="textNoSuggestions" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@@ -1092,6 +1092,8 @@
<string name="wifi_speed">Link speed</string> <string name="wifi_speed">Link speed</string>
<!-- Label for the IP address of the connection --> <!-- Label for the IP address of the connection -->
<string name="wifi_ip_address">IP address</string> <string name="wifi_ip_address">IP address</string>
<!-- Hint text for the IP address [CHAR LIMIT=25]-->
<string name="wifi_ip_address_hint">192.168.1.128</string>
<!-- Label for the EAP method of the network --> <!-- Label for the EAP method of the network -->
<string name="wifi_eap_method">EAP method</string> <string name="wifi_eap_method">EAP method</string>
<!-- Label for the phase2 --> <!-- Label for the phase2 -->
@@ -1171,12 +1173,20 @@
<string name="wifi_ip_settings_invalid_network_prefix_length">Please type a network prefix length between 0 and 32.</string> <string name="wifi_ip_settings_invalid_network_prefix_length">Please type a network prefix length between 0 and 32.</string>
<!-- Label for the DNS (first one) --> <!-- Label for the DNS (first one) -->
<string name="wifi_dns1">DNS 1</string> <string name="wifi_dns1">DNS 1</string>
<!-- Hint text for DNS [CHAR LIMIT=25]-->
<string name="wifi_dns1_hint">8.8.8.8</string>
<!-- Label for the DNS (second one)--> <!-- Label for the DNS (second one)-->
<string name="wifi_dns2">DNS 2</string> <string name="wifi_dns2">DNS 2</string>
<!-- Hint text for DNS [CHAR LIMIT=25]-->
<string name="wifi_dns2_hint">4.4.4.4</string>
<!-- Label for the gateway of the network --> <!-- Label for the gateway of the network -->
<string name="wifi_gateway">Gateway</string> <string name="wifi_gateway">Gateway</string>
<!-- Hint text for the gateway [CHAR LIMIT=25]-->
<string name="wifi_gateway_hint">192.168.1.1</string>
<!-- Label for the network prefix of the network [CHAR LIMIT=25]--> <!-- Label for the network prefix of the network [CHAR LIMIT=25]-->
<string name="wifi_network_prefix_length">Network prefix length</string> <string name="wifi_network_prefix_length">Network prefix length</string>
<!-- Hint text for network prefix length [CHAR LIMIT=25] -->
<string name="wifi_network_prefix_length_hint">24</string>
<!-- Wifi AP settings--> <!-- Wifi AP settings-->
<!-- Label for wifi tether checkbox. Toggles Access Point on/off --> <!-- Label for wifi tether checkbox. Toggles Access Point on/off -->

View File

@@ -198,11 +198,6 @@ public class WifiConfigController implements TextWatcher,
WifiInfo info = mAccessPoint.getInfo(); WifiInfo info = mAccessPoint.getInfo();
if (info != null) { if (info != null) {
addRow(group, R.string.wifi_speed, info.getLinkSpeed() + WifiInfo.LINK_SPEED_UNITS); addRow(group, R.string.wifi_speed, info.getLinkSpeed() + WifiInfo.LINK_SPEED_UNITS);
// TODO: fix the ip address for IPv6.
int address = info.getIpAddress();
if (address != 0) {
addRow(group, R.string.wifi_ip_address, Formatter.formatIpAddress(address));
}
} }
if (mAccessPoint.networkId != INVALID_NETWORK_ID) { if (mAccessPoint.networkId != INVALID_NETWORK_ID) {
@@ -211,6 +206,10 @@ public class WifiConfigController implements TextWatcher,
mIpSettingsSpinner.setSelection(STATIC_IP); mIpSettingsSpinner.setSelection(STATIC_IP);
} else { } else {
mIpSettingsSpinner.setSelection(DHCP); mIpSettingsSpinner.setSelection(DHCP);
//Display IP addresses
for(InetAddress a : config.linkProperties.getAddresses()) {
addRow(group, R.string.wifi_ip_address, a.getHostAddress());
}
} }
if (config.proxySettings == ProxySettings.STATIC) { if (config.proxySettings == ProxySettings.STATIC) {