diff options
author | Yorke Lee <yorkelee@google.com> | 2013-11-14 01:36:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-11-14 01:36:16 +0000 |
commit | 349f3e1b6c5642636fbe4480a47b568e47c92154 (patch) | |
tree | 0714efbeee5febae4609f45b40e70f03433b4055 /src | |
parent | 59a3943236380a1b6e2a922caf6bc85ad2c29f15 (diff) | |
parent | 41a24b477dd0c550eda011a1b591603a20b980be (diff) | |
download | packages_apps_Dialer-349f3e1b6c5642636fbe4480a47b568e47c92154.tar.gz packages_apps_Dialer-349f3e1b6c5642636fbe4480a47b568e47c92154.tar.bz2 packages_apps_Dialer-349f3e1b6c5642636fbe4480a47b568e47c92154.zip |
Merge "Color/layout tweaks for Dialer" into klp-dev
Diffstat (limited to 'src')
-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() { |