From ee5bce98231b96bc7f3ecf2d12276571786863f5 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Fri, 1 Sep 2017 15:25:00 -0700 Subject: 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 results if the results do not fill the entire view. The keyboard overlaps the results and there is no way to get to the enter list without dismissing the keyboard. 10. Dismiss the keyboard on tapping the down arrow on the keyboard. Arrow points down but works like back button Bug: 64902476,64137632,62685859,63691995,63939331 Test: manual PiperOrigin-RevId: 167332236 Change-Id: I1c0b5b429316dae119b5fb21be4303d7fe052e35 --- .../dialer/app/widget/ActionBarController.java | 28 +++++----------------- 1 file changed, 6 insertions(+), 22 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 c1b4cc2b4..3daa0e2d4 100644 --- a/java/com/android/dialer/app/widget/ActionBarController.java +++ b/java/com/android/dialer/app/widget/ActionBarController.java @@ -49,18 +49,6 @@ 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) { @@ -112,17 +100,13 @@ public class ActionBarController { mSearchBox.isFadedOut(), mSearchBox.isExpanded()); if (mActivityUi.isInSearchUi()) { - 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); + if (mSearchBox.isFadedOut()) { + mSearchBox.setVisible(true); + } + if (!mSearchBox.isExpanded()) { + mSearchBox.expand(false /* animate */, false /* requestFocus */); } + slideActionBar(false /* slideUp */, true /* animate */); } } -- cgit v1.2.3