diff options
24 files changed, 291 insertions, 337 deletions
diff --git a/res/layout-land/dialpad_key.xml b/res/layout-land/dialpad_key.xml deleted file mode 100644 index 29e6bf1..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|bottom" /> - </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 bfbbdf9..0000000 --- a/res/layout-land/dialpad_key_one.xml +++ /dev/null @@ -1,45 +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|bottom" > - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingTop="@dimen/dialpad_voicemail_icon_padding_top" - 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..ccf04b9 100644 --- a/res/layout/dialpad_key.xml +++ b/res/layout/dialpad_key.xml @@ -24,12 +24,19 @@ <!-- 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" - 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 5a9d13f..4a15453 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" /> <RelativeLayout 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 07f4998..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">@color/dialpad_primary_text_color</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">@color/dialpad_secondary_text_color</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 0dc916e..56981f0 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -21,10 +21,6 @@ <dimen name="dialpad_key_pound_size">23sp</dimen> <dimen name="dialpad_key_star_size">36sp</dimen> <dimen name="dialpad_key_height">64dp</dimen> - <dimen name="dialpad_key_number_margin_bottom">3dp</dimen> - <!-- Zero key should have less space between self and text because "+" is smaller --> - <dimen name="dialpad_zero_key_number_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 df649d6..620b301 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"> + <style name="DialpadKeySpecialCharStyle"> <item name="android:textColor">@color/dialpad_secondary_text_color</item> - <item name="android:textSize">@dimen/dialpad_key_star_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="DialpadKeyPoundStyle"> - <item name="android:textColor">@color/dialpad_secondary_text_color</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,8 +83,23 @@ <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> </resources> 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 3cdc30e..020ad2b 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.ViewPropertyAnimator; @@ -36,6 +37,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.util.Locale; @@ -106,6 +108,10 @@ public class DialpadView extends LinearLayout { mOverflowMenuButton = findViewById(R.id.dialpad_overflow); } + public void refreshKeypad() { + setupKeypad(); + } + private void setupKeypad() { final int[] numberIds = new int[] {R.string.dialpad_0_number, R.string.dialpad_1_number, R.string.dialpad_2_number, R.string.dialpad_3_number, R.string.dialpad_4_number, @@ -119,16 +125,27 @@ 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 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; for (int i = 0; i < mButtonIds.length; i++) { 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); final String numberString = resources.getString(numberIds[i]); final RippleDrawable rippleBackground = (RippleDrawable) getContext().getDrawable(R.drawable.btn_dialpad_key); @@ -144,6 +161,25 @@ public class DialpadView extends LinearLayout { if (lettersView != null) { lettersView.setText(resources.getString(letterIds[i])); } + + 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); @@ -372,4 +408,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 4ece9ec..afb03c8 100644 --- a/src/com/android/phone/common/util/SettingsUtil.java +++ b/src/com/android/phone/common/util/SettingsUtil.java @@ -34,6 +34,7 @@ import com.android.phone.common.R; import java.lang.CharSequence; import java.lang.String; +import java.util.Locale; public class SettingsUtil { /** @@ -172,4 +173,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; + } } |