diff options
author | Winson <winsonc@google.com> | 2015-08-20 15:22:18 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2015-08-20 22:29:49 +0000 |
commit | 81c5f7e39727085e1a8915cc36e9cbf2bb085890 (patch) | |
tree | c008e5c55a4a285c39a1a0becca6b614b7338d23 /src | |
parent | 6779595bec64fa4503c22f75c8e245a449fe665d (diff) | |
download | android_packages_apps_Trebuchet-81c5f7e39727085e1a8915cc36e9cbf2bb085890.tar.gz android_packages_apps_Trebuchet-81c5f7e39727085e1a8915cc36e9cbf2bb085890.tar.bz2 android_packages_apps_Trebuchet-81c5f7e39727085e1a8915cc36e9cbf2bb085890.zip |
Fixing issue with search bar not being visible.
- If you queue up two SearchBarDropTarget state transitions one right after
another, the second animation will skip (since the values haven't started
animating yet) and the first animation will complete instead, leaving the
visibility of the search and drop target bars at odds with the current
bar state.
- Instead, we should cancel all existing animators first, such that if we
are already in the final state, no animations will run, and the correct
bars will be visibile.
Bug: 23201830
Change-Id: I1f8e802821ef2b4904a3efa7edbea6ae615479b9
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/SearchDropTargetBar.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/launcher3/SearchDropTargetBar.java b/src/com/android/launcher3/SearchDropTargetBar.java index 1efdfb62d..772a334b9 100644 --- a/src/com/android/launcher3/SearchDropTargetBar.java +++ b/src/com/android/launcher3/SearchDropTargetBar.java @@ -186,7 +186,12 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D */ private void animateViewAlpha(LauncherViewPropertyAnimator animator, View v, float alpha, int duration) { - if (v != null && Float.compare(v.getAlpha(), alpha) != 0) { + if (v == null) { + return; + } + + animator.cancel(); + if (Float.compare(v.getAlpha(), alpha) != 0) { if (duration > 0) { animator.alpha(alpha).withLayer().setDuration(duration).start(); } else { |