use of android.app.UiModeManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NightModePreferenceController method onPreferenceChange.
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
try {
final int value = Integer.parseInt((String) newValue);
final UiModeManager uiManager = (UiModeManager) mContext.getSystemService(UI_MODE_SERVICE);
uiManager.setNightMode(value);
} catch (NumberFormatException e) {
Log.e(TAG, "could not persist night mode setting", e);
return false;
}
return true;
}
use of android.app.UiModeManager in project android_packages_apps_Settings by omnirom.
the class NightModePreferenceController method onPreferenceChange.
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
try {
final int value = Integer.parseInt((String) newValue);
final UiModeManager uiManager = (UiModeManager) mContext.getSystemService(UI_MODE_SERVICE);
uiManager.setNightMode(value);
} catch (NumberFormatException e) {
Log.e(TAG, "could not persist night mode setting", e);
return false;
}
return true;
}
Aggregations