Search in sources :

Example 1 with DarkUIPreferenceController

use of com.android.settings.display.DarkUIPreferenceController in project android_packages_apps_Settings by DirtyUnicorns.

the class DisplaySettings method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle, Fragment fragment) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new FontPickerPreferenceController(context, lifecycle, fragment));
    controllers.add(new AccentPickerPreferenceController(context, lifecycle, fragment));
    controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
    controllers.add(new AutoRotatePreferenceController(context, lifecycle));
    controllers.add(new CameraGesturePreferenceController(context));
    controllers.add(new DarkUIPreferenceController(context));
    controllers.add(new FontSizePreferenceController(context));
    controllers.add(new LiftToWakePreferenceController(context));
    controllers.add(new NightDisplayPreferenceController(context));
    controllers.add(new NightModePreferenceController(context));
    controllers.add(new ScreenSaverPreferenceController(context));
    controllers.add(new ScreenOffAnimationsPreferenceController(context));
    controllers.add(new AmbientDisplayPreferenceController(context, new AmbientDisplayConfiguration(context), KEY_AMBIENT_DISPLAY));
    controllers.add(new AmbientDisplayCustomPreferenceController(context));
    controllers.add(new TapToWakePreferenceController(context));
    controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
    controllers.add(new VrDisplayPreferenceController(context));
    controllers.add(new WallpaperPreferenceController(context));
    controllers.add(new ThemePreferenceController(context));
    controllers.add(new BrightnessLevelPreferenceController(context, lifecycle));
    controllers.add(new ColorModePreferenceController(context));
    return controllers;
}
Also used : ScreenSaverPreferenceController(com.android.settings.display.ScreenSaverPreferenceController) FontPickerPreferenceController(com.android.settings.display.FontPickerPreferenceController) AccentPickerPreferenceController(com.android.settings.display.AccentPickerPreferenceController) ArrayList(java.util.ArrayList) CameraGesturePreferenceController(com.android.settings.display.CameraGesturePreferenceController) AmbientDisplayConfiguration(com.android.internal.hardware.AmbientDisplayConfiguration) ScreenOffAnimationsPreferenceController(com.android.settings.display.ScreenOffAnimationsPreferenceController) DarkUIPreferenceController(com.android.settings.display.DarkUIPreferenceController) AmbientDisplayPreferenceController(com.android.settings.display.AmbientDisplayPreferenceController) LiftToWakePreferenceController(com.android.settings.display.LiftToWakePreferenceController) NightModePreferenceController(com.android.settings.display.NightModePreferenceController) WallpaperPreferenceController(com.android.settings.display.WallpaperPreferenceController) NightDisplayPreferenceController(com.android.settings.display.NightDisplayPreferenceController) AutoBrightnessPreferenceController(com.android.settings.display.AutoBrightnessPreferenceController) BrightnessLevelPreferenceController(com.android.settings.display.BrightnessLevelPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) VrDisplayPreferenceController(com.android.settings.display.VrDisplayPreferenceController) AmbientDisplayCustomPreferenceController(com.android.settings.display.AmbientDisplayCustomPreferenceController) TimeoutPreferenceController(com.android.settings.display.TimeoutPreferenceController) AutoRotatePreferenceController(com.android.settings.display.AutoRotatePreferenceController) ThemePreferenceController(com.android.settings.display.ThemePreferenceController) TapToWakePreferenceController(com.android.settings.display.TapToWakePreferenceController) ColorModePreferenceController(com.android.settings.display.ColorModePreferenceController) FontSizePreferenceController(com.android.settings.display.FontSizePreferenceController)

Example 2 with DarkUIPreferenceController

use of com.android.settings.display.DarkUIPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class AccessibilitySettings method initializeAllPreferences.

private void initializeAllPreferences() {
    for (int i = 0; i < CATEGORIES.length; i++) {
        PreferenceCategory prefCategory = (PreferenceCategory) findPreference(CATEGORIES[i]);
        mCategoryToPrefCategoryMap.put(CATEGORIES[i], prefCategory);
    }
    // Text contrast.
    mToggleHighTextContrastPreference = (SwitchPreference) findPreference(TOGGLE_HIGH_TEXT_CONTRAST_PREFERENCE);
    // Display inversion.
    mToggleInversionPreference = (SwitchPreference) findPreference(TOGGLE_INVERSION_PREFERENCE);
    mInversionPreferenceController = new ColorInversionPreferenceController(getContext(), TOGGLE_INVERSION_PREFERENCE);
    mInversionPreferenceController.displayPreference(getPreferenceScreen());
    // Power button ends calls.
    mTogglePowerButtonEndsCallPreference = (SwitchPreference) findPreference(TOGGLE_POWER_BUTTON_ENDS_CALL_PREFERENCE);
    if (!KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_POWER) || !Utils.isVoiceCapable(getActivity())) {
        mCategoryToPrefCategoryMap.get(CATEGORY_INTERACTION_CONTROL).removePreference(mTogglePowerButtonEndsCallPreference);
    }
    // Lock screen rotation.
    mToggleLockScreenRotationPreference = (SwitchPreference) findPreference(TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE);
    if (!RotationPolicy.isRotationSupported(getActivity())) {
        mCategoryToPrefCategoryMap.get(CATEGORY_INTERACTION_CONTROL).removePreference(mToggleLockScreenRotationPreference);
    }
    // Large pointer icon.
    mToggleLargePointerIconPreference = (SwitchPreference) findPreference(TOGGLE_LARGE_POINTER_ICON);
    mToggleDisableAnimationsPreference = (SwitchPreference) findPreference(TOGGLE_DISABLE_ANIMATIONS);
    // Master Mono
    mToggleMasterMonoPreference = (SwitchPreference) findPreference(TOGGLE_MASTER_MONO);
    // Long press timeout.
    mSelectLongPressTimeoutPreference = (ListPreference) findPreference(SELECT_LONG_PRESS_TIMEOUT_PREFERENCE);
    mSelectLongPressTimeoutPreference.setOnPreferenceChangeListener(this);
    if (mLongPressTimeoutValueToTitleMap.size() == 0) {
        String[] timeoutValues = getResources().getStringArray(R.array.long_press_timeout_selector_values);
        mLongPressTimeoutDefault = Integer.parseInt(timeoutValues[0]);
        String[] timeoutTitles = getResources().getStringArray(R.array.long_press_timeout_selector_titles);
        final int timeoutValueCount = timeoutValues.length;
        for (int i = 0; i < timeoutValueCount; i++) {
            mLongPressTimeoutValueToTitleMap.put(timeoutValues[i], timeoutTitles[i]);
        }
    }
    // Hearing Aid.
    mHearingAidPreference = findPreference(HEARING_AID_PREFERENCE);
    mHearingAidPreferenceController.displayPreference(getPreferenceScreen());
    // RTT Setting
    mRTTPreference = findPreference(RTT_SETTINGS_SCREEN);
    mRTTSettingPreferenceController.displayPreference(getPreferenceScreen());
    // Captioning.
    mCaptioningPreferenceScreen = findPreference(CAPTIONING_PREFERENCE_SCREEN);
    // Live caption
    mLiveCaptionPreference = findPreference(LIVE_CAPTION_PREFERENCE_KEY);
    mLiveCaptionPreferenceController.displayPreference(getPreferenceScreen());
    // Display magnification.
    mDisplayMagnificationPreferenceScreen = findPreference(DISPLAY_MAGNIFICATION_PREFERENCE_SCREEN);
    configureMagnificationPreferenceIfNeeded(mDisplayMagnificationPreferenceScreen);
    // Font size.
    mFontSizePreferenceScreen = findPreference(FONT_SIZE_PREFERENCE_SCREEN);
    // Autoclick after pointer stops.
    mAutoclickPreferenceScreen = findPreference(AUTOCLICK_PREFERENCE_SCREEN);
    // Display color adjustments.
    mDisplayDaltonizerPreferenceScreen = findPreference(DISPLAY_DALTONIZER_PREFERENCE_SCREEN);
    // Accessibility shortcut.
    mAccessibilityShortcutPreferenceScreen = findPreference(ACCESSIBILITY_SHORTCUT_PREFERENCE);
    // Vibrations.
    mVibrationPreferenceScreen = findPreference(VIBRATION_PREFERENCE_SCREEN);
    // Dark Mode.
    mDarkUIModePreference = findPreference(DARK_UI_MODE_PREFERENCE);
    mDarkUIPreferenceController = new DarkUIPreferenceController(getContext(), DARK_UI_MODE_PREFERENCE);
    mDarkUIPreferenceController.setParentFragment(this);
    mDarkUIPreferenceController.displayPreference(getPreferenceScreen());
}
Also used : DarkUIPreferenceController(com.android.settings.display.DarkUIPreferenceController) PreferenceCategory(androidx.preference.PreferenceCategory)

Aggregations

DarkUIPreferenceController (com.android.settings.display.DarkUIPreferenceController)2 PreferenceCategory (androidx.preference.PreferenceCategory)1 AmbientDisplayConfiguration (com.android.internal.hardware.AmbientDisplayConfiguration)1 AccentPickerPreferenceController (com.android.settings.display.AccentPickerPreferenceController)1 AmbientDisplayCustomPreferenceController (com.android.settings.display.AmbientDisplayCustomPreferenceController)1 AmbientDisplayPreferenceController (com.android.settings.display.AmbientDisplayPreferenceController)1 AutoBrightnessPreferenceController (com.android.settings.display.AutoBrightnessPreferenceController)1 AutoRotatePreferenceController (com.android.settings.display.AutoRotatePreferenceController)1 BrightnessLevelPreferenceController (com.android.settings.display.BrightnessLevelPreferenceController)1 CameraGesturePreferenceController (com.android.settings.display.CameraGesturePreferenceController)1 ColorModePreferenceController (com.android.settings.display.ColorModePreferenceController)1 FontPickerPreferenceController (com.android.settings.display.FontPickerPreferenceController)1 FontSizePreferenceController (com.android.settings.display.FontSizePreferenceController)1 LiftToWakePreferenceController (com.android.settings.display.LiftToWakePreferenceController)1 NightDisplayPreferenceController (com.android.settings.display.NightDisplayPreferenceController)1 NightModePreferenceController (com.android.settings.display.NightModePreferenceController)1 ScreenOffAnimationsPreferenceController (com.android.settings.display.ScreenOffAnimationsPreferenceController)1 ScreenSaverPreferenceController (com.android.settings.display.ScreenSaverPreferenceController)1 TapToWakePreferenceController (com.android.settings.display.TapToWakePreferenceController)1 ThemePreferenceController (com.android.settings.display.ThemePreferenceController)1