summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/wifi
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2015-01-14 15:37:36 -0800
committerMaurice Lam <yukl@google.com>2015-01-15 14:33:31 -0800
commit859dcab128d804ec50f84779cdbf95f1505bae0e (patch)
treedc0516c7008bfc402d66b83506feaa5443462e2d /src/com/android/settings/wifi
parent2f08914e320ad142a24dd60edd17fbb93b504458 (diff)
downloadpackages_apps_Settings-859dcab128d804ec50f84779cdbf95f1505bae0e.tar.gz
packages_apps_Settings-859dcab128d804ec50f84779cdbf95f1505bae0e.tar.bz2
packages_apps_Settings-859dcab128d804ec50f84779cdbf95f1505bae0e.zip
Remove grey Wi-Fi icon from Setup Wizard
This removes the grey Wi-Fi icon from the empty-view in the Wi-Fi list of Setup Wizard. Also updated the style so it looks like the description text in other setup screens. Also fixed the view recycling by not calling getRootAdapter in onActivityCreated, since that will cause the Preference framework to not cache the AccessPoint preference. Bug: 17575719 Bug: 16518752 Change-Id: I06cbc88db1c04b29a9ce8221596265effc39b90b
Diffstat (limited to 'src/com/android/settings/wifi')
-rw-r--r--src/com/android/settings/wifi/WifiSettings.java2
-rw-r--r--src/com/android/settings/wifi/WifiSettingsForSetupWizard.java27
2 files changed, 9 insertions, 20 deletions
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 62529b41d..2baea83cd 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -652,7 +652,7 @@ public class WifiSettings extends RestrictedSettingsFragment
* Shows the latest access points available with supplemental information like
* the strength of network and the security for it.
*/
- private void updateAccessPoints() {
+ protected void updateAccessPoints() {
// Safeguard from some delayed event handling
if (getActivity() == null) return;
diff --git a/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
index c4a5c964b..554666dd5 100644
--- a/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
+++ b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java
@@ -18,7 +18,6 @@ package com.android.settings.wifi;
import android.content.Intent;
import android.content.res.TypedArray;
-import android.database.DataSetObserver;
import android.net.wifi.WifiConfiguration;
import android.os.Bundle;
import android.view.Gravity;
@@ -29,7 +28,6 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AbsListView.LayoutParams;
-import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
@@ -49,7 +47,6 @@ public class WifiSettingsForSetupWizard extends WifiSettings {
protected static final String EXTRA_SHOW_WIFI_REQUIRED_INFO = "wifi_show_wifi_required_info";
private View mAddOtherNetworkItem;
- private ListAdapter mAdapter;
private TextView mEmptyFooter;
private boolean mListLastEmpty = false;
@@ -98,15 +95,12 @@ public class WifiSettingsForSetupWizard extends WifiSettings {
if (hasNextButton()) {
getNextButton().setVisibility(View.GONE);
}
+ }
- mAdapter = getPreferenceScreen().getRootAdapter();
- mAdapter.registerDataSetObserver(new DataSetObserver() {
- @Override
- public void onChanged() {
- super.onChanged();
- updateFooter();
- }
- });
+ @Override
+ protected void updateAccessPoints() {
+ super.updateAccessPoints();
+ updateFooter(getPreferenceScreen().getPreferenceCount() == 0);
}
@Override
@@ -151,17 +145,12 @@ public class WifiSettingsForSetupWizard extends WifiSettings {
@Override
protected TextView initEmptyView() {
- mEmptyFooter = new TextView(getActivity());
- mEmptyFooter.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
- LayoutParams.MATCH_PARENT));
- mEmptyFooter.setGravity(Gravity.CENTER);
- mEmptyFooter.setCompoundDrawablesWithIntrinsicBounds(0,
- R.drawable.ic_wifi_emptystate, 0,0);
+ final LayoutInflater inflater = LayoutInflater.from(getActivity());
+ mEmptyFooter = (TextView) inflater.inflate(R.layout.setup_wifi_empty, getListView(), false);
return mEmptyFooter;
}
- protected void updateFooter() {
- final boolean isEmpty = mAdapter.isEmpty();
+ protected void updateFooter(boolean isEmpty) {
if (isEmpty != mListLastEmpty) {
final ListView list = getListView();
if (isEmpty) {