diff options
author | jrizzoli <joey@cyanogenmoditalia.it> | 2015-11-16 22:15:32 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-11-22 06:20:22 -0800 |
commit | b55f89de1e0c8a8631551c02efcc091d0ee07b5d (patch) | |
tree | 94d95d5eaf52805019dbdd704e704c04ef75ab85 /src/com | |
parent | bd3fe676619443b9060ffaa85abfe8e632e4340c (diff) | |
download | packages_apps_Settings-b55f89de1e0c8a8631551c02efcc091d0ee07b5d.zip packages_apps_Settings-b55f89de1e0c8a8631551c02efcc091d0ee07b5d.tar.gz packages_apps_Settings-b55f89de1e0c8a8631551c02efcc091d0ee07b5d.tar.bz2 |
Settings: update layouts
Settings: update layouts
- User materialish oval shapes instead of rectangles
- Rearrange notifications, wireless, display and sound entries
- Update some strings
Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
Settings: update control ring stream string
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
WirelessSettings: Remove NFC category if there's no NFC adapter
+ Settings: add mobile network entry to dashboard
Change-Id: I3fcd758f77a217e5c37a22f4d797398a7613b5a2
Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/WirelessSettings.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/notificationlight/ApplicationLightPreference.java | 15 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java index 38a5da4..df430ef 100644 --- a/src/com/android/settings/WirelessSettings.java +++ b/src/com/android/settings/WirelessSettings.java @@ -37,6 +37,7 @@ import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.preference.Preference; +import android.preference.PreferenceCategory; import android.preference.PreferenceScreen; import android.preference.SwitchPreference; import android.provider.SearchIndexableResource; @@ -61,6 +62,7 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde private static final String TAG = "WirelessSettings"; private static final String KEY_TOGGLE_AIRPLANE = "toggle_airplane"; + private static final String KEY_NFC_CATEGORY_SETTINGS = "nfc_category_settings"; private static final String KEY_TOGGLE_NFC = "toggle_nfc"; private static final String KEY_WIMAX_SETTINGS = "wimax_settings"; private static final String KEY_ANDROID_BEAM_SETTINGS = "android_beam_settings"; @@ -233,6 +235,8 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde SwitchPreference nfc = (SwitchPreference) findPreference(KEY_TOGGLE_NFC); PreferenceScreen androidBeam = (PreferenceScreen) findPreference(KEY_ANDROID_BEAM_SETTINGS); SwitchPreference nsd = (SwitchPreference) findPreference(KEY_TOGGLE_NSD); + PreferenceCategory nfcCategory = (PreferenceCategory) + findPreference(KEY_NFC_CATEGORY_SETTINGS); mAirplaneModeEnabler = new AirplaneModeEnabler(activity, mAirplaneModePreference); mNfcEnabler = new NfcEnabler(activity, nfc, androidBeam); @@ -285,8 +289,7 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde // Remove NFC if not available mNfcAdapter = NfcAdapter.getDefaultAdapter(activity); if (mNfcAdapter == null) { - getPreferenceScreen().removePreference(nfc); - getPreferenceScreen().removePreference(androidBeam); + getPreferenceScreen().removePreference(nfcCategory); mNfcEnabler = null; } diff --git a/src/com/android/settings/notificationlight/ApplicationLightPreference.java b/src/com/android/settings/notificationlight/ApplicationLightPreference.java index 8ae4a4a..6bcde9c 100644 --- a/src/com/android/settings/notificationlight/ApplicationLightPreference.java +++ b/src/com/android/settings/notificationlight/ApplicationLightPreference.java @@ -22,7 +22,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.res.Resources; import android.graphics.drawable.ShapeDrawable; -import android.graphics.drawable.shapes.RectShape; +import android.graphics.drawable.shapes.OvalShape; import android.os.Bundle; import android.preference.DialogPreference; import android.util.AttributeSet; @@ -132,12 +132,11 @@ public class ApplicationLightPreference extends DialogPreference { } private void updatePreferenceViews() { - final int width = (int) mResources.getDimension(R.dimen.device_memory_usage_button_width); - final int height = (int) mResources.getDimension(R.dimen.device_memory_usage_button_height); + final int size = (int) mResources.getDimension(R.dimen.oval_notification_size); if (mLightColorView != null) { mLightColorView.setEnabled(true); - mLightColorView.setImageDrawable(createRectShape(width, height, 0xFF000000 + mColorValue)); + mLightColorView.setImageDrawable(createOvalShape(size, 0xFF000000 + mColorValue)); } if (mOnValueView != null) { mOnValueView.setText(mapLengthValue(mOnValue)); @@ -246,10 +245,10 @@ public class ApplicationLightPreference extends DialogPreference { /** * Utility methods */ - private static ShapeDrawable createRectShape(int width, int height, int color) { - ShapeDrawable shape = new ShapeDrawable(new RectShape()); - shape.setIntrinsicHeight(height); - shape.setIntrinsicWidth(width); + private static ShapeDrawable createOvalShape(int size, int color) { + ShapeDrawable shape = new ShapeDrawable(new OvalShape()); + shape.setIntrinsicHeight(size); + shape.setIntrinsicWidth(size); shape.getPaint().setColor(color); return shape; } |