diff options
-rw-r--r-- | src/com/android/launcher3/LauncherClings.java | 14 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherClings.java b/src/com/android/launcher3/LauncherClings.java index 00711fe4b..f996f1f45 100644 --- a/src/com/android/launcher3/LauncherClings.java +++ b/src/com/android/launcher3/LauncherClings.java @@ -314,6 +314,20 @@ class LauncherClings { } } + public static void synchonouslyMarkFirstRunClingDismissed(Context ctx) { + SharedPreferences prefs = ctx.getSharedPreferences( + 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 ba3301d27..c4cc60462 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -2766,6 +2766,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)) { |