Search in sources :

Example 1 with OnboardingPrefs

use of com.android.launcher3.util.OnboardingPrefs 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 OnboardingPrefs

use of com.android.launcher3.util.OnboardingPrefs 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 OnboardingPrefs

use of com.android.launcher3.util.OnboardingPrefs 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 4 with OnboardingPrefs

use of com.android.launcher3.util.OnboardingPrefs 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)

Example 5 with OnboardingPrefs

use of com.android.launcher3.util.OnboardingPrefs in project android_packages_apps_404Launcher by P-404.

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)7 UserManager (android.os.UserManager)7 OnboardingPrefs (com.android.launcher3.util.OnboardingPrefs)7 PagedOrientationHandler (com.android.launcher3.touch.PagedOrientationHandler)2