Cherish: Ambient Edge Pulse layout [2/2]

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
AnkitGourav
2021-03-21 21:50:32 -04:00
committed by Hưng Phan
parent c746eec262
commit b47fa93b0e
4 changed files with 26 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ import com.cherish.settings.preferences.SystemSettingMasterSwitchPreference;
import com.cherish.settings.preferences.SystemSettingSeekBarPreference;
import com.cherish.settings.preferences.CustomSeekBarPreference;
import com.cherish.settings.preferences.SystemSettingListPreference;
import com.cherish.settings.preferences.SystemSettingListPreference;
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
import net.margaritov.preference.colorpicker.ColorPickerPreference;
import com.android.internal.util.cherish.CherishUtils;
@@ -35,6 +36,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
private SystemSettingSeekBarPreference mEdgeLightDurationPreference;
private SystemSettingSeekBarPreference mEdgeLightRepeatCountPreference;
private ListPreference mColorMode;
private SystemSettingListPreference mAmbientLightLayout;
@Override
public void onCreate(Bundle icicle) {
@@ -69,6 +71,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
mEdgeLightDurationPreference.setValue(duration);
mColorMode = (ListPreference) findPreference(PULSE_COLOR_MODE_PREF);
mAmbientLightLayout = (SystemSettingListPreference) findPreference("pulse_ambient_light_layout");
int value;
boolean colorModeAutomatic = Settings.System.getInt(getContentResolver(),
Settings.System.NOTIFICATION_PULSE_COLOR_AUTOMATIC, 0) != 0;
@@ -91,6 +94,7 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
Settings.System.NOTIFICATION_PULSE_COLOR, 0xFF3980FF);
mEdgeLightColorPreference.setNewPreviewColor(edgeLightColor);
mEdgeLightColorPreference.setAlphaSliderEnabled(false);
mAmbientLightLayout.setEnabled(true);
String edgeLightColorHex = String.format("#%08x", (0xFF3980FF & edgeLightColor));
if (edgeLightColorHex.equals("#ff3980ff")) {
mEdgeLightColorPreference.setSummary(R.string.color_default);