Add night display pref controllers and change UX
- Convert NightDisplaySettings to a DashboardFragment - Add preference controllers for all Night Display settings - Change UX for activation from a toggle to a button Bug: 73739388 Bug: 69912911 Test: make -j100 and make RunSettingsRoboTests -j100 Change-Id: Ia173f16207ba59bf57eb7546cbb1e2dbca67b063 Merged-In: Ia173f16207ba59bf57eb7546cbb1e2dbca67b063
This commit is contained in:
@@ -16,7 +16,6 @@ package com.android.settings.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.SeekBarPreference;
|
||||
|
||||
import com.android.settings.slices.SliceData;
|
||||
|
||||
@@ -34,7 +33,13 @@ public abstract class SliderPreferenceController extends BasePreferenceControlle
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
((SeekBarPreference) preference).setValue(getSliderPosition());
|
||||
if (preference instanceof com.android.settings.widget.SeekBarPreference) {
|
||||
((com.android.settings.widget.SeekBarPreference) preference)
|
||||
.setProgress(getSliderPosition());
|
||||
} else if (preference instanceof android.support.v7.preference.SeekBarPreference) {
|
||||
((android.support.v7.preference.SeekBarPreference) preference)
|
||||
.setValue(getSliderPosition());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -42,8 +42,8 @@ public abstract class TogglePreferenceController extends BasePreferenceControlle
|
||||
/**
|
||||
* Set the Setting to {@param isChecked}
|
||||
*
|
||||
* @param isChecked Is {@true} when the setting should be enabled.
|
||||
* @return {@true} if the underlying setting is updated.
|
||||
* @param isChecked Is {@code true} when the setting should be enabled.
|
||||
* @return {@code true} if the underlying setting is updated.
|
||||
*/
|
||||
public abstract boolean setChecked(boolean isChecked);
|
||||
|
||||
|
Reference in New Issue
Block a user