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