summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout-land/dialpad_key.xml49
-rw-r--r--res/layout-land/dialpad_key_one.xml49
-rw-r--r--res/layout-land/dialpad_key_pound.xml33
-rw-r--r--res/layout-land/dialpad_key_star.xml33
-rw-r--r--res/layout-land/dialpad_key_zero.xml43
-rw-r--r--res/layout/dialpad_key.xml17
-rw-r--r--res/layout/dialpad_key_one.xml2
-rw-r--r--res/layout/dialpad_key_pound.xml4
-rw-r--r--res/layout/dialpad_key_star.xml4
-rw-r--r--res/layout/dialpad_key_zero.xml4
-rw-r--r--res/values-el/cm_extra.xml26
-rw-r--r--res/values-iw/cm_extra.xml26
-rw-r--r--res/values-ko/cm_extra.xml26
-rw-r--r--res/values-land/cm_dimens.xml19
-rw-r--r--res/values-land/dimens.xml1
-rw-r--r--res/values-land/styles.xml36
-rw-r--r--res/values-ru/cm_extra.xml27
-rw-r--r--res/values/cm_dimens.xml21
-rw-r--r--res/values/cm_extra.xml34
-rw-r--r--res/values/dimens.xml1
-rw-r--r--res/values/styles.xml46
-rw-r--r--src/com/android/phone/common/dialpad/DialpadTextView.java72
-rw-r--r--src/com/android/phone/common/dialpad/DialpadView.java47
-rw-r--r--src/com/android/phone/common/util/SettingsUtil.java20
24 files changed, 294 insertions, 346 deletions
diff --git a/res/layout-land/dialpad_key.xml b/res/layout-land/dialpad_key.xml
deleted file mode 100644
index 2b292e8..0000000
--- a/res/layout-land/dialpad_key.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- A layout representing a single key in the dialpad -->
-<com.android.phone.common.dialpad.DialpadKeyButton
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/DialpadKeyButtonStyle" >
-
- <LinearLayout style="@style/DialpadKeyInternalLayoutStyle"
- android:orientation="horizontal"
- android:baselineAligned="false"
- android:layout_gravity="right|center_vertical" >
-
- <!-- Note in the referenced styles that we assign hard widths to these components
- because we want them to line up vertically when we arrange them in an MxN grid -->
-
- <com.android.phone.common.dialpad.DialpadTextView
- android:id="@+id/dialpad_key_number"
- style="@style/DialpadKeyNumberStyle"
- android:layout_gravity="right"
- android:layout_marginBottom="0dp"
- android:layout_marginRight="@dimen/dialpad_key_margin_right" />
-
- <TextView
- android:id="@+id/dialpad_key_labels"
- style="@style/DialpadKeyLettersStyle"
- android:layout_width="@dimen/dialpad_key_text_width"
- android:layout_gravity="right|bottom" />
-
- <TextView
- android:id="@+id/dialpad_key_letters"
- style="@style/DialpadKeyLettersStyle"
- android:layout_width="@dimen/dialpad_key_text_width"
- android:layout_gravity="right|center" />
- </LinearLayout>
-</com.android.phone.common.dialpad.DialpadKeyButton>
diff --git a/res/layout-land/dialpad_key_one.xml b/res/layout-land/dialpad_key_one.xml
deleted file mode 100644
index 1006e3f..0000000
--- a/res/layout-land/dialpad_key_one.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<com.android.phone.common.dialpad.DialpadKeyButton
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/one"
- style="@style/DialpadKeyButtonStyle">
- <LinearLayout
- style="@style/DialpadKeyInternalLayoutStyle"
- android:orientation="horizontal"
- android:baselineAligned="false"
- android:layout_gravity="right|center_vertical" >
- <com.android.phone.common.dialpad.DialpadTextView
- android:id="@+id/dialpad_key_number"
- style="@style/DialpadKeyNumberStyle"
- android:layout_gravity="right"
- android:layout_marginBottom="0dp"
- android:layout_marginRight="@dimen/dialpad_key_one_margin_right" />
- <TextView
- android:id="@+id/dialpad_key_labels"
- style="@style/DialpadKeyLettersStyle"
- android:layout_width="@dimen/dialpad_key_text_width"
- android:layout_gravity="right|bottom" />
- <FrameLayout
- android:layout_width="@dimen/dialpad_key_text_width"
- android:layout_height="wrap_content"
- android:layout_gravity="left|center" >
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/dialpad_key_voicemail"
- android:src="@drawable/ic_dialpad_voicemail"
- android:scaleType="fitCenter"
- android:tint="@color/dialpad_voicemail_tint" />
- </FrameLayout>
- </LinearLayout>
-</com.android.phone.common.dialpad.DialpadKeyButton>
diff --git a/res/layout-land/dialpad_key_pound.xml b/res/layout-land/dialpad_key_pound.xml
deleted file mode 100644
index 73321af..0000000
--- a/res/layout-land/dialpad_key_pound.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<com.android.phone.common.dialpad.DialpadKeyButton
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/pound"
- style="@style/DialpadKeyButtonStyle">
- <LinearLayout
- android:orientation="horizontal"
- android:layout_gravity="center_vertical|right"
- style="@style/DialpadKeyInternalLayoutStyle" >
- <com.android.phone.common.dialpad.DialpadTextView
- android:id="@id/dialpad_key_number"
- android:layout_width="@dimen/dialpad_key_number_width"
- android:layout_marginRight="@dimen/dialpad_key_margin_right"
- style="@style/DialpadKeyPoundStyle" />
- <View
- android:layout_width="@dimen/dialpad_key_text_width"
- style="@style/DialpadKeyLettersStyle" />
- </LinearLayout>
-</com.android.phone.common.dialpad.DialpadKeyButton>
diff --git a/res/layout-land/dialpad_key_star.xml b/res/layout-land/dialpad_key_star.xml
deleted file mode 100644
index 33e11b7..0000000
--- a/res/layout-land/dialpad_key_star.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<com.android.phone.common.dialpad.DialpadKeyButton
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/star"
- style="@style/DialpadKeyButtonStyle">
- <LinearLayout
- android:orientation="horizontal"
- android:layout_gravity="center_vertical|right"
- style="@style/DialpadKeyInternalLayoutStyle" >
- <com.android.phone.common.dialpad.DialpadTextView
- android:id="@id/dialpad_key_number"
- android:layout_width="@dimen/dialpad_key_number_width"
- android:layout_marginRight="@dimen/dialpad_key_margin_right"
- style="@style/DialpadKeyStarStyle" />
- <View
- android:layout_width="@dimen/dialpad_key_text_width"
- style="@style/DialpadKeyLettersStyle" />
- </LinearLayout>
-</com.android.phone.common.dialpad.DialpadKeyButton>
diff --git a/res/layout-land/dialpad_key_zero.xml b/res/layout-land/dialpad_key_zero.xml
deleted file mode 100644
index d5fcc18..0000000
--- a/res/layout-land/dialpad_key_zero.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- A layout representing the zero key in the dialpad, with the plus sign shifted up because it is
- smaller than a regular letter -->
-<com.android.phone.common.dialpad.DialpadKeyButton
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/zero"
- style="@style/DialpadKeyButtonStyle" >
-
- <LinearLayout style="@style/DialpadKeyInternalLayoutStyle"
- android:orientation="horizontal"
- android:baselineAligned="false"
- android:layout_gravity="right|center_vertical">
-
- <!-- Note in the referenced styles that we assign hard widths to these components
- because we want them to line up vertically when we arrange them in an MxN grid -->
-
- <com.android.phone.common.dialpad.DialpadTextView
- android:id="@+id/dialpad_key_number"
- android:layout_marginRight="@dimen/dialpad_key_margin_right"
- android:layout_marginBottom="0dp"
- style="@style/DialpadBottomKeyNumberStyle" />
-
- <TextView
- android:id="@+id/dialpad_key_letters"
- android:layout_width="@dimen/dialpad_key_text_width"
- style="@style/DialpadKeyLettersStyle" />
- </LinearLayout>
-</com.android.phone.common.dialpad.DialpadKeyButton>
diff --git a/res/layout/dialpad_key.xml b/res/layout/dialpad_key.xml
index fa5aed4..483874d 100644
--- a/res/layout/dialpad_key.xml
+++ b/res/layout/dialpad_key.xml
@@ -24,7 +24,7 @@
<!-- Note in the referenced styles that we assign hard widths to these components
because we want them to line up vertically when we arrange them in an MxN grid -->
- <com.android.phone.common.dialpad.DialpadTextView
+ <TextView
android:id="@+id/dialpad_key_number"
style="@style/DialpadKeyNumberStyle" />
@@ -32,9 +32,18 @@
android:id="@+id/dialpad_key_labels"
style="@style/DialpadKeyLettersStyle" />
- <TextView
- android:id="@+id/dialpad_key_letters"
- style="@style/DialpadKeyLettersStyle" />
+ <LinearLayout
+ style="@style/DialpadKeyLetterLayoutStyle">
+
+ <TextView
+ android:id="@+id/dialpad_key2_letters"
+ style="@style/DialpadKeyLettersStyle" />
+
+ <TextView
+ android:id="@+id/dialpad_key_letters"
+ style="@style/DialpadKeyLettersStyle" />
+
+ </LinearLayout>
</LinearLayout>
</com.android.phone.common.dialpad.DialpadKeyButton>
diff --git a/res/layout/dialpad_key_one.xml b/res/layout/dialpad_key_one.xml
index 58a41ab..235db82 100644
--- a/res/layout/dialpad_key_one.xml
+++ b/res/layout/dialpad_key_one.xml
@@ -19,7 +19,7 @@
style="@style/DialpadKeyButtonStyle">
<LinearLayout
style="@style/DialpadKeyInternalLayoutStyle">
- <com.android.phone.common.dialpad.DialpadTextView
+ <TextView
android:id="@+id/dialpad_key_number"
style="@style/DialpadKeyNumberStyle" />
<TextView
diff --git a/res/layout/dialpad_key_pound.xml b/res/layout/dialpad_key_pound.xml
index fd90b88..3294918 100644
--- a/res/layout/dialpad_key_pound.xml
+++ b/res/layout/dialpad_key_pound.xml
@@ -18,8 +18,8 @@
android:id="@+id/pound"
style="@style/DialpadKeyButtonStyle">
<LinearLayout
- style="@style/DialpadKeyInternalLayoutStyle" >
- <com.android.phone.common.dialpad.DialpadTextView
+ style="@style/SpecialCharInternalLayoutStyle" >
+ <TextView
android:id="@id/dialpad_key_number"
style="@style/DialpadKeyPoundStyle"/>
</LinearLayout>
diff --git a/res/layout/dialpad_key_star.xml b/res/layout/dialpad_key_star.xml
index d84e156..88adef5 100644
--- a/res/layout/dialpad_key_star.xml
+++ b/res/layout/dialpad_key_star.xml
@@ -18,8 +18,8 @@
android:id="@+id/star"
style="@style/DialpadKeyButtonStyle">
<LinearLayout
- style="@style/DialpadKeyInternalLayoutStyle" >
- <com.android.phone.common.dialpad.DialpadTextView
+ style="@style/SpecialCharInternalLayoutStyle" >
+ <TextView
android:id="@+id/dialpad_key_number"
style="@style/DialpadKeyStarStyle" />
</LinearLayout>
diff --git a/res/layout/dialpad_key_zero.xml b/res/layout/dialpad_key_zero.xml
index 11805f1..e37a14d 100644
--- a/res/layout/dialpad_key_zero.xml
+++ b/res/layout/dialpad_key_zero.xml
@@ -26,12 +26,12 @@
<!-- Note in the referenced styles that we assign hard widths to these components
because we want them to line up vertically when we arrange them in an MxN grid -->
- <com.android.phone.common.dialpad.DialpadTextView
+ <TextView
android:id="@+id/dialpad_key_number"
style="@style/DialpadBottomKeyNumberStyle" />
<TextView
android:id="@+id/dialpad_key_letters"
- style="@style/DialpadKeyLettersStyle" />
+ style="@style/DialpadKeyPlusStyle" />
</LinearLayout>
</com.android.phone.common.dialpad.DialpadKeyButton>
diff --git a/res/values-el/cm_extra.xml b/res/values-el/cm_extra.xml
new file mode 100644
index 0000000..b947305
--- /dev/null
+++ b/res/values-el/cm_extra.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013-2014 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="dialpad_2_2_letters">ΑΒΓ</string>
+ <string name="dialpad_3_2_letters">ΔΕΖ</string>
+ <string name="dialpad_4_2_letters">ΗΘΙ</string>
+ <string name="dialpad_5_2_letters">ΚΛΜ</string>
+ <string name="dialpad_6_2_letters">ΝΞΟ</string>
+ <string name="dialpad_7_2_letters">ΠΡΣ</string>
+ <string name="dialpad_8_2_letters">ΤΥΦ</string>
+ <string name="dialpad_9_2_letters">ΧΨΩ</string>
+</resources>
diff --git a/res/values-iw/cm_extra.xml b/res/values-iw/cm_extra.xml
new file mode 100644
index 0000000..1d3b228
--- /dev/null
+++ b/res/values-iw/cm_extra.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2012-2014 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="dialpad_2_2_letters">דהו</string>
+ <string name="dialpad_3_2_letters">אבג</string>
+ <string name="dialpad_4_2_letters">מנ</string>
+ <string name="dialpad_5_2_letters">יכל</string>
+ <string name="dialpad_6_2_letters">זחט</string>
+ <string name="dialpad_7_2_letters">רשת</string>
+ <string name="dialpad_8_2_letters">צק</string>
+ <string name="dialpad_9_2_letters">סעפ</string>
+</resources>
diff --git a/res/values-ko/cm_extra.xml b/res/values-ko/cm_extra.xml
new file mode 100644
index 0000000..bb328d4
--- /dev/null
+++ b/res/values-ko/cm_extra.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <string name="dialpad_2_2_letters">ㅇㅁ</string>
+ <string name="dialpad_3_2_letters"></string>
+ <string name="dialpad_4_2_letters">ㄱㅋㄲ</string>
+ <string name="dialpad_5_2_letters">ㄴㄹ</string>
+ <string name="dialpad_6_2_letters">ㄷㅌㄸ</string>
+ <string name="dialpad_7_2_letters">ㅂㅍㅃ</string>
+ <string name="dialpad_8_2_letters">ㅅㅎㅆ</string>
+ <string name="dialpad_9_2_letters">ㅈㅊㅉ</string>
+</resources>
diff --git a/res/values-land/cm_dimens.xml b/res/values-land/cm_dimens.xml
new file mode 100644
index 0000000..0e96cec
--- /dev/null
+++ b/res/values-land/cm_dimens.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <dimen name="dialpad_key_number_left_margin">20dp</dimen>
+</resources> \ No newline at end of file
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index e82d1fa..5cb0db5 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -20,5 +20,4 @@
<dimen name="dialpad_key_one_margin_right">3dp</dimen>
<dimen name="dialpad_key_text_width">35dp</dimen>
<dimen name="dialpad_key_number_width">20sp</dimen>
- <dimen name="dialpad_symbol_margin_bottom">0dp</dimen>
</resources>
diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml
deleted file mode 100644
index 24d6f27..0000000
--- a/res/values-land/styles.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2014 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License
- -->
-
-<resources>
- <style name="DialpadKeyNumberStyle">
- <item name="android:textColor">?attr/dialpad_text_color_primary</item>
- <item name="android:textSize">@dimen/dialpad_key_numbers_size</item>
- <item name="android:fontFamily">sans-serif-light</item>
- <item name="android:layout_width">@dimen/dialpad_key_number_width</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_marginBottom">@dimen/dialpad_key_number_margin_bottom</item>
- </style>
-
- <style name="DialpadKeyLettersStyle">
- <item name="android:textColor">?attr/dialpad_text_color_secondary</item>
- <item name="android:textSize">@dimen/dialpad_key_letters_size</item>
- <item name="android:fontFamily">sans-serif-regular</item>
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:gravity">left</item>
- </style>
-</resources>
diff --git a/res/values-ru/cm_extra.xml b/res/values-ru/cm_extra.xml
new file mode 100644
index 0000000..90da55b
--- /dev/null
+++ b/res/values-ru/cm_extra.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="dialpad_2_2_letters">АБВГ</string>
+ <string name="dialpad_3_2_letters">ДЕЖЗ</string>
+ <string name="dialpad_4_2_letters">ИЙКЛ</string>
+ <string name="dialpad_5_2_letters">МНОП</string>
+ <string name="dialpad_6_2_letters">РСТУ</string>
+ <string name="dialpad_7_2_letters">ФХЦЧ</string>
+ <string name="dialpad_8_2_letters">ШЩЪЫ</string>
+ <string name="dialpad_9_2_letters">ЬЭЮЯ</string>
+</resources>
+
diff --git a/res/values/cm_dimens.xml b/res/values/cm_dimens.xml
new file mode 100644
index 0000000..eec63b9
--- /dev/null
+++ b/res/values/cm_dimens.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <dimen name="dialpad_key_letters_small_size">10sp</dimen>
+ <dimen name="dialpad_key_margin_right">9dp</dimen>
+ <dimen name="dialpad_key_number_left_margin">26dp</dimen>
+</resources> \ No newline at end of file
diff --git a/res/values/cm_extra.xml b/res/values/cm_extra.xml
new file mode 100644
index 0000000..3c4adf8
--- /dev/null
+++ b/res/values/cm_extra.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013-2014 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Localized dialer buttons.
+ In English, we don't need a secondary row, so all values are empty.
+ Change these values depending on your language requirements.
+ -->
+ <string name="dialpad_0_2_letters" translatable="false"></string>
+ <string name="dialpad_1_2_letters" translatable="false"></string>
+ <string name="dialpad_2_2_letters"></string>
+ <string name="dialpad_3_2_letters"></string>
+ <string name="dialpad_4_2_letters"></string>
+ <string name="dialpad_5_2_letters"></string>
+ <string name="dialpad_6_2_letters"></string>
+ <string name="dialpad_7_2_letters"></string>
+ <string name="dialpad_8_2_letters"></string>
+ <string name="dialpad_9_2_letters"></string>
+ <string name="dialpad_star_2_letters" translatable="false"></string>
+ <string name="dialpad_pound_2_letters" translatable="false"></string>
+</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 0c342ba..86b96ef 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -27,7 +27,6 @@
<!-- Zero key should have less space between self and text because "+" is smaller -->
<dimen name="dialpad_zero_key_number_margin_bottom">@dimen/dialpad_zero_key_number_default_margin_bottom</dimen>
<dimen name="dialpad_zero_key_number_default_margin_bottom">1dp</dimen>
- <dimen name="dialpad_symbol_margin_bottom">13dp</dimen>
<!-- The bottom row of the dialpad is slightly taller to account for the dial button -->
<dimen name="dialpad_bottom_key_height">65dp</dimen>
<dimen name="dialpad_key_plus_size">18sp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index b563705..1a00cd1 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -27,34 +27,28 @@
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_marginBottom">@dimen/dialpad_key_number_margin_bottom</item>
+ <item name="android:layout_marginRight">@dimen/dialpad_key_margin_right</item>
<item name="android:gravity">center</item>
+ <item name="android:layout_gravity">center_vertical</item>
</style>
- <style name="DialpadBottomKeyNumberStyle" parent="DialpadKeyNumberStyle">
- <item name="android:layout_marginBottom">@dimen/dialpad_zero_key_number_margin_bottom</item>
- </style>
+ <style name="DialpadBottomKeyNumberStyle" parent="DialpadKeyNumberStyle"/>
- <style name="DialpadKeyStarStyle">
- <item name="android:textColor">?attr/dialpad_text_color_secondary</item>
- <item name="android:textSize">@dimen/dialpad_key_star_size</item>
+ <style name="DialpadKeySpecialCharStyle">
+ <item name="android:textColor">@color/dialpad_secondary_text_color</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:alpha">0.8</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_marginBottom">@dimen/dialpad_symbol_margin_bottom</item>
<item name="android:gravity">center</item>
</style>
- <style name="DialpadKeyPoundStyle">
- <item name="android:textColor">?attr/dialpad_text_color_secondary</item>
+ <style name="DialpadKeyPoundStyle" parent="DialpadKeySpecialCharStyle">
<item name="android:textSize">@dimen/dialpad_key_pound_size</item>
- <item name="android:fontFamily">sans-serif-light</item>
- <item name="android:alpha">0.8</item>
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_marginBottom">@dimen/dialpad_symbol_margin_bottom</item>
- <item name="android:gravity">center</item>
+ </style>
+
+ <style name="DialpadKeyStarStyle" parent="DialpadKeySpecialCharStyle">
+ <item name="android:textSize">@dimen/dialpad_key_star_size</item>
</style>
<style name="DialpadKeyLettersStyle">
@@ -66,6 +60,11 @@
<item name="android:gravity">center_horizontal</item>
</style>
+ <style name="DialpadKeyPlusStyle" parent="DialpadKeyLettersStyle">
+ <item name="android:textSize">@dimen/dialpad_key_plus_size</item>
+ <item name="android:fontFamily">sans-serif-light</item>
+ </style>
+
<style name="DialpadKeyButtonStyle">
<item name="android:soundEffectsEnabled">false</item>
<item name="android:clickable">true</item>
@@ -84,9 +83,24 @@
<style name="DialpadKeyInternalLayoutStyle">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_gravity">center_vertical</item>
+ <item name="android:gravity">center</item>
+ <item name="android:layout_marginLeft">@dimen/dialpad_key_number_left_margin</item>
+ <item name="android:orientation">horizontal</item>
+ </style>
+
+ <style name="SpecialCharInternalLayoutStyle">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center</item>
+ </style>
+
+ <style name="DialpadKeyLetterLayoutStyle">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
<item name="android:orientation">vertical</item>
+ <item name="android:layout_gravity">center_vertical</item>
</style>
<style name="Dialpad_Light">
diff --git a/src/com/android/phone/common/dialpad/DialpadTextView.java b/src/com/android/phone/common/dialpad/DialpadTextView.java
deleted file mode 100644
index 2802b32..0000000
--- a/src/com/android/phone/common/dialpad/DialpadTextView.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.phone.common.dialpad;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Rect;
-import android.util.AttributeSet;
-import android.widget.TextView;
-
-/**
- * This is a custom text view intended only for rendering the numerals (and star and pound) on the
- * dialpad. TextView has built in top/bottom padding to help account for ascenders/descenders.
- *
- * Since vertical space is at a premium on the dialpad, particularly if the font size is scaled to
- * a larger default, for the dialpad we use this class to more precisely render characters according
- * to the precise amount of space they need.
- */
-public class DialpadTextView extends TextView {
- private Rect mTextBounds = new Rect();
- private String mTextStr;
-
- public DialpadTextView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- /**
- * Draw the text to fit within the height/width which have been specified during measurement.
- */
- @Override
- public void draw(Canvas canvas) {
- Paint paint = getPaint();
-
- // Without this, the draw does not respect the style's specified text color.
- paint.setColor(getCurrentTextColor());
-
- // The text bounds values are relative and can be negative,, so rather than specifying a
- // standard origin such as 0, 0, we need to use negative of the left/top bounds.
- // For example, the bounds may be: Left: 11, Right: 37, Top: -77, Bottom: 0
- canvas.drawText(mTextStr, -mTextBounds.left, -mTextBounds.top, paint);
- }
-
- /**
- * Calculate the pixel-accurate bounds of the text when rendered, and use that to specify the
- * height and width.
- */
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- mTextStr = getText().toString();
- getPaint().getTextBounds(mTextStr, 0, mTextStr.length(), mTextBounds);
-
- int width = resolveSize(mTextBounds.width(), widthMeasureSpec);
- int height = resolveSize(mTextBounds.height(), heightMeasureSpec);
- setMeasuredDimension(width, height);
- }
-}
diff --git a/src/com/android/phone/common/dialpad/DialpadView.java b/src/com/android/phone/common/dialpad/DialpadView.java
index 938379d..3911093 100644
--- a/src/com/android/phone/common/dialpad/DialpadView.java
+++ b/src/com/android/phone/common/dialpad/DialpadView.java
@@ -26,6 +26,7 @@ import android.graphics.drawable.RippleDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
+import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -38,6 +39,7 @@ import android.widget.TextView;
import com.android.phone.common.R;
import com.android.phone.common.animation.AnimUtils;
+import com.android.phone.common.util.SettingsUtil;
import java.text.DecimalFormat;
import java.text.NumberFormat;
@@ -124,6 +126,10 @@ public class DialpadView extends LinearLayout {
}
}
+ public void refreshKeypad() {
+ setupKeypad();
+ }
+
private void setupKeypad() {
final int[] letterIds = new int[] {R.string.dialpad_0_letters, R.string.dialpad_1_letters,
R.string.dialpad_2_letters, R.string.dialpad_3_letters, R.string.dialpad_4_letters,
@@ -137,11 +143,21 @@ public class DialpadView extends LinearLayout {
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();
+ final int[] letter2Ids = new int[] {
+ R.string.dialpad_0_2_letters, R.string.dialpad_1_2_letters,
+ R.string.dialpad_2_2_letters, R.string.dialpad_3_2_letters,
+ R.string.dialpad_4_2_letters, R.string.dialpad_5_2_letters,
+ R.string.dialpad_6_2_letters, R.string.dialpad_7_2_letters,
+ R.string.dialpad_8_2_letters, R.string.dialpad_9_2_letters,
+ R.string.dialpad_star_2_letters, R.string.dialpad_pound_2_letters};
+
+ Locale t9SearchInputLocale = SettingsUtil.getT9SearchInputLocale(getContext());
+ final Resources resources = getResourcesForLocale(t9SearchInputLocale);
DialpadKeyButton dialpadKey;
TextView numberView;
TextView lettersView;
+ TextView letters2View;
TextView labelsView;
final Locale currentLocale = resources.getConfiguration().locale;
@@ -201,6 +217,25 @@ public class DialpadView extends LinearLayout {
labelsView.setVisibility(View.GONE);
}
}
+
+ String secondaryLabel = resources.getString(letter2Ids[i]);
+ if (letters2View != null) {
+ if (!TextUtils.isEmpty(secondaryLabel)) {
+ letters2View.setText(secondaryLabel);
+ letters2View.setVisibility(View.VISIBLE);
+
+ // use smaller text size when both labels are present
+ if (lettersView != null) {
+ float size =
+ resources.getDimension(
+ R.dimen.dialpad_key_letters_small_size);
+ letters2View.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+ lettersView.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
+ }
+ } else {
+ letters2View.setVisibility(View.GONE);
+ }
+ }
}
final DialpadKeyButton one = (DialpadKeyButton) findViewById(R.id.one);
@@ -439,4 +474,12 @@ public class DialpadView extends LinearLayout {
Log.wtf(TAG, "Attempted to get animation duration for invalid key button id.");
return 0;
}
-}
+
+ private Resources getResourcesForLocale(Locale locale) {
+ Configuration defaultConfig = getContext().getResources().getConfiguration();
+ Configuration overrideConfig = new Configuration(defaultConfig);
+ overrideConfig.setLocale(locale);
+ Context localeContext = getContext().createConfigurationContext(overrideConfig);
+ return localeContext.getResources();
+ }
+} \ No newline at end of file
diff --git a/src/com/android/phone/common/util/SettingsUtil.java b/src/com/android/phone/common/util/SettingsUtil.java
index c297e1e..d2fd58b 100644
--- a/src/com/android/phone/common/util/SettingsUtil.java
+++ b/src/com/android/phone/common/util/SettingsUtil.java
@@ -35,6 +35,7 @@ import com.android.phone.common.R;
import java.lang.CharSequence;
import java.lang.String;
+import java.util.Locale;
public class SettingsUtil {
private static final String DEFAULT_NOTIFICATION_URI_STRING =
@@ -100,4 +101,23 @@ public class SettingsUtil {
}
handler.sendMessage(handler.obtainMessage(msg, summary));
}
+
+ public static Locale getT9SearchInputLocale(Context context) {
+ // Use system locale by default
+ Locale locale = context.getResources().getConfiguration().locale;
+
+ // Override with t9 search input locale from settings if provided
+ String overrideLocaleString = android.provider.Settings.System.getString(
+ context.getContentResolver(),
+ android.provider.Settings.System.T9_SEARCH_INPUT_LOCALE);
+ if (overrideLocaleString != null && !overrideLocaleString.isEmpty()) {
+ String[] tokens = overrideLocaleString.split("_");
+ String lang = tokens.length > 0 ? tokens[0] : "";
+ String country = tokens.length > 1 ? tokens[1] : "";
+ String variant = tokens.length > 2 ? tokens[2] : "";
+ locale = new Locale(lang, country, variant);
+ }
+
+ return locale;
+ }
}