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;
}
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);
}
}
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();
}
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);
}
}
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;
}
}
Aggregations