diff options
author | Anne Rong <annerong@google.com> | 2015-07-22 16:27:37 -0700 |
---|---|---|
committer | Anne Rong <annerong@google.com> | 2015-07-23 13:47:29 -0700 |
commit | 3520800e124f5871ab64721f9fb7049ecfa0cc54 (patch) | |
tree | 65658e80203c80224733d2b2f989bc9d70bdd02b | |
parent | ab183510ce4ed4538d5bbbbfba512db240b32f27 (diff) |
If nearby places is disabled, change search hint text.
Added method setSearchBoxText to DialtactsActivity, for overriding
in Google Dialer.
Bug: 20699994
Change-Id: I82ac9bfd7aea705d2b32b63ee58220ac231fc489
-rw-r--r-- | res/values/strings.xml | 2 | ||||
-rw-r--r-- | 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 @@ <!-- Hint displayed in dialer search box when there is no query that is currently typed. [CHAR LIMIT=30] --> - <string name="dialer_hint_find_contact">Enter a name or phone number</string> + <string name="dialer_hint_find_contact">Search contacts</string> <!-- String resource for the font-family to use for the call log activity's title Do not translate. --> 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); |