diff options
author | Yorke Lee <yorkelee@google.com> | 2013-09-06 12:08:08 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-09-06 12:26:50 -0700 |
commit | 778408732c1e8fb81d1b5dc6df92725aa397e978 (patch) | |
tree | 2a72f95dfc0f6b9af8855dc0e46290c9636bea32 | |
parent | 6276f093cf16a4797f43d53a76e3a8e5a279ea22 (diff) |
Tweak Dialpad redlines
Centralize dialpad keys
Change voicemail icon
Bug: 10445734
Bug: 10510368
Change-Id: I1e9dc98c9aed07c26bdfe176f4a4c94c65fc6d85
-rw-r--r-- | res/drawable-hdpi/ic_dial_action_vm.png | bin | 560 -> 727 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_dial_action_vm.png | bin | 440 -> 522 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_dial_action_vm.png | bin | 723 -> 929 bytes | |||
-rw-r--r-- | res/layout/dialpad.xml | 41 | ||||
-rw-r--r-- | res/layout/dialpad_key.xml | 40 | ||||
-rw-r--r-- | res/values/dimens.xml | 3 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 9 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadKeyButton.java | 4 |
8 files changed, 57 insertions, 40 deletions
diff --git a/res/drawable-hdpi/ic_dial_action_vm.png b/res/drawable-hdpi/ic_dial_action_vm.png Binary files differindex 68ee3d6c9..f4243043a 100644 --- a/res/drawable-hdpi/ic_dial_action_vm.png +++ b/res/drawable-hdpi/ic_dial_action_vm.png diff --git a/res/drawable-mdpi/ic_dial_action_vm.png b/res/drawable-mdpi/ic_dial_action_vm.png Binary files differindex 5b91b42a6..fbcf378cf 100644 --- a/res/drawable-mdpi/ic_dial_action_vm.png +++ b/res/drawable-mdpi/ic_dial_action_vm.png diff --git a/res/drawable-xhdpi/ic_dial_action_vm.png b/res/drawable-xhdpi/ic_dial_action_vm.png Binary files differindex 269fd1a92..2919bbde2 100644 --- a/res/drawable-xhdpi/ic_dial_action_vm.png +++ b/res/drawable-xhdpi/ic_dial_action_vm.png diff --git a/res/layout/dialpad.xml b/res/layout/dialpad.xml index 60240bc3f..ec850c971 100644 --- a/res/layout/dialpad.xml +++ b/res/layout/dialpad.xml @@ -37,23 +37,26 @@ android:id="@+id/one" style="@style/DialtactsDialpadButtonStyle" android:clickable="true" > - <TextView - android:id="@+id/dialpad_key_number" + <LinearLayout android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/dialpad_primary_text_color" - android:textSize="@dimen/dialpad_key_numbers_size" - android:fontFamily="sans-serif-light" - android:layout_centerInParent="true" /> - <ImageView - android:id="@+id/dialpad_key_voicemail" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/ic_dial_action_vm" - android:paddingRight="11dp" - android:layout_alignBaseline="@id/dialpad_key_number" - android:baselineAlignBottom="true" - android:layout_alignParentRight="true" /> + android:layout_height="match_parent" + android:layout_gravity="center" > + <TextView + android:id="@+id/dialpad_key_number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/dialpad_primary_text_color" + android:textSize="@dimen/dialpad_key_numbers_size" + android:fontFamily="sans-serif-light"/> + <ImageView + android:id="@+id/dialpad_key_voicemail" + android:layout_width="@dimen/dialpad_key_letters_width" + android:layout_height="wrap_content" + android:src="@drawable/ic_dial_action_vm" + android:paddingLeft="11dp" + android:scaleType="fitStart" + android:baselineAlignBottom="true" /> + </LinearLayout> </com.android.dialer.dialpad.DialpadKeyButton> <include layout="@layout/dialpad_key" android:id="@+id/two"/> <include layout="@layout/dialpad_key" android:id="@+id/three"/> @@ -90,7 +93,8 @@ android:textColor="@color/dialpad_secondary_text_color" android:textSize="@dimen/dialpad_key_special_characters_size" android:fontFamily="sans-serif-light" - android:layout_centerInParent="true" /> + android:paddingRight="@dimen/dialpad_key_letters_width" + android:layout_gravity="center" /> </com.android.dialer.dialpad.DialpadKeyButton> <include layout="@layout/dialpad_key" android:id="@+id/zero"/> <com.android.dialer.dialpad.DialpadKeyButton @@ -105,7 +109,8 @@ android:textColor="@color/dialpad_secondary_text_color" android:textSize="@dimen/dialpad_key_special_characters_size" android:fontFamily="sans-serif-light" - android:layout_centerInParent="true" /> + android:paddingRight="@dimen/dialpad_key_letters_width" + android:layout_gravity="center" /> </com.android.dialer.dialpad.DialpadKeyButton> </TableRow> </TableLayout> diff --git a/res/layout/dialpad_key.xml b/res/layout/dialpad_key.xml index b204c20a2..074e0235f 100644 --- a/res/layout/dialpad_key.xml +++ b/res/layout/dialpad_key.xml @@ -19,24 +19,26 @@ xmlns:android="http://schemas.android.com/apk/res/android" style="@style/DialtactsDialpadButtonStyle" android:clickable="true" > - <TextView - android:id="@+id/dialpad_key_number" + <LinearLayout android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/dialpad_primary_text_color" - android:textSize="@dimen/dialpad_key_numbers_size" - android:fontFamily="sans-serif-light" - android:layout_centerInParent="true" - /> - <TextView - android:id="@+id/dialpad_key_letters" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/dialpad_secondary_text_color" - android:textSize="@dimen/dialpad_key_letters_size" - android:paddingRight="11dp" - android:layout_alignBaseline="@id/dialpad_key_number" - android:fontFamily="sans-serif-light" - android:layout_alignParentRight="true" - /> + android:layout_height="match_parent" + android:layout_gravity="center"> + <TextView + android:id="@+id/dialpad_key_number" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/dialpad_primary_text_color" + android:textSize="@dimen/dialpad_key_numbers_size" + android:fontFamily="sans-serif-light" + /> + <TextView + android:id="@+id/dialpad_key_letters" + android:layout_width="@dimen/dialpad_key_letters_width" + android:layout_height="wrap_content" + android:textColor="@color/dialpad_secondary_text_color" + android:textSize="@dimen/dialpad_key_letters_size" + android:paddingLeft="11dp" + android:fontFamily="sans-serif-light" + /> + </LinearLayout> </com.android.dialer.dialpad.DialpadKeyButton>
\ No newline at end of file diff --git a/res/values/dimens.xml b/res/values/dimens.xml index e03e91916..fe4c0a1e1 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -52,7 +52,10 @@ <!-- Text dimensions for dialpad keys --> <dimen name="dialpad_key_numbers_size">40dp</dimen> <dimen name="dialpad_key_letters_size">11dp</dimen> + <dimen name="dialpad_key_plus_size">15dp</dimen> <dimen name="dialpad_key_special_characters_size">25dp</dimen> + <dimen name="dialpad_key_letters_width">41dp</dimen> + <dimen name="fake_action_bar_height">48dp</dimen> <!-- Min with of fake menu buttons, which should be same as ActionBar's one --> diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 79e830730..0465ddbbf 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -52,6 +52,7 @@ import android.text.style.RelativeSizeSpan; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.util.Log; +import android.util.TypedValue; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; @@ -600,10 +601,12 @@ public class DialpadFragment extends Fragment R.string.dialpad_8_letters, R.string.dialpad_9_letters, R.string.dialpad_star_letters, R.string.dialpad_pound_letters}; + final Resources resources = getResources(); + DialpadKeyButton dialpadKey; TextView numberView; TextView lettersView; - final Resources resources = getResources(); + for (int i = 0; i < buttonIds.length; i++) { dialpadKey = (DialpadKeyButton) fragmentView.findViewById(buttonIds[i]); dialpadKey.setLayoutParams(new TableRow.LayoutParams( @@ -614,6 +617,10 @@ public class DialpadFragment extends Fragment numberView.setText(resources.getString(numberIds[i])); if (lettersView != null) { lettersView.setText(resources.getString(letterIds[i])); + if (buttonIds[i] == R.id.zero) { + lettersView.setTextSize(TypedValue.COMPLEX_UNIT_PX, resources.getDimension( + R.dimen.dialpad_key_plus_size)); + } } } diff --git a/src/com/android/dialer/dialpad/DialpadKeyButton.java b/src/com/android/dialer/dialpad/DialpadKeyButton.java index 9aae631a5..9a20993d6 100644 --- a/src/com/android/dialer/dialpad/DialpadKeyButton.java +++ b/src/com/android/dialer/dialpad/DialpadKeyButton.java @@ -25,7 +25,7 @@ import android.view.View; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; -import android.widget.RelativeLayout; +import android.widget.FrameLayout; /** * Custom class for dialpad buttons. @@ -33,7 +33,7 @@ import android.widget.RelativeLayout; * This class implements lift-to-type interaction when touch exploration is * enabled. */ -public class DialpadKeyButton extends RelativeLayout { +public class DialpadKeyButton extends FrameLayout { /** Accessibility manager instance used to check touch exploration state. */ private AccessibilityManager mAccessibilityManager; |