Search in sources :

Example 1 with DiscoveryBounce

use of com.android.launcher3.allapps.DiscoveryBounce in project android_packages_apps_Launcher3 by crdroidandroid.

the class DiscoveryBounce method showForHomeIfNeeded.

private static void showForHomeIfNeeded(Launcher launcher, boolean withDelay) {
    OnboardingPrefs onboardingPrefs = launcher.getOnboardingPrefs();
    if (!launcher.isInState(NORMAL) || onboardingPrefs.getBoolean(OnboardingPrefs.HOME_BOUNCE_SEEN) || AbstractFloatingView.getTopOpenView(launcher) != null || launcher.getSystemService(UserManager.class).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return;
    }
    if (withDelay) {
        new Handler().postDelayed(() -> showForHomeIfNeeded(launcher, false), DELAY_MS);
        return;
    }
    onboardingPrefs.incrementEventCount(OnboardingPrefs.HOME_BOUNCE_COUNT);
    new DiscoveryBounce(launcher).show();
}
Also used : OnboardingPrefs(com.android.launcher3.util.OnboardingPrefs) UserManager(android.os.UserManager) Handler(android.os.Handler)

Example 2 with DiscoveryBounce

use of com.android.launcher3.allapps.DiscoveryBounce in project android_packages_apps_Trebuchet by LineageOS.

the class DiscoveryBounce method showForHomeIfNeeded.

private static void showForHomeIfNeeded(Launcher launcher, boolean withDelay) {
    OnboardingPrefs onboardingPrefs = launcher.getOnboardingPrefs();
    if (!launcher.isInState(NORMAL) || onboardingPrefs.getBoolean(OnboardingPrefs.HOME_BOUNCE_SEEN) || AbstractFloatingView.getTopOpenView(launcher) != null || launcher.getSystemService(UserManager.class).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return;
    }
    if (withDelay) {
        new Handler().postDelayed(() -> showForHomeIfNeeded(launcher, false), DELAY_MS);
        return;
    }
    onboardingPrefs.incrementEventCount(OnboardingPrefs.HOME_BOUNCE_COUNT);
    new DiscoveryBounce(launcher, 0).show(HOTSEAT);
}
Also used : OnboardingPrefs(com.android.launcher3.util.OnboardingPrefs) UserManager(android.os.UserManager) Handler(android.os.Handler) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler)

Example 3 with DiscoveryBounce

use of com.android.launcher3.allapps.DiscoveryBounce in project Neo-Launcher by NeoApplications.

the class DiscoveryBounce method showForOverviewIfNeeded.

private static void showForOverviewIfNeeded(Launcher launcher, boolean withDelay) {
    if (!launcher.isInState(OVERVIEW) || !launcher.hasBeenResumed() || launcher.isForceInvisible() || launcher.getDeviceProfile().isVerticalBarLayout() || (launcher.getSharedPrefs().getBoolean(SHELF_BOUNCE_SEEN, false) && !shouldShowForWorkProfile(launcher)) || UserManagerCompat.getInstance(launcher).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return;
    }
    if (withDelay) {
        new Handler().postDelayed(() -> showForOverviewIfNeeded(launcher, false), DELAY_MS);
        return;
    } else if (InternalStateHandler.hasPending() || AbstractFloatingView.getTopOpenView(launcher) != null) {
        // TODO: Move these checks to the top and call this method after invalidate handler.
        return;
    }
    incrementShelfBounceCount(launcher);
    new DiscoveryBounce(launcher, (1 - OVERVIEW.getVerticalProgress(launcher))).show(PREDICTION);
}
Also used : InternalStateHandler(com.android.launcher3.states.InternalStateHandler) Handler(android.os.Handler)

Example 4 with DiscoveryBounce

use of com.android.launcher3.allapps.DiscoveryBounce in project android_packages_apps_Launcher3 by ArrowOS.

the class DiscoveryBounce method showForHomeIfNeeded.

private static void showForHomeIfNeeded(Launcher launcher, boolean withDelay) {
    OnboardingPrefs onboardingPrefs = launcher.getOnboardingPrefs();
    if (!launcher.isInState(NORMAL) || onboardingPrefs.getBoolean(OnboardingPrefs.HOME_BOUNCE_SEEN) || AbstractFloatingView.getTopOpenView(launcher) != null || launcher.getSystemService(UserManager.class).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return;
    }
    if (withDelay) {
        new Handler().postDelayed(() -> showForHomeIfNeeded(launcher, false), DELAY_MS);
        return;
    }
    onboardingPrefs.incrementEventCount(OnboardingPrefs.HOME_BOUNCE_COUNT);
    new DiscoveryBounce(launcher).show();
}
Also used : OnboardingPrefs(com.android.launcher3.util.OnboardingPrefs) UserManager(android.os.UserManager) Handler(android.os.Handler)

Example 5 with DiscoveryBounce

use of com.android.launcher3.allapps.DiscoveryBounce in project android_packages_apps_Launcher3 by ProtonAOSP.

the class DiscoveryBounce method showForHomeIfNeeded.

private static void showForHomeIfNeeded(Launcher launcher, boolean withDelay) {
    OnboardingPrefs onboardingPrefs = launcher.getOnboardingPrefs();
    if (!launcher.isInState(NORMAL) || onboardingPrefs.getBoolean(OnboardingPrefs.HOME_BOUNCE_SEEN) || AbstractFloatingView.getTopOpenView(launcher) != null || launcher.getSystemService(UserManager.class).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return;
    }
    if (withDelay) {
        new Handler().postDelayed(() -> showForHomeIfNeeded(launcher, false), DELAY_MS);
        return;
    }
    onboardingPrefs.incrementEventCount(OnboardingPrefs.HOME_BOUNCE_COUNT);
    new DiscoveryBounce(launcher).show();
}
Also used : OnboardingPrefs(com.android.launcher3.util.OnboardingPrefs) UserManager(android.os.UserManager) Handler(android.os.Handler)

Aggregations

Handler (android.os.Handler)9 UserManager (android.os.UserManager)7 OnboardingPrefs (com.android.launcher3.util.OnboardingPrefs)7 InternalStateHandler (com.android.launcher3.states.InternalStateHandler)2 PagedOrientationHandler (com.android.launcher3.touch.PagedOrientationHandler)2