diff options
author | Winson <winsonc@google.com> | 2015-09-25 23:23:56 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-25 23:23:56 +0000 |
commit | aab143fd6543773798ee23c435b83405a2f21f63 (patch) | |
tree | 17668ce8b1e3b292bed0134c619a08ae9002e264 | |
parent | 8660cf5d1b9d10eb969c8bbc908994e6affe33f6 (diff) | |
parent | f768d934682ba80da89d454543928e629a44103d (diff) | |
download | android_packages_apps_Trebuchet-aab143fd6543773798ee23c435b83405a2f21f63.tar.gz android_packages_apps_Trebuchet-aab143fd6543773798ee23c435b83405a2f21f63.tar.bz2 android_packages_apps_Trebuchet-aab143fd6543773798ee23c435b83405a2f21f63.zip |
am f768d934: Fixing regression in L3 with search bar transition.
* commit 'f768d934682ba80da89d454543928e629a44103d':
Fixing regression in L3 with search bar transition.
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherStateTransitionAnimation.java | 39 |
2 files changed, 25 insertions, 20 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 40c6df145..a4f684f02 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3471,8 +3471,12 @@ public class Launcher extends Activity // NO-OP } + public boolean launcherCallbacksProvidesSearch() { + return (mLauncherCallbacks != null && mLauncherCallbacks.providesSearch()); + } + public View getOrCreateQsbBar() { - if (mLauncherCallbacks != null && mLauncherCallbacks.providesSearch()) { + if (launcherCallbacksProvidesSearch()) { return mLauncherCallbacks.getQsbBar(); } diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java index d3af19a9e..877880592 100644 --- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java +++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java @@ -805,26 +805,27 @@ public class LauncherStateTransitionAnimation { toWorkspaceState.getSearchDropTargetBarState(); if (overlaySearchBar != null) { - if ((toWorkspaceState == Workspace.State.NORMAL) && - (fromWorkspaceState == Workspace.State.NORMAL_HIDDEN)) { - // If we are transitioning from the overlay to the workspace, then show the - // workspace search bar immediately and let the overlay search bar fade out on top - mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, 0); - } else if (fromWorkspaceState == Workspace.State.NORMAL) { - // If we are transitioning from the workspace to the overlay, then keep the - // workspace search bar visible until the overlay search bar fades in on top - animation.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, 0); - } - }); - } else { - // Otherwise, then just animate the workspace search bar normally - mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, duration); + if (mLauncher.launcherCallbacksProvidesSearch()) { + if ((toWorkspaceState == Workspace.State.NORMAL) && + (fromWorkspaceState == Workspace.State.NORMAL_HIDDEN)) { + // If we are transitioning from the overlay to the workspace, then show the + // workspace search bar immediately and let the overlay search bar fade out on + // top + mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, 0); + return; + } else if (fromWorkspaceState == Workspace.State.NORMAL) { + // If we are transitioning from the workspace to the overlay, then keep the + // workspace search bar visible until the overlay search bar fades in on top + animation.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, 0); + } + }); + return; + } } - } else { - // If there is no overlay search bar, then just animate the workspace search bar + // Fallback to the default search bar animation otherwise mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, duration); } } |