Search in sources :

Example 6 with WallpaperColorInfo

use of com.android.launcher3.uioverrides.WallpaperColorInfo in project Neo-Launcher by NeoApplications.

the class ColorScrim method createExtractedColorScrim.

public static ColorScrim createExtractedColorScrim(View view) {
    WallpaperColorInfo colors = WallpaperColorInfo.getInstance(view.getContext());
    int alpha = view.getResources().getInteger(R.integer.extracted_color_gradient_alpha);
    ColorScrim scrim = new ColorScrim(view, ColorUtils.setAlphaComponent(colors.getSecondaryColor(), alpha), Interpolators.LINEAR);
    scrim.attach();
    return scrim;
}
Also used : WallpaperColorInfo(com.android.launcher3.uioverrides.WallpaperColorInfo)

Example 7 with WallpaperColorInfo

use of com.android.launcher3.uioverrides.WallpaperColorInfo in project android_packages_apps_Trebuchet by LineageOS.

the class BaseWidgetSheet method getScrimColor.

protected int getScrimColor(Context context) {
    WallpaperColorInfo colors = WallpaperColorInfo.INSTANCE.get(context);
    int alpha = context.getResources().getInteger(R.integer.extracted_color_gradient_alpha);
    return setColorAlphaBound(colors.getSecondaryColor(), alpha);
}
Also used : Point(android.graphics.Point) WallpaperColorInfo(com.android.launcher3.uioverrides.WallpaperColorInfo)

Example 8 with WallpaperColorInfo

use of com.android.launcher3.uioverrides.WallpaperColorInfo in project android_packages_apps_Trebuchet by LineageOS.

the class Themes method getActivityThemeRes.

public static int getActivityThemeRes(Context context) {
    WallpaperColorInfo wallpaperColorInfo = WallpaperColorInfo.INSTANCE.get(context);
    boolean darkTheme;
    if (Utilities.ATLEAST_Q) {
        Configuration configuration = context.getResources().getConfiguration();
        int nightMode = configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK;
        darkTheme = nightMode == Configuration.UI_MODE_NIGHT_YES;
    } else {
        darkTheme = wallpaperColorInfo.isDark();
    }
    if (darkTheme) {
        return wallpaperColorInfo.supportsDarkText() ? R.style.AppTheme_Dark_DarkText : wallpaperColorInfo.isMainColorDark() ? R.style.AppTheme_Dark_DarkMainColor : R.style.AppTheme_Dark;
    } else {
        return wallpaperColorInfo.supportsDarkText() ? R.style.AppTheme_DarkText : wallpaperColorInfo.isMainColorDark() ? R.style.AppTheme_DarkMainColor : R.style.AppTheme;
    }
}
Also used : Configuration(android.content.res.Configuration) WallpaperColorInfo(com.android.launcher3.uioverrides.WallpaperColorInfo)

Aggregations

WallpaperColorInfo (com.android.launcher3.uioverrides.WallpaperColorInfo)8 Configuration (android.content.res.Configuration)2 Point (android.graphics.Point)2 View (android.view.View)1 AbstractSlideInView (com.android.launcher3.views.AbstractSlideInView)1 BaseDragLayer (com.android.launcher3.views.BaseDragLayer)1 QsbAnimationController (com.saggitt.omega.qsb.QsbAnimationController)1 CustomLauncherClient (com.saggitt.omega.util.CustomLauncherClient)1