Search in sources :

Example 1 with ThemePreferenceController

use of com.android.settings.display.ThemePreferenceController in project android_packages_apps_Settings by LineageOS.

the class ThemePreferenceControllerTest method setup.

@Before
public void setup() {
    mMockOverlayManager = mock(OverlayManager.class);
    mMockPackageManager = mock(PackageManager.class);
    mContext = new ContextWrapper(InstrumentationRegistry.getTargetContext()) {

        @Override
        public PackageManager getPackageManager() {
            return mMockPackageManager;
        }
    };
    mPreferenceController = new ThemePreferenceController(mContext, mMockOverlayManager);
}
Also used : OverlayManager(com.android.settings.display.ThemePreferenceController.OverlayManager) ThemePreferenceController(com.android.settings.display.ThemePreferenceController) PackageManager(android.content.pm.PackageManager) ContextWrapper(android.content.ContextWrapper) Before(org.junit.Before)

Example 2 with ThemePreferenceController

use of com.android.settings.display.ThemePreferenceController in project android_packages_apps_Settings by omnirom.

the class DisplaySettings method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
    controllers.add(new AutoRotatePreferenceController(context, lifecycle));
    controllers.add(new CameraGesturePreferenceController(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 AmbientDisplayPreferenceController(context, new AmbientDisplayConfiguration(context), KEY_AMBIENT_DISPLAY));
    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) AutoBrightnessPreferenceController(com.android.settings.display.AutoBrightnessPreferenceController) BrightnessLevelPreferenceController(com.android.settings.display.BrightnessLevelPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) VrDisplayPreferenceController(com.android.settings.display.VrDisplayPreferenceController) ArrayList(java.util.ArrayList) CameraGesturePreferenceController(com.android.settings.display.CameraGesturePreferenceController) TimeoutPreferenceController(com.android.settings.display.TimeoutPreferenceController) AmbientDisplayConfiguration(com.android.internal.hardware.AmbientDisplayConfiguration) AutoRotatePreferenceController(com.android.settings.display.AutoRotatePreferenceController) ThemePreferenceController(com.android.settings.display.ThemePreferenceController) TapToWakePreferenceController(com.android.settings.display.TapToWakePreferenceController) AmbientDisplayPreferenceController(com.android.settings.display.AmbientDisplayPreferenceController) LiftToWakePreferenceController(com.android.settings.display.LiftToWakePreferenceController) NightModePreferenceController(com.android.settings.display.NightModePreferenceController) ColorModePreferenceController(com.android.settings.display.ColorModePreferenceController) FontSizePreferenceController(com.android.settings.display.FontSizePreferenceController) WallpaperPreferenceController(com.android.settings.display.WallpaperPreferenceController) NightDisplayPreferenceController(com.android.settings.display.NightDisplayPreferenceController)

Example 3 with ThemePreferenceController

use of com.android.settings.display.ThemePreferenceController in project android_packages_apps_Settings by crdroidandroid.

the class ThemePreferenceControllerTest method setup.

@Before
public void setup() {
    mMockOverlayManager = mock(OverlayManager.class);
    mMockPackageManager = mock(PackageManager.class);
    mContext = new ContextWrapper(InstrumentationRegistry.getTargetContext()) {

        @Override
        public PackageManager getPackageManager() {
            return mMockPackageManager;
        }
    };
    mPreferenceController = new ThemePreferenceController(mContext, mMockOverlayManager);
}
Also used : OverlayManager(com.android.settings.display.ThemePreferenceController.OverlayManager) ThemePreferenceController(com.android.settings.display.ThemePreferenceController) PackageManager(android.content.pm.PackageManager) ContextWrapper(android.content.ContextWrapper) Before(org.junit.Before)

Example 4 with ThemePreferenceController

use of com.android.settings.display.ThemePreferenceController in project platform_packages_apps_Settings by BlissRoms.

the class DisplaySettings method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
    controllers.add(new AutoRotatePreferenceController(context, lifecycle));
    controllers.add(new CameraGesturePreferenceController(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 AmbientDisplayPreferenceController(context, new AmbientDisplayConfiguration(context), KEY_AMBIENT_DISPLAY));
    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) AutoBrightnessPreferenceController(com.android.settings.display.AutoBrightnessPreferenceController) BrightnessLevelPreferenceController(com.android.settings.display.BrightnessLevelPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) VrDisplayPreferenceController(com.android.settings.display.VrDisplayPreferenceController) ArrayList(java.util.ArrayList) CameraGesturePreferenceController(com.android.settings.display.CameraGesturePreferenceController) TimeoutPreferenceController(com.android.settings.display.TimeoutPreferenceController) AmbientDisplayConfiguration(com.android.internal.hardware.AmbientDisplayConfiguration) AutoRotatePreferenceController(com.android.settings.display.AutoRotatePreferenceController) ThemePreferenceController(com.android.settings.display.ThemePreferenceController) TapToWakePreferenceController(com.android.settings.display.TapToWakePreferenceController) AmbientDisplayPreferenceController(com.android.settings.display.AmbientDisplayPreferenceController) LiftToWakePreferenceController(com.android.settings.display.LiftToWakePreferenceController) NightModePreferenceController(com.android.settings.display.NightModePreferenceController) ColorModePreferenceController(com.android.settings.display.ColorModePreferenceController) FontSizePreferenceController(com.android.settings.display.FontSizePreferenceController) WallpaperPreferenceController(com.android.settings.display.WallpaperPreferenceController) NightDisplayPreferenceController(com.android.settings.display.NightDisplayPreferenceController)

Example 5 with ThemePreferenceController

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

the class DisplaySettings method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new CameraGesturePreferenceController(context));
    controllers.add(new LiftToWakePreferenceController(context));
    controllers.add(new PocketJudgePreferenceController(context));
    controllers.add(new NightDisplayPreferenceController(context));
    controllers.add(new NightModePreferenceController(context));
    controllers.add(new ScreenSaverPreferenceController(context));
    controllers.add(new TapToWakePreferenceController(context));
    controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
    controllers.add(new VrDisplayPreferenceController(context));
    controllers.add(new ShowOperatorNamePreferenceController(context));
    controllers.add(new ThemePreferenceController(context));
    controllers.add(new BrightnessLevelPreferenceController(context, lifecycle));
    controllers.add(new RefreshRatePreferenceController(context));
    return controllers;
}
Also used : ScreenSaverPreferenceController(com.android.settings.display.ScreenSaverPreferenceController) ShowOperatorNamePreferenceController(com.android.settings.display.ShowOperatorNamePreferenceController) BrightnessLevelPreferenceController(com.android.settings.display.BrightnessLevelPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) VrDisplayPreferenceController(com.android.settings.display.VrDisplayPreferenceController) ArrayList(java.util.ArrayList) CameraGesturePreferenceController(com.android.settings.display.CameraGesturePreferenceController) TimeoutPreferenceController(com.android.settings.display.TimeoutPreferenceController) ThemePreferenceController(com.android.settings.display.ThemePreferenceController) TapToWakePreferenceController(com.android.settings.display.TapToWakePreferenceController) LiftToWakePreferenceController(com.android.settings.display.LiftToWakePreferenceController) NightModePreferenceController(com.android.settings.display.NightModePreferenceController) PocketJudgePreferenceController(com.android.settings.display.PocketJudgePreferenceController) NightDisplayPreferenceController(com.android.settings.display.NightDisplayPreferenceController) RefreshRatePreferenceController(com.android.settings.display.RefreshRatePreferenceController)

Aggregations

ThemePreferenceController (com.android.settings.display.ThemePreferenceController)10 ContextWrapper (android.content.ContextWrapper)6 PackageManager (android.content.pm.PackageManager)6 OverlayManager (com.android.settings.display.ThemePreferenceController.OverlayManager)6 Before (org.junit.Before)6 BrightnessLevelPreferenceController (com.android.settings.display.BrightnessLevelPreferenceController)4 CameraGesturePreferenceController (com.android.settings.display.CameraGesturePreferenceController)4 LiftToWakePreferenceController (com.android.settings.display.LiftToWakePreferenceController)4 NightDisplayPreferenceController (com.android.settings.display.NightDisplayPreferenceController)4 NightModePreferenceController (com.android.settings.display.NightModePreferenceController)4 ScreenSaverPreferenceController (com.android.settings.display.ScreenSaverPreferenceController)4 TapToWakePreferenceController (com.android.settings.display.TapToWakePreferenceController)4 TimeoutPreferenceController (com.android.settings.display.TimeoutPreferenceController)4 VrDisplayPreferenceController (com.android.settings.display.VrDisplayPreferenceController)4 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)4 ArrayList (java.util.ArrayList)4 AmbientDisplayConfiguration (com.android.internal.hardware.AmbientDisplayConfiguration)3 AmbientDisplayPreferenceController (com.android.settings.display.AmbientDisplayPreferenceController)3 AutoBrightnessPreferenceController (com.android.settings.display.AutoBrightnessPreferenceController)3 AutoRotatePreferenceController (com.android.settings.display.AutoRotatePreferenceController)3