summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorzhu youhua <youhua@codeaurora.org>2015-08-07 11:02:41 +0800
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:22:32 -0600
commitc5feab282fde67e2a55777a67df7e3bb32ff31dd (patch)
treeaf65a4742328ffd0a07e5efd74b74291acdbe87e /src
parentfa9cbae4e7e790d62c7fe68d7f7d52b5ccc17883 (diff)
downloadandroid_packages_apps_PhoneCommon-c5feab282fde67e2a55777a67df7e3bb32ff31dd.tar.gz
android_packages_apps_PhoneCommon-c5feab282fde67e2a55777a67df7e3bb32ff31dd.tar.bz2
android_packages_apps_PhoneCommon-c5feab282fde67e2a55777a67df7e3bb32ff31dd.zip
add labels view in dialpad key for multi language
- adjust the dialpad key's layout to display both multi language and default English character Change-Id: I8fae739854d6b533abe947a2a7ec293d0e83b389
Diffstat (limited to 'src')
-rw-r--r--src/com/android/phone/common/dialpad/DialpadView.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/phone/common/dialpad/DialpadView.java b/src/com/android/phone/common/dialpad/DialpadView.java
index 43bbeca..938379d 100644
--- a/src/com/android/phone/common/dialpad/DialpadView.java
+++ b/src/com/android/phone/common/dialpad/DialpadView.java
@@ -131,11 +131,18 @@ public class DialpadView extends LinearLayout {
R.string.dialpad_8_letters, R.string.dialpad_9_letters,
R.string.dialpad_star_letters, R.string.dialpad_pound_letters};
+ final int[] labelIds = new int[] {R.string.dialpad_0_labels, R.string.dialpad_1_labels,
+ R.string.dialpad_2_labels, R.string.dialpad_3_labels, R.string.dialpad_4_labels,
+ R.string.dialpad_5_labels, R.string.dialpad_6_labels, R.string.dialpad_7_labels,
+ R.string.dialpad_8_labels, R.string.dialpad_9_labels,
+ R.string.dialpad_star_labels, R.string.dialpad_pound_labels};
+
final Resources resources = getContext().getResources();
DialpadKeyButton dialpadKey;
TextView numberView;
TextView lettersView;
+ TextView labelsView;
final Locale currentLocale = resources.getConfiguration().locale;
final NumberFormat nf;
@@ -151,6 +158,7 @@ public class DialpadView extends LinearLayout {
dialpadKey = (DialpadKeyButton) findViewById(mButtonIds[i]);
numberView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_number);
lettersView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_letters);
+ labelsView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_labels);
final String numberString;
final String numberContentDescription;
@@ -184,6 +192,15 @@ public class DialpadView extends LinearLayout {
if (lettersView != null) {
lettersView.setText(resources.getString(letterIds[i]));
}
+ if (labelsView != null) {
+ String label = resources.getString(labelIds[i]);
+ if (!TextUtils.isEmpty(label)) {
+ labelsView.setVisibility(View.VISIBLE);
+ labelsView.setText(label);
+ } else {
+ labelsView.setVisibility(View.GONE);
+ }
+ }
}
final DialpadKeyButton one = (DialpadKeyButton) findViewById(R.id.one);