Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c2c01b5 authored by Roman Birg's avatar Roman Birg
Browse files

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: default avatarRoman Birg <roman@cyngn.com>
parent bee2fddc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -149,7 +149,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);
@@ -227,7 +227,6 @@ public class ApplicationLightPreference extends DialogPreference {
        mColorValue = color;
        mOnValue = onValue;
        mOffValue = offValue;
        mOnOffChangeable = true;
        updatePreferenceViews();
    }

@@ -261,6 +260,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);
        }