From ed4e11ddafece1d308b87955880f4f153dbfc8e2 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Tue, 5 Sep 2017 18:24:47 -0700 Subject: Automated g4 rollback of changelist 167332236. *** Reason for rollback *** Based off a CL that needs to be rolled back. *** Original change description *** Improved behavior of back button in search ui. Pressing the back button in the search UI now functions as follows: - If the keyboard is opened, the keyboard is minimized - If the dialpad is opened, the dialpad is closed - If the keyboard and dialpad is closed, the search ui is closed Our existing behavior was dependent on whether a query had been built yet. basically, if the user pressed back with no query selected, the search ui was closed. From the bugbash: 7. No scroll bar in the search... *** Bug: 64902476,64137632,62685859,63691995,63939331 Test: n/a PiperOrigin-RevId: 167661409 Change-Id: I0627d54af33fb55c64b5edcd459dde6a73d93266 --- .../dialer/app/widget/ActionBarController.java | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'java/com/android/dialer/app/widget/ActionBarController.java') diff --git a/java/com/android/dialer/app/widget/ActionBarController.java b/java/com/android/dialer/app/widget/ActionBarController.java index 3daa0e2d4..c1b4cc2b4 100644 --- a/java/com/android/dialer/app/widget/ActionBarController.java +++ b/java/com/android/dialer/app/widget/ActionBarController.java @@ -49,6 +49,18 @@ public class ActionBarController { } }; + private final AnimationCallback mFadeInCallback = + new AnimationCallback() { + @Override + public void onAnimationEnd() { + slideActionBar(false /* slideUp */, false /* animate */); + } + + @Override + public void onAnimationCancel() { + slideActionBar(false /* slideUp */, false /* animate */); + } + }; private ValueAnimator mAnimator; public ActionBarController(ActivityUi activityUi, SearchEditTextLayout searchBox) { @@ -100,13 +112,17 @@ public class ActionBarController { mSearchBox.isFadedOut(), mSearchBox.isExpanded()); if (mActivityUi.isInSearchUi()) { - if (mSearchBox.isFadedOut()) { - mSearchBox.setVisible(true); - } - if (!mSearchBox.isExpanded()) { - mSearchBox.expand(false /* animate */, false /* requestFocus */); + if (mActivityUi.hasSearchQuery()) { + if (mSearchBox.isFadedOut()) { + mSearchBox.setVisible(true); + } + if (!mSearchBox.isExpanded()) { + mSearchBox.expand(false /* animate */, false /* requestFocus */); + } + slideActionBar(false /* slideUp */, true /* animate */); + } else { + mSearchBox.fadeIn(mFadeInCallback); } - slideActionBar(false /* slideUp */, true /* animate */); } } -- cgit v1.2.3