Cherish: Fix edge lighting colorpicker showing wrong colorhex in summary

Signed-off-by: AnkitGourav <Ankitgourav035@gmail.com>
This commit is contained in:
AnkitGourav
2019-12-10 12:10:44 +05:30
committed by Hưng Phan
parent 772d5ec183
commit 93ddf87c1f

View File

@@ -37,17 +37,16 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
}
mEdgeLightColorPreference = (ColorPickerPreference) findPreference(PULSE_AMBIENT_LIGHT_COLOR);
mEdgeLightColorPreference.setOnPreferenceChangeListener(this);
int edgeLightColor = Settings.System.getInt(getContentResolver(),
Settings.System.PULSE_AMBIENT_LIGHT_COLOR, 0xFF3980FF);
mEdgeLightColorPreference.setNewPreviewColor(edgeLightColor);
mEdgeLightColorPreference.setAlphaSliderEnabled(false);
String edgeLightColorHex = String.format("#%08x", (0xFF3980FF & edgeLightColor));
if (edgeLightColorHex.equals("#ff3980ff")) {
mEdgeLightColorPreference.setSummary(R.string.default_string);
} else {
mEdgeLightColorPreference.setSummary(edgeLightColorHex);
}
mEdgeLightColorPreference.setOnPreferenceChangeListener(this);
mEdgeLightColorPreference.setNewPreviewColor(edgeLightColor);
}