Search in sources :

Example 1 with ColorSelectPreference

use of org.omnirom.omnigears.preference.ColorSelectPreference in project android_packages_apps_OmniGears by omnirom.

the class BatteryLightSettings method onPreferenceChange.

@Override
public boolean onPreferenceChange(Preference preference, Object objValue) {
    if (preference == mEnabledPref) {
        boolean value = (Boolean) objValue;
        Settings.System.putInt(getActivity().getContentResolver(), Settings.System.BATTERY_LIGHT_ENABLED, value ? 1 : 0);
    } else if (preference == mPulsePref) {
        boolean value = (Boolean) objValue;
        Settings.System.putInt(getActivity().getContentResolver(), Settings.System.BATTERY_LIGHT_PULSE, value ? 1 : 0);
    } else if (preference == mOnlyFullPref) {
        boolean value = (Boolean) objValue;
        // If enabled, disable all but really full color preference.
        updateEnablement(value);
    } else {
        ColorSelectPreference lightPref = (ColorSelectPreference) preference;
        updateValues(lightPref.getKey(), lightPref.getColor());
    }
    return true;
}
Also used : ColorSelectPreference(org.omnirom.omnigears.preference.ColorSelectPreference)

Aggregations

ColorSelectPreference (org.omnirom.omnigears.preference.ColorSelectPreference)1