From bd03600f8403816a1225bc8208da133896ab22b4 Mon Sep 17 00:00:00 2001 From: linyuh Date: Tue, 31 Oct 2017 10:29:45 -0700 Subject: Use DialpadTextView instead of TextView to show letters under each digit key. Bug: 30215380 Test: Manual PiperOrigin-RevId: 174055180 Change-Id: Iac6deb8f9dcb6f3e9da6dfd0d732f29cc34bb7f6 --- java/com/android/dialer/dialpadview/DialpadView.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'java/com/android/dialer/dialpadview/DialpadView.java') diff --git a/java/com/android/dialer/dialpadview/DialpadView.java b/java/com/android/dialer/dialpadview/DialpadView.java index d70b0a6c2..5e79cb59f 100644 --- a/java/com/android/dialer/dialpadview/DialpadView.java +++ b/java/com/android/dialer/dialpadview/DialpadView.java @@ -223,29 +223,32 @@ public class DialpadView extends LinearLayout { if (mIsLandscape) { adjustKeyWidths(); } else { - adjustKeyHeightsInFirstRow(); + adjustDigitKeyHeights(); } } } /** - * Adjust key heights in the first row. + * Make the heights of all digit keys the same. * - *

A voice mail icon is shown under key "1", which makes its height different from other keys - * in the first row. + *

When the device is in portrait mode, we first find the maximum height among digit key + * layouts. Then for each key, we adjust the height of the layout containing letters/the voice + * mail icon to ensure the height of each digit key is the same. * *

This method should be called after the sizes of related layouts have been calculated by the * framework. */ - private void adjustKeyHeightsInFirstRow() { + private void adjustDigitKeyHeights() { + Assert.checkState(!mIsLandscape); + int maxHeight = 0; - for (int i = 1; i <= 3; i++) { + for (int i = 0; i <= 9; i++) { DialpadKeyButton dialpadKey = (DialpadKeyButton) findViewById(BUTTON_IDS[i]); LinearLayout keyLayout = (LinearLayout) dialpadKey.findViewById(R.id.dialpad_key_layout); maxHeight = Math.max(maxHeight, keyLayout.getHeight()); } - for (int i = 1; i <= 3; i++) { + for (int i = 0; i <= 9; i++) { DialpadKeyButton dialpadKey = (DialpadKeyButton) findViewById(BUTTON_IDS[i]); LinearLayout keyLayout = (LinearLayout) dialpadKey.findViewById(R.id.dialpad_key_layout); -- cgit v1.2.3