From 41a24b477dd0c550eda011a1b591603a20b980be Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Wed, 13 Nov 2013 16:14:41 -0800 Subject: Color/layout tweaks for Dialer Add search icon into search box Change background of recent cards shortcut to whiter one Whiten the action bar Darken background color of list items Reduce size of searchview text Bug: 11654293 Change-Id: I204b14e752b40563a6f7ebdd1d61f10854b41100 --- src/com/android/dialer/DialtactsActivity.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/com') 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() { -- cgit v1.2.3