diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java index 6ecc4f9e73..1d8ad4a1a7 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java @@ -31,6 +31,7 @@ import android.app.prediction.AppTargetEvent; import android.content.ComponentName; import android.os.Process; import android.util.Log; +import android.view.HapticFeedbackConstants; import android.view.View; import android.view.ViewGroup; @@ -69,6 +70,7 @@ import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.IntArray; +import com.android.launcher3.util.OnboardingPrefs; import com.android.launcher3.views.ArrowTipView; import com.android.launcher3.views.Snackbar; @@ -120,6 +122,17 @@ public class HotseatPredictionController implements DragController.DragListener, private final View.OnLongClickListener mPredictionLongClickListener = v -> { if (!ItemLongClickListener.canStartDrag(mLauncher)) return false; if (mLauncher.getWorkspace().isSwitchingState()) return false; + if (!mLauncher.getOnboardingPrefs().getBoolean( + OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN)) { + Intent intent = new Intent(SETTINGS_ACTION); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + Snackbar.show(mLauncher, R.string.hotseat_tip_gaps_filled, + R.string.hotseat_prediction_settings, null, + () -> mLauncher.startActivity(intent)); + mLauncher.getOnboardingPrefs().markChecked(OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN); + mLauncher.getDragLayer().performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); + return true; + } // Start the drag mLauncher.getWorkspace().beginDragShared(v, this, new DragOptions()); return true; diff --git a/src/com/android/launcher3/util/OnboardingPrefs.java b/src/com/android/launcher3/util/OnboardingPrefs.java index 90a1c82661..e3bd1b91a5 100644 --- a/src/com/android/launcher3/util/OnboardingPrefs.java +++ b/src/com/android/launcher3/util/OnboardingPrefs.java @@ -38,6 +38,7 @@ public class OnboardingPrefs { public static final String SHELF_BOUNCE_COUNT = "launcher.shelf_bounce_count"; public static final String ALL_APPS_COUNT = "launcher.all_apps_count"; public static final String HOTSEAT_DISCOVERY_TIP_COUNT = "launcher.hotseat_discovery_tip_count"; + public static final String HOTSEAT_LONGPRESS_TIP_SEEN = "launcher.hotseat_longpress_tip_seen"; /** * Events that either have happened or have not (booleans). @@ -111,4 +112,11 @@ public class OnboardingPrefs { mSharedPrefs.edit().putInt(eventKey, count).apply(); return hasReachedMaxCount(count, eventKey); } + + /** + * Marks on-boarding preference boolean at true + */ + public void markChecked(String flag) { + mSharedPrefs.edit().putBoolean(flag, true).apply(); + } }