Search in sources :

Example 1 with CustomLauncherClient

use of com.saggitt.omega.util.CustomLauncherClient in project Neo-Launcher by NeoApplications.

the class OmegaLauncherCallbacks method onDestroy.

@Override
public void onDestroy() {
    if (!mLauncherClient.isDestroyed()) {
        mLauncherClient.getActivity().unregisterReceiver(mLauncherClient.mInstallListener);
    }
    mLauncherClient.setDestroyed(true);
    mLauncherClient.getBaseService().disconnect();
    if (mLauncherClient.getOverlayCallback() != null) {
        mLauncherClient.getOverlayCallback().mClient = null;
        mLauncherClient.getOverlayCallback().mWindowManager = null;
        mLauncherClient.getOverlayCallback().mWindow = null;
        mLauncherClient.setOverlayCallback(null);
    }
    ClientService service = mLauncherClient.getClientService();
    CustomLauncherClient client = (CustomLauncherClient) service.getClient();
    if (client != null && client.equals(mLauncherClient)) {
        service.mWeakReference = null;
        if (!mLauncherClient.getActivity().isChangingConfigurations()) {
            service.disconnect();
            if (ClientService.sInstance == service) {
                ClientService.sInstance = null;
            }
        }
    }
    Utilities.getPrefs(mLauncher).unregisterOnSharedPreferenceChangeListener(this);
    WallpaperColorInfo.getInstance(mLauncher).removeOnChangeListener(this);
    PredictionUiStateManager.INSTANCE.get(mLauncher).setTargetAppsView(null);
}
Also used : ClientService(com.google.android.libraries.gsa.launcherclient.ClientService) CustomLauncherClient(com.saggitt.omega.util.CustomLauncherClient)

Example 2 with CustomLauncherClient

use of com.saggitt.omega.util.CustomLauncherClient 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)

Aggregations

CustomLauncherClient (com.saggitt.omega.util.CustomLauncherClient)2 WallpaperColorInfo (com.android.launcher3.uioverrides.WallpaperColorInfo)1 ClientService (com.google.android.libraries.gsa.launcherclient.ClientService)1 QsbAnimationController (com.saggitt.omega.qsb.QsbAnimationController)1