OSDN Git Service

Settings: Always set text value in color temperature
authorKeith Mok <kmok@cyngn.com>
Fri, 15 Jul 2016 16:30:39 +0000 (09:30 -0700)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Tue, 26 Jul 2016 05:10:21 +0000 (22:10 -0700)
onProgressChange is not always called if we set the
color temperature to minimum, since it is the default
value (no change).
Causing the text showing the color temperature is empty.

Call onProgressChange explicitly during init.

FEIJ-1581

Change-Id: I7e0f8995cfc62a53770e787dc649109b9c3bf189

src/com/android/settings/livedisplay/DisplayTemperature.java

index 920d197..350ef62 100644 (file)
@@ -244,6 +244,10 @@ public class DisplayTemperature extends DialogPreference {
             }
             mSeekBar.setMax(mBarMax);
             mSeekBar.setOnSeekBarChangeListener(this);
+
+            // init text value
+            int p = mSeekBar.getProgress();
+            onProgressChanged(mSeekBar, p, false);
         }
 
         @Override