diff options
author | Adam Cohen <adamcohen@google.com> | 2011-08-02 22:14:07 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-08-02 22:26:50 -0700 |
commit | 9932a9b1e66fed4b5f38ce50f13d56331bbdcd7e (patch) | |
tree | 2be4b796b369af0dd4dc6770d19d299faf68a0e9 /src/com/android/launcher2/Launcher.java | |
parent | b2cdfb5f86bcf3e97598f9dd88415980d5a51f84 (diff) | |
download | packages_apps_trebuchet-9932a9b1e66fed4b5f38ce50f13d56331bbdcd7e.zip packages_apps_trebuchet-9932a9b1e66fed4b5f38ce50f13d56331bbdcd7e.tar.gz packages_apps_trebuchet-9932a9b1e66fed4b5f38ce50f13d56331bbdcd7e.tar.bz2 |
Fixing weird deferred click events after deleting folder
-> Fixing issue 5055487
Change-Id: I932f95f29322fa50035b13063ab51fad2d2217e8
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index a8782ba..ac85f98 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1533,8 +1533,15 @@ public final class Launcher extends Activity * @param v The view representing the clicked shortcut. */ public void onClick(View v) { - // Make sure that rogue clicks don't get through while allapps is launching - if (mWorkspace.isSwitchingState()) return; + // Make sure that rogue clicks don't get through while allapps is launching, or after the + // view has detached (it's possible for this to happen if the view is removed mid touch). + if (v.getWindowToken() == null) { + return; + } + + if (mWorkspace.isSwitchingState()) { + return; + } Object tag = v.getTag(); if (tag instanceof ShortcutInfo) { @@ -1692,6 +1699,7 @@ public final class Launcher extends Activity } private void growAndFadeOutFolderIcon(FolderIcon fi) { + if (fi == null) return; PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 0); PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.5f); PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.5f); @@ -1708,6 +1716,7 @@ public final class Launcher extends Activity } private void shrinkAndFadeInFolderIcon(FolderIcon fi) { + if (fi == null) return; PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 1.0f); PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.0f); PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.0f); |