From 02419fc82a98b613396da980b264650b40989043 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 14 Oct 2014 12:59:46 -0700 Subject: 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 --- src/com/android/dialer/widget/SearchEditTextLayout.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3