diff options
Diffstat (limited to 'java/com/android/dialer/app/widget/SearchEditTextLayout.java')
-rw-r--r-- | java/com/android/dialer/app/widget/SearchEditTextLayout.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/java/com/android/dialer/app/widget/SearchEditTextLayout.java b/java/com/android/dialer/app/widget/SearchEditTextLayout.java index d67fd9eff..f83c48288 100644 --- a/java/com/android/dialer/app/widget/SearchEditTextLayout.java +++ b/java/com/android/dialer/app/widget/SearchEditTextLayout.java @@ -52,6 +52,7 @@ public class SearchEditTextLayout extends FrameLayout { private View mVoiceSearchButtonView; private View mOverflowButtonView; private View mBackButtonView; + private View mExpandedSearchBox; private View mClearButtonView; private ValueAnimator mAnimator; @@ -89,27 +90,20 @@ public class SearchEditTextLayout extends FrameLayout { mVoiceSearchButtonView = findViewById(R.id.voice_search_button); mOverflowButtonView = findViewById(R.id.dialtacts_options_menu_button); mBackButtonView = findViewById(R.id.search_back_button); - mBackButtonView - .getResources() - .getDrawable(R.drawable.quantum_ic_arrow_back_vd_theme_24) - .setAutoMirrored(true); + mExpandedSearchBox = findViewById(R.id.search_box_expanded); mClearButtonView = findViewById(R.id.search_close_button); - // Convert a long click into a click to expand the search box. Touch events are also - // forwarded to the searchView. This accelerates the long-press scenario for copy/paste. + // Convert a long click into a click to expand the search box, and then long click on the + // search view. This accelerates the long-press scenario for copy/paste. mCollapsed.setOnLongClickListener( new OnLongClickListener() { @Override public boolean onLongClick(View view) { mCollapsed.performClick(); + mSearchView.performLongClick(); return false; } }); - mCollapsed.setOnTouchListener( - (v, event) -> { - mSearchView.onTouchEvent(event); - return false; - }); mSearchView.setOnFocusChangeListener( new OnFocusChangeListener() { @@ -218,7 +212,7 @@ public class SearchEditTextLayout extends FrameLayout { AnimUtils.crossFadeViews(mExpanded, mCollapsed, ANIMATION_DURATION); mAnimator = ValueAnimator.ofFloat(EXPAND_MARGIN_FRACTION_START, 0f); setMargins(EXPAND_MARGIN_FRACTION_START); - prepareAnimator(); + prepareAnimator(true); } else { mExpanded.setVisibility(View.VISIBLE); mExpanded.setAlpha(1); @@ -247,7 +241,7 @@ public class SearchEditTextLayout extends FrameLayout { if (animate) { AnimUtils.crossFadeViews(mCollapsed, mExpanded, ANIMATION_DURATION); mAnimator = ValueAnimator.ofFloat(0f, 1f); - prepareAnimator(); + prepareAnimator(false); } else { mCollapsed.setVisibility(View.VISIBLE); mCollapsed.setAlpha(1); @@ -285,7 +279,7 @@ public class SearchEditTextLayout extends FrameLayout { } } - private void prepareAnimator() { + private void prepareAnimator(final boolean expand) { if (mAnimator != null) { mAnimator.cancel(); } |