diff options
author | Yorke Lee <yorkelee@google.com> | 2013-11-13 18:48:27 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-13 18:48:27 -0800 |
commit | 7daf8583a7c5c4959e575e607f6d481b5750a31c (patch) | |
tree | 2f95fc7df5b00c9f534627c5fc60cf1ad9b038ba /src/com/android/dialer | |
parent | 0d1804386f73f542bd6fcebe064288610d02354a (diff) | |
parent | a70f45478c1ff89a85d29dfda95e6082d67a4816 (diff) | |
download | packages_apps_Dialer-7daf8583a7c5c4959e575e607f6d481b5750a31c.tar.gz packages_apps_Dialer-7daf8583a7c5c4959e575e607f6d481b5750a31c.tar.bz2 packages_apps_Dialer-7daf8583a7c5c4959e575e607f6d481b5750a31c.zip |
am a70f4547: am 43744cc2: am 349f3e1b: Merge "Color/layout tweaks for Dialer" into klp-dev
* commit 'a70f45478c1ff89a85d29dfda95e6082d67a4816':
Color/layout tweaks for Dialer
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() { |