Merge "Enforce min value on panel slices slider" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-16 21:18:05 +00:00
committed by Android (Google) Code Review
14 changed files with 108 additions and 30 deletions

View File

@@ -55,7 +55,8 @@ public class NightDisplayIntensityPreferenceController extends SliderPreferenceC
super.displayPreference(screen);
final SeekBarPreference preference = screen.findPreference(getPreferenceKey());
preference.setContinuousUpdates(true);
preference.setMax(getMaxSteps());
preference.setMax(getMax());
preference.setMin(getMin());
}
@Override
@@ -75,10 +76,15 @@ public class NightDisplayIntensityPreferenceController extends SliderPreferenceC
}
@Override
public int getMaxSteps() {
public int getMax() {
return convertTemperature(ColorDisplayManager.getMinimumColorTemperature(mContext));
}
@Override
public int getMin() {
return ColorDisplayManager.getMinimumColorTemperature(mContext);
}
/**
* Inverts and range-adjusts a raw value from the SeekBar (i.e. [0, maxTemp-minTemp]), or
* converts an inverted and range-adjusted value to the raw SeekBar value, depending on the