diff options
| author | zhu youhua <youhua@codeaurora.org> | 2015-08-07 11:02:41 +0800 |
|---|---|---|
| committer | Michael Bestas <mkbestas@lineageos.org> | 2017-10-18 15:11:35 +0000 |
| commit | c6019b59bd631df6386185a8877c1b237249dbfa (patch) | |
| tree | c843af6d0c3e0762c2ec578e1b6ddde4bec18211 | |
| parent | 1cb92e0bf7b103dae4f9528a1b18f2e88f8b572e (diff) | |
| download | packages_apps_PhoneCommon-c6019b59bd631df6386185a8877c1b237249dbfa.tar.gz packages_apps_PhoneCommon-c6019b59bd631df6386185a8877c1b237249dbfa.tar.bz2 packages_apps_PhoneCommon-c6019b59bd631df6386185a8877c1b237249dbfa.zip | |
Squashed support for multilanguage T9 dialer (2/2)
* Squash of the following:
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
Refactor dialpad layout to support t9 search in multiple languages
* Moves t9 labels to the side in portrait mode to make room for secondary labels
* Adds resources for alternate language t9 labels
Change-Id: Ie9b12afc6b1b74cc9dea48f10ab663e16b06501b
Add Ukrainian T9 symbol map
Ref CYNGNOS-2188
Change-Id: I5d094e46e46762cd185683a9c09f59321eac4b66
Fix build as a result of incomplete cherry-pick
Change-Id: I90c3202a15ba6127964756ef1785c09196656bb7
Change-Id: I53674f3445ad4a39fdae76cd1afc4d8d27241b36
26 files changed, 356 insertions, 332 deletions
diff --git a/res/layout-land/dialpad_key.xml b/res/layout-land/dialpad_key.xml deleted file mode 100644 index 8342ba0..0000000 --- a/res/layout-land/dialpad_key.xml +++ /dev/null @@ -1,43 +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_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 fd4291b..0000000 --- a/res/layout-land/dialpad_key_one.xml +++ /dev/null @@ -1,44 +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" /> - <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 d5f47a4..483874d 100644 --- a/res/layout/dialpad_key.xml +++ b/res/layout/dialpad_key.xml @@ -24,12 +24,26 @@ <!-- 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" /> <TextView - android:id="@+id/dialpad_key_letters" + android:id="@+id/dialpad_key_labels" 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 6c6f199..235db82 100644 --- a/res/layout/dialpad_key_one.xml +++ b/res/layout/dialpad_key_one.xml @@ -19,9 +19,12 @@ style="@style/DialpadKeyButtonStyle"> <LinearLayout style="@style/DialpadKeyInternalLayoutStyle"> - <com.android.phone.common.dialpad.DialpadTextView + <TextView android:id="@+id/dialpad_key_number" style="@style/DialpadKeyNumberStyle" /> + <TextView + android:id="@+id/dialpad_key_labels" + style="@style/DialpadKeyLettersStyle" /> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" > 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 42d22f6..4f19bfa 100644 --- a/res/values-land/dimens.xml +++ b/res/values-land/dimens.xml @@ -20,7 +20,6 @@ <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> <!-- The bottom space of the dialpad to account for the dial button --> <dimen name="dialpad_bottom_space_height">65dp</dimen> 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-uk/cm_extra.xml b/res/values-uk/cm_extra.xml new file mode 100644 index 0000000..8ad68b2 --- /dev/null +++ b/res/values-uk/cm_extra.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2015 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 adaef0a..29236f3 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> <dimen name="dialpad_key_plus_size">18sp</dimen> <dimen name="dialpad_horizontal_padding">5dp</dimen> <dimen name="dialpad_digits_text_size">34sp</dimen> diff --git a/res/values/qtistrings.xml b/res/values/qtistrings.xml index 5cf743c..92fcc74 100644 --- a/res/values/qtistrings.xml +++ b/res/values/qtistrings.xml @@ -124,4 +124,30 @@ <string name="callFailed_interworking_unspecified">Interworking, unspecified</string> <!-- Text for CallFailCause.NON_SELECTED_USER_CLEARING = 26 --> <string name="callFailed_non_selected_user_clearing">Non selected user clearing</string> + + <!-- Do not translate. --> + <string name="dialpad_0_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_1_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_2_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_3_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_4_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_5_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_6_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_7_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_8_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_9_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_star_labels"></string> + <!-- Do not translate. --> + <string name="dialpad_pound_labels"></string> + </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 8eee67d..e742e25 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> @@ -80,9 +79,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 ed4ec83..4cb33ab 100644 --- a/src/com/android/phone/common/dialpad/DialpadView.java +++ b/src/com/android/phone/common/dialpad/DialpadView.java @@ -30,6 +30,7 @@ import android.text.TextUtils; import android.text.style.TtsSpan; import android.util.AttributeSet; import android.util.Log; +import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; @@ -42,6 +43,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; @@ -128,6 +130,10 @@ public class DialpadView extends LinearLayout { } } + public void refreshKeypad() { + setupKeypad(); + } + private void setupKeypad() { final int[] letterIds = new int[] { R.string.dialpad_0_letters, @@ -144,11 +150,28 @@ public class DialpadView extends LinearLayout { R.string.dialpad_pound_letters }; - final Resources resources = getContext().getResources(); + 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 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; final NumberFormat nf; @@ -164,6 +187,8 @@ 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); + letters2View = (TextView) dialpadKey.findViewById(R.id.dialpad_key2_letters); + labelsView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_labels); final String numberString; final CharSequence numberContentDescription; @@ -203,6 +228,34 @@ 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); + } + } + + 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); @@ -450,4 +503,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(); + } } diff --git a/src/com/android/phone/common/util/SettingsUtil.java b/src/com/android/phone/common/util/SettingsUtil.java index c297e1e..9be36d7 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,9 @@ public class SettingsUtil { } handler.sendMessage(handler.obtainMessage(msg, summary)); } + + public static Locale getT9SearchInputLocale(Context context) { + // Use system locale by default + return context.getResources().getConfiguration().locale; + } } |
