summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/notificationlight
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-07-30 15:20:52 -0700
committerRicardo Cerqueira <ricardo@cyngn.com>2016-01-28 14:30:48 +0000
commit2d5803e75affe08246bbab95f97b4f2b52ed3765 (patch)
tree8af242a399d999accd0feb45827b346602571e32 /src/com/android/settings/notificationlight
parentdb442846cc795511d148febe1435233f1793e9e9 (diff)
downloadpackages_apps_Settings-2d5803e75affe08246bbab95f97b4f2b52ed3765.tar.gz
packages_apps_Settings-2d5803e75affe08246bbab95f97b4f2b52ed3765.tar.bz2
packages_apps_Settings-2d5803e75affe08246bbab95f97b4f2b52ed3765.zip
Settings: fix a few color picker inconsistentcies
Don't assume we can pulse when calling setAllValues(). Don't display both on/off pulse values when it cannot pulse. Default to Always on when we can't pulse. Ref: CYNGNOS-403 Change-Id: Ie356cdc35cb545dd51896697f89ef265ada1147f Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'src/com/android/settings/notificationlight')
-rw-r--r--src/com/android/settings/notificationlight/ApplicationLightPreference.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/settings/notificationlight/ApplicationLightPreference.java b/src/com/android/settings/notificationlight/ApplicationLightPreference.java
index 9feb05052..a12f45bf5 100644
--- a/src/com/android/settings/notificationlight/ApplicationLightPreference.java
+++ b/src/com/android/settings/notificationlight/ApplicationLightPreference.java
@@ -148,7 +148,7 @@ public class ApplicationLightPreference extends DialogPreference {
mOnValueView.setText(mapLengthValue(mOnValue));
}
if (mOffValueView != null) {
- if (mOnValue == 1) {
+ if (mOnValue == 1 || !mOnOffChangeable) {
mOffValueView.setVisibility(View.GONE);
} else {
mOffValueView.setVisibility(View.VISIBLE);
@@ -226,7 +226,6 @@ public class ApplicationLightPreference extends DialogPreference {
mColorValue = color;
mOnValue = onValue;
mOffValue = offValue;
- mOnOffChangeable = true;
updatePreferenceViews();
}
@@ -260,6 +259,9 @@ public class ApplicationLightPreference extends DialogPreference {
}
private String mapLengthValue(Integer time) {
+ if (!mOnOffChangeable) {
+ return getContext().getString(R.string.pulse_length_always_on);
+ }
if (time == DEFAULT_TIME) {
return getContext().getString(R.string.default_time);
}