diff options
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index b07943019..d7e9caf7c 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2127,6 +2127,10 @@ public class Launcher extends Activity return false; } + void enterAllAppsOverviewMode() { + mAppsCustomizeContent.enterOverviewMode(); + } + @Override public boolean onSearchRequested() { startSearch(null, false, null, true); @@ -2348,6 +2352,9 @@ public class Launcher extends Activity @Override public void onBackPressed() { if (isAllAppsVisible()) { + if (isClingsEnabled()) { + dismissAllAppsCling(null); + } if (mAppsCustomizeContent.isInOverviewMode()) { mAppsCustomizeContent.exitOverviewMode(true); } else { @@ -3056,6 +3063,23 @@ public class Launcher extends Activity AppsCustomizePagedView.ContentType contentType = mAppsCustomizeContent.getContentType(); showAppsCustomizeHelper(animated, springLoaded, contentType); } + + public void showAllAppsCling() { + if (isClingsEnabled() && + !mSharedPrefs.getBoolean(Cling.ALL_APPS_CLING_DISMISSED_KEY, false) && + !skipCustomClingIfNoAccounts() ) { + Cling cling = (Cling) findViewById(R.id.all_apps_cling); + View pageIndicator = mAppsCustomizeLayout.findViewById(R.id.page_indicator); + cling.setPunchThroughForView(pageIndicator); + if (cling != null) { + cling.bringToFront(); + } + initCling(R.id.all_apps_cling, 0, true, true); + } else { + removeCling(R.id.all_apps_cling); + } + } + private void showAppsCustomizeHelper(final boolean animated, final boolean springLoaded, final AppsCustomizePagedView.ContentType contentType) { if (mStateAnimation != null) { @@ -3135,6 +3159,8 @@ public class Launcher extends Activity if (mSearchDropTargetBar != null) { mSearchDropTargetBar.hideSearchBar(false); } + + showAllAppsCling(); } }); @@ -4613,6 +4639,11 @@ public class Launcher extends Activity dismissCling(cling, null, Cling.FOLDER_CLING_DISMISSED_KEY, DISMISS_CLING_DURATION, true); } + public void dismissAllAppsCling(View v) { + Cling cling = (Cling) findViewById(R.id.all_apps_cling); + dismissCling(cling, null, Cling.ALL_APPS_CLING_DISMISSED_KEY, + DISMISS_CLING_DURATION, true); + } /** * To avoid managing preference change listeners for various parts of the |