summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMac Duy Hai <haim@google.com>2013-10-16 13:46:04 +0100
committerDanesh M <daneshm90@gmail.com>2014-01-24 16:23:31 -0800
commit19c05929f259eb8a457b94bd6167694e5a0fbded (patch)
treec88a781aab686b4c9892d009448392c68a173c81 /src
parente59656bdee3b700654ef17717800b2ea0b6bdf6f (diff)
downloadandroid_packages_apps_Trebuchet-19c05929f259eb8a457b94bd6167694e5a0fbded.tar.gz
android_packages_apps_Trebuchet-19c05929f259eb8a457b94bd6167694e5a0fbded.tar.bz2
android_packages_apps_Trebuchet-19c05929f259eb8a457b94bd6167694e5a0fbded.zip
Shortcut show/hideSearchBar with new conditions.
This is effectively a revert of: https://googleplex-android-review.googlesource.com/374556 With the new rules, we won't shortcut if: - the search bar is in an opposite visibility OR - a non-animated change has been requested AND there is an ongoing animation. This makes sure that showSearchBar(false) called after showSearchBar(true) is not ignored. Bug: 11105305 Bug: 11237729 Change-Id: I92668dfac072e62506b2872e8bfbe9f707c9cc69
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/SearchDropTargetBar.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/launcher3/SearchDropTargetBar.java b/src/com/android/launcher3/SearchDropTargetBar.java
index 7a6147922..435dbda1d 100644
--- a/src/com/android/launcher3/SearchDropTargetBar.java
+++ b/src/com/android/launcher3/SearchDropTargetBar.java
@@ -138,6 +138,8 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
* Shows and hides the search bar.
*/
public void showSearchBar(boolean animated) {
+ boolean needToCancelOngoingAnimation = mQSBSearchBarAnim.isRunning() && !animated;
+ if (!mIsSearchBarHidden && !needToCancelOngoingAnimation) return;
if (animated) {
prepareStartAnimation(mQSBSearchBar);
mQSBSearchBarAnim.reverse();
@@ -152,6 +154,8 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
mIsSearchBarHidden = false;
}
public void hideSearchBar(boolean animated) {
+ boolean needToCancelOngoingAnimation = mQSBSearchBarAnim.isRunning() && !animated;
+ if (mIsSearchBarHidden && !needToCancelOngoingAnimation) return;
if (animated) {
prepareStartAnimation(mQSBSearchBar);
mQSBSearchBarAnim.start();