summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/dialpadview/DialpadView.java
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2017-10-31 10:29:45 -0700
committerzachh <zachh@google.com>2017-11-01 21:58:48 +0000
commitbd03600f8403816a1225bc8208da133896ab22b4 (patch)
treea90a38f8cafd7a1f5a2604eb3750976ca0c81cda /java/com/android/dialer/dialpadview/DialpadView.java
parent1d1ac5b5a783e06ecda0adceda7df0af8a5566bc (diff)
Use DialpadTextView instead of TextView to show letters under each digit key.
Bug: 30215380 Test: Manual PiperOrigin-RevId: 174055180 Change-Id: Iac6deb8f9dcb6f3e9da6dfd0d732f29cc34bb7f6
Diffstat (limited to 'java/com/android/dialer/dialpadview/DialpadView.java')
-rw-r--r--java/com/android/dialer/dialpadview/DialpadView.java17
1 files changed, 10 insertions, 7 deletions
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.
*
- * <p>A voice mail icon is shown under key "1", which makes its height different from other keys
- * in the first row.
+ * <p>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.
*
* <p>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);