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 /src/com/android/dialer/DialtactsActivity.java | |
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
Diffstat (limited to 'src/com/android/dialer/DialtactsActivity.java')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 21 |
1 files changed, 19 insertions, 2 deletions
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); |