diff options
author | Andrew Lee <anwlee@google.com> | 2014-10-14 12:59:46 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2014-10-14 12:59:46 -0700 |
commit | 02419fc82a98b613396da980b264650b40989043 (patch) | |
tree | df127de077b5b920a73c22d03b9730d36330bbe0 /src | |
parent | 847d8e2d0d854c019e703809e9318371de3f46cf (diff) |
Handle searchbox long press to speed up copy/paste.
Before, user needed to first tap on the the collapsed search box to
expand it. Afterwards, needed to long-press to open the paste option.
Now, if the user long-presses on the collapsed search box, it
simulates a click on the search box (causing it to expand), and then
invokes a long-press to open the paste option.
Bug: 17882004
Change-Id: Ie23df56fe1c340aacf484bc482fa8abb06a3574c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/widget/SearchEditTextLayout.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/dialer/widget/SearchEditTextLayout.java b/src/com/android/dialer/widget/SearchEditTextLayout.java index 919f65c3c..f22a3be9e 100644 --- a/src/com/android/dialer/widget/SearchEditTextLayout.java +++ b/src/com/android/dialer/widget/SearchEditTextLayout.java @@ -101,6 +101,17 @@ public class SearchEditTextLayout extends FrameLayout { 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, and then long click on the + // search view. This accelerates the long-press scenario for copy/paste. + mCollapsedSearchBox.setOnLongClickListener(new OnLongClickListener() { + @Override + public boolean onLongClick(View view) { + mCollapsedSearchBox.performClick(); + mSearchView.performLongClick(); + return false; + } + }); + mSearchView.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { |