From c6c0367111e587c7f19cb8185dcda550aa94a848 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 6 Mar 2014 10:12:02 -0800 Subject: [PATCH] Disabling cling when the user moves the folder before launching it. (Bug 12963868) Change-Id: Iddcdf655c78b7240be123bd549f3d45794d02c83 --- src/com/android/launcher3/LauncherClings.java | 8 +++++++- src/com/android/launcher3/Workspace.java | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/LauncherClings.java b/src/com/android/launcher3/LauncherClings.java index 894f64da4f..952edfd060 100644 --- a/src/com/android/launcher3/LauncherClings.java +++ b/src/com/android/launcher3/LauncherClings.java @@ -297,12 +297,18 @@ class LauncherClings { public static void synchonouslyMarkFirstRunClingDismissed(Context ctx) { SharedPreferences prefs = ctx.getSharedPreferences( - LauncherAppState.getSharedPreferencesKey(),Context.MODE_PRIVATE); + LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(LauncherClings.FIRST_RUN_CLING_DISMISSED_KEY, true); editor.commit(); } + public void markFolderClingDismissed() { + SharedPreferences.Editor editor = mLauncher.getSharedPrefs().edit(); + editor.putBoolean(LauncherClings.FOLDER_CLING_DISMISSED_KEY, true); + editor.apply(); + } + /** Removes the cling outright from the DragLayer */ private void removeCling(int id) { final View cling = mLauncher.findViewById(id); diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 86c603e875..567abfa47d 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -2632,6 +2632,9 @@ public class Workspace extends SmoothPagedView if (child instanceof BubbleTextView) { BubbleTextView icon = (BubbleTextView) child; icon.clearPressedOrFocusedBackground(); + } else if (child instanceof FolderIcon) { + // Dismiss the folder cling if we haven't already + mLauncher.getLauncherClings().markFolderClingDismissed(); } if (child.getTag() == null || !(child.getTag() instanceof ItemInfo)) {