diff options
author | Winson Chung <winsonc@google.com> | 2013-09-25 16:29:40 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2013-09-25 17:59:45 -0700 |
commit | 94d6768c65929efa21bb893fdef7f269d65da3c3 (patch) | |
tree | 00d5b9c5c7ba48b462e409e31b6860e29dc1d212 /src/com/android/launcher3/Launcher.java | |
parent | 10f3e9ff1aca9772272c74a36ea381193d3f1139 (diff) | |
download | android_packages_apps_Trebuchet-94d6768c65929efa21bb893fdef7f269d65da3c3.tar.gz android_packages_apps_Trebuchet-94d6768c65929efa21bb893fdef7f269d65da3c3.tar.bz2 android_packages_apps_Trebuchet-94d6768c65929efa21bb893fdef7f269d65da3c3.zip |
Restoring INSTALL_SHORTCUT receiver (Bug. 10343529)
Change-Id: Icd6a97c1d7877241aa9c71bd80dfdbe6e44ca7ee
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 84d5a09f7..102f4c272 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -209,7 +209,8 @@ public class Launcher extends Activity private static int sScreen = DEFAULT_SCREEN; // How long to wait before the new-shortcut animation automatically pans the workspace - private static int NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS = 10; + private static int NEW_APPS_PAGE_MOVE_DELAY = 500; + private static int NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS = 5; private static int NEW_APPS_ANIMATION_DELAY = 500; private final BroadcastReceiver mCloseSystemDialogsReceiver @@ -3694,20 +3695,23 @@ public class Launcher extends Activity // Animate to the correct page if (newShortcutsScreenId > -1) { long currentScreenId = mWorkspace.getScreenIdForPageIndex(mWorkspace.getNextPage()); - int newScreenIndex = mWorkspace.getPageIndexForScreenId(newShortcutsScreenId); + final int newScreenIndex = mWorkspace.getPageIndexForScreenId(newShortcutsScreenId); if (newShortcutsScreenId != currentScreenId) { - mWorkspace.snapToPage(newScreenIndex); + // We post the animation slightly delayed to prevent slowdowns + // when we are loading right after we return to launcher. + mWorkspace.postDelayed(new Runnable() { + public void run() { + mWorkspace.snapToPage(newScreenIndex); + mWorkspace.postDelayed(new Runnable() { + public void run() { + anim.playTogether(bounceAnims); + anim.start(); + } + }, NEW_APPS_ANIMATION_DELAY); + } + }, NEW_APPS_PAGE_MOVE_DELAY); } } - - // We post the animation slightly delayed to prevent slowdowns when we are loading - // right after we return to launcher. - mWorkspace.postDelayed(new Runnable() { - public void run() { - anim.playTogether(bounceAnims); - anim.start(); - } - }, NEW_APPS_ANIMATION_DELAY); } workspace.requestLayout(); } |