Search in sources :

Example 1 with WallpaperColorInfo

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

the class BaseWidgetSheet method createColorScrim.

private static View createColorScrim(Context context) {
    View view = new View(context);
    view.forceHasOverlappingRendering(false);
    WallpaperColorInfo colors = WallpaperColorInfo.getInstance(context);
    int alpha = context.getResources().getInteger(R.integer.extracted_color_gradient_alpha);
    view.setBackgroundColor(setColorAlphaBound(colors.getSecondaryColor(), alpha));
    BaseDragLayer.LayoutParams lp = new BaseDragLayer.LayoutParams(MATCH_PARENT, MATCH_PARENT);
    lp.ignoreInsets = true;
    view.setLayoutParams(lp);
    return view;
}
Also used : BaseDragLayer(com.android.launcher3.views.BaseDragLayer) View(android.view.View) AbstractSlideInView(com.android.launcher3.views.AbstractSlideInView) Point(android.graphics.Point) WallpaperColorInfo(com.android.launcher3.uioverrides.WallpaperColorInfo)

Example 2 with WallpaperColorInfo

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

the class OmegaLauncherCallbacks method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    mPrefs = Utilities.getPrefs(mLauncher);
    mOverlayCallbacks = new OverlayCallbackImpl(mLauncher);
    mLauncherClient = new CustomLauncherClient(mLauncher, mOverlayCallbacks, getClientOptions(mPrefs));
    mQsbController = new QsbAnimationController(mLauncher);
    mOverlayCallbacks.setClient(mLauncherClient);
    mUiInformation.putInt("system_ui_visibility", mLauncher.getWindow().getDecorView().getSystemUiVisibility());
    applyFeedTheme(false);
    WallpaperColorInfo instance = WallpaperColorInfo.getInstance(mLauncher);
    instance.addOnChangeListener(this);
    onExtractedColorsChanged(instance);
    mPrefs.registerOnSharedPreferenceChangeListener(this);
    predictionUiStateManager = PredictionUiStateManager.INSTANCE.get(mLauncher);
    predictionUiStateManager.setTargetAppsView(mLauncher.getAppsView());
    if (FeatureFlags.REFLECTION_FORCE_OVERVIEW_MODE) {
        predictionUiStateManager.switchClient(Client.OVERVIEW);
    }
}
Also used : CustomLauncherClient(com.saggitt.omega.util.CustomLauncherClient) QsbAnimationController(com.saggitt.omega.qsb.QsbAnimationController) WallpaperColorInfo(com.android.launcher3.uioverrides.WallpaperColorInfo)

Example 3 with WallpaperColorInfo

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

the class AbstractQsbLayout method onAttachedToWindow.

protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    getDevicePreferences().registerOnSharedPreferenceChangeListener(this);
    mTouchDelegate.setDelegateView(mMicFrame);
    SearchProviderController.Companion.getInstance(getContext()).addOnProviderChangeListener(this);
    WallpaperColorInfo instance = WallpaperColorInfo.getInstance(getContext());
    instance.addOnChangeListener(this);
    onExtractedColorsChanged(instance);
    updateConfiguration();
}
Also used : WallpaperColorInfo(com.android.launcher3.uioverrides.WallpaperColorInfo)

Example 4 with WallpaperColorInfo

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

the class BaseDraggingActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mIsSafeModeEnabled = getPackageManager().isSafeMode();
    mRotationListener = DisplayRotationListener.create(this, this::onDeviceRotationChanged);
    // Update theme
    WallpaperColorInfo wallpaperColorInfo = WallpaperColorInfo.getInstance(this);
    wallpaperColorInfo.addOnChangeListener(this);
    int themeRes = Themes.getActivityThemeRes(this);
    if (themeRes != mThemeRes) {
        mThemeRes = themeRes;
        setTheme(themeRes);
    }
}
Also used : WallpaperColorInfo(com.android.launcher3.uioverrides.WallpaperColorInfo)

Example 5 with WallpaperColorInfo

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

the class Themes method getActivityThemeRes.

public static int getActivityThemeRes(Context context) {
    WallpaperColorInfo wallpaperColorInfo = WallpaperColorInfo.getInstance(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.isDark() ? R.style.AppTheme_Dark_DarkMainColor : R.style.AppTheme_Dark;
    } else {
        return wallpaperColorInfo.supportsDarkText() ? R.style.AppTheme_DarkText : wallpaperColorInfo.isDark() ? 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