From 3520800e124f5871ab64721f9fb7049ecfa0cc54 Mon Sep 17 00:00:00 2001 From: Anne Rong Date: Wed, 22 Jul 2015 16:27:37 -0700 Subject: If nearby places is disabled, change search hint text. Added method setSearchBoxText to DialtactsActivity, for overriding in Google Dialer. Bug: 20699994 Change-Id: I82ac9bfd7aea705d2b32b63ee58220ac231fc489 --- res/values/strings.xml | 2 +- src/com/android/dialer/DialtactsActivity.java | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index eec9b0ca7..3d7d5f16a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -458,7 +458,7 @@ - Enter a name or phone number + Search contacts diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 98f34b57d..c88f70cd1 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -55,6 +55,7 @@ import android.widget.EditText; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.PopupMenu; +import android.widget.TextView; import android.widget.Toast; import com.android.contacts.common.activity.TransactionSafeActivity; @@ -393,8 +394,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O actionBar.setDisplayShowCustomEnabled(true); actionBar.setBackgroundDrawable(null); - SearchEditTextLayout searchEditTextLayout = - (SearchEditTextLayout) actionBar.getCustomView().findViewById(R.id.search_view_container); + SearchEditTextLayout searchEditTextLayout = (SearchEditTextLayout) actionBar + .getCustomView().findViewById(R.id.search_view_container); searchEditTextLayout.setPreImeKeyListener(mSearchEditTextLayoutListener); mActionBarController = new ActionBarController(this, searchEditTextLayout); @@ -545,6 +546,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mListsFragment.showTab(ListsFragment.TAB_INDEX_RECENTS); } + setSearchBoxHint(); + Trace.endSection(); } @@ -839,6 +842,20 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } } + protected int getSearchBoxHint () { + return R.string.dialer_hint_find_contact; + } + + /** + * Sets the hint text for the contacts search box + */ + private void setSearchBoxHint() { + SearchEditTextLayout searchEditTextLayout = (SearchEditTextLayout) getActionBar() + .getCustomView().findViewById(R.id.search_view_container); + ((TextView) searchEditTextLayout.findViewById(R.id.search_box_start_search)) + .setHint(getSearchBoxHint()); + } + protected OptionsPopupMenu buildOptionsMenu(View invoker) { final OptionsPopupMenu popupMenu = new OptionsPopupMenu(this, invoker); popupMenu.inflate(R.menu.dialtacts_options); -- cgit v1.2.3