diff options
author | calderwoodra <calderwoodra@google.com> | 2017-09-05 18:24:47 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-09-11 10:59:19 -0700 |
commit | ed4e11ddafece1d308b87955880f4f153dbfc8e2 (patch) | |
tree | 9de137a386af8a19b62c981e17389f856bb52373 /java/com/android/dialer/app/widget/ActionBarController.java | |
parent | b91261f1fd54fc9517b3e848fc18ca7d7edc0e26 (diff) |
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
Diffstat (limited to 'java/com/android/dialer/app/widget/ActionBarController.java')
-rw-r--r-- | java/com/android/dialer/app/widget/ActionBarController.java | 28 |
1 files changed, 22 insertions, 6 deletions
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 */); } } |