diff options
author | Russell Brenner <russellbrenner@google.com> | 2013-08-28 09:44:30 -0700 |
---|---|---|
committer | Russell Brenner <russellbrenner@google.com> | 2013-08-30 10:10:02 -0700 |
commit | ac57f3e1eb56998550534c1b32d99cb7b5cc2b7b (patch) | |
tree | 2fa079de5ebdeb1bdb73af5361fee703a637d7e1 /src/com/android | |
parent | e8a80b5db3418ee9824e457420c3536f0eb71139 (diff) | |
download | packages_apps_Settings-ac57f3e1eb56998550534c1b32d99cb7b5cc2b7b.tar.gz packages_apps_Settings-ac57f3e1eb56998550534c1b32d99cb7b5cc2b7b.tar.bz2 packages_apps_Settings-ac57f3e1eb56998550534c1b32d99cb7b5cc2b7b.zip |
Add resources for light theme
Bug: 10407819
Change-Id: Ie232b2d48a8d67355d7c31a878ebaa79aae7c44d
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/UserDictionarySettings.java | 14 | ||||
-rw-r--r-- | src/com/android/settings/wifi/AccessPoint.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/wifi/WifiSettings.java | 33 | ||||
-rw-r--r-- | src/com/android/settings/wifi/p2p/WifiP2pPeer.java | 7 |
4 files changed, 33 insertions, 28 deletions
diff --git a/src/com/android/settings/UserDictionarySettings.java b/src/com/android/settings/UserDictionarySettings.java index 9f6df5072..da120048d 100644 --- a/src/com/android/settings/UserDictionarySettings.java +++ b/src/com/android/settings/UserDictionarySettings.java @@ -16,6 +16,9 @@ package com.android.settings; +import com.android.settings.inputmethod.UserDictionaryAddWordContents; +import com.android.settings.inputmethod.UserDictionarySettingsUtils; + import android.app.ListFragment; import android.content.ContentResolver; import android.content.Context; @@ -37,9 +40,6 @@ import android.widget.SectionIndexer; import android.widget.SimpleCursorAdapter; import android.widget.TextView; -import com.android.settings.inputmethod.UserDictionaryAddWordContents; -import com.android.settings.inputmethod.UserDictionarySettingsUtils; - import java.util.Locale; public class UserDictionarySettings extends ListFragment { @@ -165,7 +165,7 @@ public class UserDictionarySettings extends ListFragment { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { MenuItem actionItem = menu.add(0, OPTIONS_MENU_ADD, 0, R.string.user_dict_settings_add_menu_title) - .setIcon(R.drawable.ic_menu_add); + .setIcon(R.drawable.ic_menu_add_dark); actionItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); } @@ -236,8 +236,9 @@ public class UserDictionarySettings extends ListFragment { private AlphabetIndexer mIndexer; - private ViewBinder mViewBinder = new ViewBinder() { + private final ViewBinder mViewBinder = new ViewBinder() { + @Override public boolean setViewValue(View v, Cursor c, int columnIndex) { if (columnIndex == INDEX_SHORTCUT) { final String shortcut = c.getString(INDEX_SHORTCUT); @@ -268,14 +269,17 @@ public class UserDictionarySettings extends ListFragment { setViewBinder(mViewBinder); } + @Override public int getPositionForSection(int section) { return null == mIndexer ? 0 : mIndexer.getPositionForSection(section); } + @Override public int getSectionForPosition(int position) { return null == mIndexer ? 0 : mIndexer.getSectionForPosition(position); } + @Override public Object[] getSections() { return null == mIndexer ? null : mIndexer.getSections(); } diff --git a/src/com/android/settings/wifi/AccessPoint.java b/src/com/android/settings/wifi/AccessPoint.java index 20146eb27..c4d1f7c65 100644 --- a/src/com/android/settings/wifi/AccessPoint.java +++ b/src/com/android/settings/wifi/AccessPoint.java @@ -16,6 +16,8 @@ package com.android.settings.wifi; +import com.android.settings.R; + import android.content.Context; import android.net.NetworkInfo.DetailedState; import android.net.wifi.ScanResult; @@ -29,8 +31,6 @@ import android.util.Log; import android.view.View; import android.widget.ImageView; -import com.android.settings.R; - class AccessPoint extends Preference { static final String TAG = "Settings.AccessPoint"; @@ -211,7 +211,8 @@ class AccessPoint extends Preference { signal.setImageDrawable(null); } else { signal.setImageLevel(getLevel()); - signal.setImageResource(R.drawable.wifi_signal); + signal.setImageDrawable(getContext().getTheme().obtainStyledAttributes( + new int[] {R.attr.wifi_signal}).getDrawable(0)); signal.setImageState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE, true); } diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index 9fc101070..1caf58bcd 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -19,12 +19,9 @@ package com.android.settings.wifi; import static android.net.wifi.WifiConfiguration.INVALID_NETWORK_ID; import static android.os.UserManager.DISALLOW_CONFIG_WIFI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; +import com.android.settings.R; +import com.android.settings.RestrictedSettingsFragment; +import com.android.settings.wifi.p2p.WifiP2pSettings; import android.app.ActionBar; import android.app.Activity; @@ -37,6 +34,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.res.Resources; +import android.content.res.TypedArray; import android.location.LocationManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; @@ -76,9 +74,12 @@ import android.widget.Switch; import android.widget.TextView; import android.widget.Toast; -import com.android.settings.R; -import com.android.settings.RestrictedSettingsFragment; -import com.android.settings.wifi.p2p.WifiP2pSettings; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; /** * Two types of UI are provided here. @@ -134,7 +135,7 @@ public class WifiSettings extends RestrictedSettingsFragment private DetailedState mLastState; private WifiInfo mLastInfo; - private AtomicBoolean mConnected = new AtomicBoolean(false); + private final AtomicBoolean mConnected = new AtomicBoolean(false); private WifiDialog mDialog; @@ -447,10 +448,11 @@ public class WifiSettings extends RestrictedSettingsFragment if (isRestrictedAndNotPinProtected()) return; final boolean wifiIsEnabled = mWifiManager.isWifiEnabled(); + TypedArray ta = getActivity().getTheme().obtainStyledAttributes( + new int[] {R.attr.ic_menu_add, R.attr.ic_wps}); if (mSetupWizardMode) { - // FIXME: add setIcon() when graphics are available menu.add(Menu.NONE, MENU_ID_WPS_PBC, 0, R.string.wifi_menu_wps_pbc) - .setIcon(R.drawable.ic_wps) + .setIcon(ta.getDrawable(1)) .setEnabled(wifiIsEnabled) .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network) @@ -458,11 +460,11 @@ public class WifiSettings extends RestrictedSettingsFragment .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); } else { menu.add(Menu.NONE, MENU_ID_WPS_PBC, 0, R.string.wifi_menu_wps_pbc) - .setIcon(R.drawable.ic_wps) + .setIcon(ta.getDrawable(1)) .setEnabled(wifiIsEnabled) .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network) - .setIcon(R.drawable.ic_menu_add) + .setIcon(ta.getDrawable(0)) .setEnabled(wifiIsEnabled) .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.wifi_menu_scan) @@ -481,6 +483,7 @@ public class WifiSettings extends RestrictedSettingsFragment //.setIcon(android.R.drawable.ic_menu_manage) .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); } + ta.recycle(); super.onCreateOptionsMenu(menu, inflater); } @@ -808,7 +811,7 @@ public class WifiSettings extends RestrictedSettingsFragment /** A restricted multimap for use in constructAccessPoints */ private class Multimap<K,V> { - private HashMap<K,List<V>> store = new HashMap<K,List<V>>(); + private final HashMap<K,List<V>> store = new HashMap<K,List<V>>(); /** retrieve a non-null list of values with key K */ List<V> getAll(K key) { List<V> values = store.get(key); diff --git a/src/com/android/settings/wifi/p2p/WifiP2pPeer.java b/src/com/android/settings/wifi/p2p/WifiP2pPeer.java index 1eb810eb6..a364021dd 100644 --- a/src/com/android/settings/wifi/p2p/WifiP2pPeer.java +++ b/src/com/android/settings/wifi/p2p/WifiP2pPeer.java @@ -20,21 +20,18 @@ import com.android.settings.R; import android.content.Context; import android.net.wifi.WifiManager; -import android.net.wifi.p2p.WifiP2pManager; import android.net.wifi.p2p.WifiP2pDevice; import android.preference.Preference; import android.text.TextUtils; import android.view.View; import android.widget.ImageView; -import java.util.Comparator; - public class WifiP2pPeer extends Preference { private static final int[] STATE_SECURED = {R.attr.state_encrypted}; public WifiP2pDevice device; - private int mRssi; + private final int mRssi; private ImageView mSignal; private static final int SIGNAL_LEVELS = 4; @@ -57,7 +54,7 @@ public class WifiP2pPeer extends Preference { if (mRssi == Integer.MAX_VALUE) { mSignal.setImageDrawable(null); } else { - mSignal.setImageResource(R.drawable.wifi_signal); + mSignal.setImageResource(R.drawable.wifi_signal_dark); mSignal.setImageState(STATE_SECURED, true); } refresh(); |