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 --- res/drawable-hdpi/dialer_recent_card_bg.9.png | Bin 191 -> 199 bytes res/drawable-hdpi/ic_ab_search.png | Bin 0 -> 1113 bytes res/drawable-mdpi/dialer_recent_card_bg.9.png | Bin 178 -> 180 bytes res/drawable-mdpi/ic_ab_search.png | Bin 0 -> 743 bytes res/drawable-xhdpi/dialer_recent_card_bg.9.png | Bin 212 -> 226 bytes res/drawable-xhdpi/ic_ab_search.png | Bin 0 -> 1588 bytes res/drawable-xxhdpi/dialer_recent_card_bg.9.png | Bin 179 -> 244 bytes res/drawable-xxhdpi/ic_ab_search.png | Bin 0 -> 1503 bytes res/layout/dialtacts_activity.xml | 63 +++++++++++++----------- res/values/colors.xml | 4 +- res/values/dimens.xml | 2 +- src/com/android/dialer/DialtactsActivity.java | 18 ++++++- 12 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 res/drawable-hdpi/ic_ab_search.png create mode 100644 res/drawable-mdpi/ic_ab_search.png create mode 100644 res/drawable-xhdpi/ic_ab_search.png create mode 100644 res/drawable-xxhdpi/ic_ab_search.png diff --git a/res/drawable-hdpi/dialer_recent_card_bg.9.png b/res/drawable-hdpi/dialer_recent_card_bg.9.png index e58194331..2bfdbcb9c 100644 Binary files a/res/drawable-hdpi/dialer_recent_card_bg.9.png and b/res/drawable-hdpi/dialer_recent_card_bg.9.png differ diff --git a/res/drawable-hdpi/ic_ab_search.png b/res/drawable-hdpi/ic_ab_search.png new file mode 100644 index 000000000..3702846fd Binary files /dev/null and b/res/drawable-hdpi/ic_ab_search.png differ diff --git a/res/drawable-mdpi/dialer_recent_card_bg.9.png b/res/drawable-mdpi/dialer_recent_card_bg.9.png index cb1d26fc8..dff6a0b84 100644 Binary files a/res/drawable-mdpi/dialer_recent_card_bg.9.png and b/res/drawable-mdpi/dialer_recent_card_bg.9.png differ diff --git a/res/drawable-mdpi/ic_ab_search.png b/res/drawable-mdpi/ic_ab_search.png new file mode 100644 index 000000000..cc9f9117f Binary files /dev/null and b/res/drawable-mdpi/ic_ab_search.png differ diff --git a/res/drawable-xhdpi/dialer_recent_card_bg.9.png b/res/drawable-xhdpi/dialer_recent_card_bg.9.png index e1a4b67fd..05d254d6a 100644 Binary files a/res/drawable-xhdpi/dialer_recent_card_bg.9.png and b/res/drawable-xhdpi/dialer_recent_card_bg.9.png differ diff --git a/res/drawable-xhdpi/ic_ab_search.png b/res/drawable-xhdpi/ic_ab_search.png new file mode 100644 index 000000000..718ff4943 Binary files /dev/null and b/res/drawable-xhdpi/ic_ab_search.png differ diff --git a/res/drawable-xxhdpi/dialer_recent_card_bg.9.png b/res/drawable-xxhdpi/dialer_recent_card_bg.9.png index 614207878..87d95f0ed 100644 Binary files a/res/drawable-xxhdpi/dialer_recent_card_bg.9.png and b/res/drawable-xxhdpi/dialer_recent_card_bg.9.png differ diff --git a/res/drawable-xxhdpi/ic_ab_search.png b/res/drawable-xxhdpi/ic_ab_search.png new file mode 100644 index 000000000..4bb5165c9 Binary files /dev/null and b/res/drawable-xxhdpi/ic_ab_search.png differ diff --git a/res/layout/dialtacts_activity.xml b/res/layout/dialtacts_activity.xml index 255eb49fb..e2c385364 100644 --- a/res/layout/dialtacts_activity.xml +++ b/res/layout/dialtacts_activity.xml @@ -81,36 +81,41 @@ android:id="@+id/dialtacts_frame" android:clipChildren="false"> + - - - - + android:layout_height="@dimen/fake_action_bar_height" + android:layout_width="match_parent" + android:id="@+id/fake_action_bar" + android:background="@color/actionbar_background_color"> + + + + #cecece - #f5f5f5 + #eeeeee #f2020709 @@ -52,7 +52,7 @@ #aaaaaa - #e6e6e6 + #ffffff #d0d0d0 diff --git a/res/values/dimens.xml b/res/values/dimens.xml index e4e847c32..17439521b 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -30,7 +30,7 @@ 74dp - 16sp + 14sp 32dip 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