diff options
Diffstat (limited to 'src/com/android/dialer')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index faf63cda9..04934c776 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -27,6 +27,7 @@ import android.app.FragmentTransaction; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.RemoteException; @@ -38,8 +39,11 @@ import android.provider.ContactsContract.Intents.UI; import android.speech.RecognizerIntent; import android.telephony.TelephonyManager; import android.text.Editable; +import android.text.Spannable; +import android.text.SpannableStringBuilder; import android.text.TextUtils; import android.text.TextWatcher; +import android.text.style.ImageSpan; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -507,7 +511,19 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mVoiceSearchButton.setOnClickListener(this); mSearchView = (EditText) findViewById(R.id.search_view); mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener); - mSearchView.setHint(getString(R.string.dialer_hint_find_contact)); + + final String hintText = getString(R.string.dialer_hint_find_contact); + + // The following code is used to insert an icon into a CharSequence (copied from + // SearchView) + final SpannableStringBuilder ssb = new SpannableStringBuilder(" "); // for the icon + ssb.append(hintText); + final Drawable searchIcon = getResources().getDrawable(R.drawable.ic_ab_search); + final int textSize = (int) (mSearchView.getTextSize() * 1.20); + searchIcon.setBounds(0, 0, textSize, textSize); + ssb.setSpan(new ImageSpan(searchIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + + mSearchView.setHint(ssb); } final AnimatorListener mHideListener = new AnimatorListenerAdapter() { |