Search in sources :

Example 1 with FloatingHeaderView

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

the class AllAppsTipView method showAllAppsTipIfNecessary.

private static boolean showAllAppsTipIfNecessary(Launcher launcher) {
    FloatingHeaderView floatingHeaderView = launcher.getAppsView().getFloatingHeaderView();
    if (!floatingHeaderView.hasVisibleContent() || AbstractFloatingView.getOpenView(launcher, TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE) != null || !launcher.isInState(ALL_APPS) || hasSeenAllAppsTip(launcher) || launcher.getSystemService(UserManager.class).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return false;
    }
    int[] coords = new int[2];
    floatingHeaderView.findFixedRowByType(PredictionRowView.class).getLocationOnScreen(coords);
    ArrowTipView arrowTipView = new ArrowTipView(launcher).setOnClosedCallback(() -> {
        launcher.getSharedPrefs().edit().putBoolean(ALL_APPS_TIP_SEEN, true).apply();
        launcher.getUserEventDispatcher().logActionTip(LauncherEventUtil.DISMISS, ALL_APPS_PREDICTION_TIPS);
    });
    arrowTipView.show(launcher.getString(R.string.all_apps_prediction_tip), coords[1]);
    return true;
}
Also used : UserManager(android.os.UserManager) ArrowTipView(com.android.launcher3.views.ArrowTipView) FloatingHeaderView(com.android.launcher3.allapps.FloatingHeaderView)

Example 2 with FloatingHeaderView

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

the class FallbackAppsSearchView method hidePredictionRowView.

private void hidePredictionRowView(boolean z) {
    FloatingHeaderView predictionsFloatingHeader = mAppsView.getFloatingHeaderView();
    predictionsFloatingHeader.setCollapsed(z);
}
Also used : FloatingHeaderView(com.android.launcher3.allapps.FloatingHeaderView)

Example 3 with FloatingHeaderView

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

the class AllAppsTipView method showAllAppsTipIfNecessary.

private static boolean showAllAppsTipIfNecessary(Launcher launcher) {
    FloatingHeaderView floatingHeaderView = launcher.getAppsView().getFloatingHeaderView();
    if (!floatingHeaderView.hasVisibleContent() || AbstractFloatingView.getOpenView(launcher, TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE) != null || !launcher.isInState(ALL_APPS) || hasSeenAllAppsTip(launcher) || UserManagerCompat.getInstance(launcher).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return false;
    }
    AllAppsTipView allAppsTipView = new AllAppsTipView(launcher.getAppsView().getContext(), null);
    launcher.getDragLayer().addView(allAppsTipView);
    DragLayer.LayoutParams params = (DragLayer.LayoutParams) allAppsTipView.getLayoutParams();
    params.gravity = Gravity.CENTER_HORIZONTAL;
    int top = floatingHeaderView.findFixedRowByType(PredictionRowView.class).getTop();
    allAppsTipView.setY(top - launcher.getResources().getDimensionPixelSize(R.dimen.all_apps_tip_bottom_margin));
    allAppsTipView.setAlpha(0);
    allAppsTipView.animate().alpha(1f).withLayer().setStartDelay(SHOW_DELAY_MS).setDuration(SHOW_DURATION_MS).setInterpolator(Interpolators.DEACCEL).start();
    launcher.getUserEventDispatcher().logActionTip(LauncherEventUtil.VISIBLE, ALL_APPS_PREDICTION_TIPS);
    return true;
}
Also used : DragLayer(com.android.launcher3.dragndrop.DragLayer) Paint(android.graphics.Paint) FloatingHeaderView(com.android.launcher3.allapps.FloatingHeaderView)

Aggregations

FloatingHeaderView (com.android.launcher3.allapps.FloatingHeaderView)3 Paint (android.graphics.Paint)1 UserManager (android.os.UserManager)1 DragLayer (com.android.launcher3.dragndrop.DragLayer)1 ArrowTipView (com.android.launcher3.views.ArrowTipView)1