Merge "Move Dialpad-related resources to ContactsCommon"
diff --git a/res-common/drawable-hdpi/ic_dial_action_delete.png b/res-common/drawable-hdpi/ic_dial_action_delete.png
new file mode 100644
index 0000000..ebf692a
--- /dev/null
+++ b/res-common/drawable-hdpi/ic_dial_action_delete.png
Binary files differ
diff --git a/res-common/drawable-hdpi/ic_dial_action_vm.png b/res-common/drawable-hdpi/ic_dial_action_vm.png
new file mode 100644
index 0000000..f424304
--- /dev/null
+++ b/res-common/drawable-hdpi/ic_dial_action_vm.png
Binary files differ
diff --git a/res-common/drawable-mdpi/ic_dial_action_delete.png b/res-common/drawable-mdpi/ic_dial_action_delete.png
new file mode 100644
index 0000000..e1394c5
--- /dev/null
+++ b/res-common/drawable-mdpi/ic_dial_action_delete.png
Binary files differ
diff --git a/res-common/drawable-mdpi/ic_dial_action_vm.png b/res-common/drawable-mdpi/ic_dial_action_vm.png
new file mode 100644
index 0000000..fbcf378
--- /dev/null
+++ b/res-common/drawable-mdpi/ic_dial_action_vm.png
Binary files differ
diff --git a/res-common/drawable-xhdpi/ic_dial_action_delete.png b/res-common/drawable-xhdpi/ic_dial_action_delete.png
new file mode 100644
index 0000000..6788669
--- /dev/null
+++ b/res-common/drawable-xhdpi/ic_dial_action_delete.png
Binary files differ
diff --git a/res-common/drawable-xhdpi/ic_dial_action_vm.png b/res-common/drawable-xhdpi/ic_dial_action_vm.png
new file mode 100644
index 0000000..2919bbd
--- /dev/null
+++ b/res-common/drawable-xhdpi/ic_dial_action_vm.png
Binary files differ
diff --git a/res-common/drawable-xxhdpi/ic_dial_action_delete.png b/res-common/drawable-xxhdpi/ic_dial_action_delete.png
new file mode 100644
index 0000000..ca91a72
--- /dev/null
+++ b/res-common/drawable-xxhdpi/ic_dial_action_delete.png
Binary files differ
diff --git a/res-common/drawable-xxhdpi/ic_dial_action_vm.png b/res-common/drawable-xxhdpi/ic_dial_action_vm.png
new file mode 100644
index 0000000..acac8d8
--- /dev/null
+++ b/res-common/drawable-xxhdpi/ic_dial_action_vm.png
Binary files differ
diff --git a/res-common/drawable/dialpad_key_colors.xml b/res-common/drawable/dialpad_key_colors.xml
new file mode 100644
index 0000000..27b4d4f
--- /dev/null
+++ b/res-common/drawable/dialpad_key_colors.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_pressed="true"
+ android:drawable="@color/background_dialpad_pressed" />
+ <item android:drawable="@color/background_dialpad" />
+</selector>
diff --git a/res-common/layout/dialpad.xml b/res-common/layout/dialpad.xml
new file mode 100644
index 0000000..df6f527
--- /dev/null
+++ b/res-common/layout/dialpad.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2006 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.
+-->
+
+<!-- Dialpad in the Phone app. -->
+<TableLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/dialpad"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="5dp"
+ android:paddingRight="5dp"
+ android:stretchColumns="*"
+ android:layoutDirection="ltr" >
+
+ <TableRow>
+ <com.android.dialer.dialpad.DialpadKeyButton
+ android:id="@+id/one"
+ style="@style/DialpadKeyButtonStyle">
+ <LinearLayout
+ style="@style/DialpadKeyInternalLayoutStyle">
+ <TextView
+ android:id="@+id/dialpad_key_number"
+ style="@style/DialpadKeyNumberStyle"/>
+ <ImageView
+ android:id="@+id/dialpad_key_voicemail"
+ style="@style/DialpadKeyLettersStyle"
+ android:src="@drawable/ic_dial_action_vm"
+ android:scaleType="fitStart"
+ android:baselineAlignBottom="true" />
+ </LinearLayout>
+ </com.android.dialer.dialpad.DialpadKeyButton>
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/two"
+ style="@style/DialpadKeyButtonStyle" />
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/three"
+ style="@style/DialpadKeyButtonStyle" />
+ </TableRow>
+
+ <TableRow>
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/four"
+ style="@style/DialpadKeyButtonStyle" />
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/five"
+ style="@style/DialpadKeyButtonStyle" />
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/six"
+ style="@style/DialpadKeyButtonStyle" />
+ </TableRow>
+
+ <TableRow>
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/seven"
+ style="@style/DialpadKeyButtonStyle" />
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/eight"
+ style="@style/DialpadKeyButtonStyle" />
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/nine"
+ style="@style/DialpadKeyButtonStyle" />
+ </TableRow>
+
+ <TableRow>
+ <com.android.dialer.dialpad.DialpadKeyButton
+ android:id="@+id/star"
+ style="@style/DialpadKeyButtonStyle">
+ <LinearLayout
+ style="@style/DialpadKeyInternalLayoutStyle">
+ <TextView
+ android:id="@id/dialpad_key_number"
+ style="@style/DialpadKeyStarPoundStyle" />
+ <View
+ android:layout_height="match_parent"
+ android:layout_width="@dimen/dialpad_key_letters_width" />
+ </LinearLayout>
+ </com.android.dialer.dialpad.DialpadKeyButton>
+ <include layout="@layout/dialpad_key"
+ android:id="@+id/zero"
+ style="@style/DialpadKeyButtonStyle" />
+ <com.android.dialer.dialpad.DialpadKeyButton
+ android:id="@+id/pound"
+ style="@style/DialpadKeyButtonStyle">
+ <LinearLayout
+ style="@style/DialpadKeyInternalLayoutStyle">
+ <TextView
+ android:id="@id/dialpad_key_number"
+ style="@style/DialpadKeyStarPoundStyle" />
+ <View
+ android:layout_height="match_parent"
+ android:layout_width="@dimen/dialpad_key_letters_width" />
+ </LinearLayout>
+ </com.android.dialer.dialpad.DialpadKeyButton>
+ </TableRow>
+
+ <TableRow>
+ <FrameLayout
+ android:id="@+id/dialpad_add_contact"
+ android:contentDescription="@string/description_add_contact"
+ style="@style/DialpadBottomKeyButtonStyle"
+ android:visibility="invisible"
+ >
+ <ImageView
+ android:src="@drawable/ic_add_person_dk"
+ android:importantForAccessibility="no"
+ android:paddingRight="@dimen/dialpad_key_letters_width"
+ style="@style/DialpadKeyInternalLayoutStyle"
+ />
+ </FrameLayout>
+ <Space
+ style="@style/DialpadBottomKeyButtonStyle"
+ />
+ <FrameLayout
+ android:id="@+id/dialpad_overflow"
+ android:contentDescription="@string/description_dialpad_overflow"
+ style="@style/DialpadBottomKeyButtonStyle"
+ >
+ <ImageView
+ android:src="@drawable/ic_overflow_menu"
+ android:importantForAccessibility="no"
+ android:paddingRight="@dimen/dialpad_key_letters_width"
+ style="@style/DialpadKeyInternalLayoutStyle"
+ />
+ </FrameLayout>
+ </TableRow>
+</TableLayout>
diff --git a/res-common/layout/dialpad_key.xml b/res-common/layout/dialpad_key.xml
new file mode 100644
index 0000000..abbe4f9
--- /dev/null
+++ b/res-common/layout/dialpad_key.xml
@@ -0,0 +1,35 @@
+<?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.dialer.dialpad.DialpadKeyButton
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/DialpadKeyButtonStyle" >
+
+ <LinearLayout style="@style/DialpadKeyInternalLayoutStyle">
+
+ <!-- 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 -->
+
+ <TextView
+ android:id="@+id/dialpad_key_number"
+ style="@style/DialpadKeyNumberStyle" />
+
+ <TextView
+ android:id="@+id/dialpad_key_letters"
+ style="@style/DialpadKeyLettersStyle" />
+ </LinearLayout>
+</com.android.dialer.dialpad.DialpadKeyButton>
\ No newline at end of file
diff --git a/res-common/layout/dialpad_view.xml b/res-common/layout/dialpad_view.xml
new file mode 100644
index 0000000..148e5ac
--- /dev/null
+++ b/res-common/layout/dialpad_view.xml
@@ -0,0 +1,89 @@
+<?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.
+-->
+<view class="com.android.dialer.dialpad.DialpadView"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/dialpad_view"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_gravity="bottom"
+ android:orientation="vertical"
+ android:layoutDirection="ltr"
+ android:background="@color/background_dialpad">
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="2dp"
+ android:background="@color/dialpad_separator_line_color" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="10dp" />
+
+ <!-- Text field and possibly soft menu button above the keypad where
+ the digits are displayed. -->
+ <LinearLayout
+ android:id="@+id/digits_container"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/dialpad_digits_height"
+ android:orientation="horizontal">
+
+ <view class="com.android.dialer.dialpad.DigitsEditText"
+ android:id="@+id/digits"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/dialpad_digits_padding"
+ android:scrollHorizontally="true"
+ android:singleLine="true"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:background="@android:color/transparent"
+ android:maxLines="1"
+ android:textSize="@dimen/dialpad_digits_text_size"
+ android:freezesText="true"
+ android:focusableInTouchMode="true"
+ android:cursorVisible="false"
+ android:textColor="@color/dialpad_digits_text_color"
+ android:textCursorDrawable="@null"
+ android:fontFamily="sans-serif-light"
+ android:textStyle="normal" />
+
+ <ImageButton
+ android:id="@+id/deleteButton"
+ android:paddingLeft="@dimen/dialpad_digits_padding"
+ android:paddingRight="@dimen/dialpad_digits_padding"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:state_enabled="false"
+ android:background="@drawable/dialpad_key_colors"
+ android:contentDescription="@string/description_delete_button"
+ android:src="@drawable/ic_dial_action_delete" />
+ </LinearLayout>
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="8dp" />
+
+ <include layout="@layout/dialpad" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="8dp" />
+
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="2dp"
+ android:background="@color/dialpad_separator_line_color" />
+</view>
diff --git a/res-common/values/colors.xml b/res-common/values/colors.xml
index 7cf9781..9474400 100644
--- a/res-common/values/colors.xml
+++ b/res-common/values/colors.xml
@@ -69,11 +69,27 @@
<color name="letter_tile_font_color">#ffffff</color>
-
<!-- Background color for tabs in an unpressed state. -->
<color name="tab_default_color">#00afcc</color>
<!-- Background color for tabs in a pressed state. -->
<color name="tab_pressed_color">#008698</color>
<!-- Color of the selection indicator for a tab which is selected. -->
<color name="tab_selected_color">#008698</color>
+
+ <!-- Background color of action bars. Ensure this stays in sync with packages/Telephony
+ actionbar_background_color. -->
+ <color name="actionbar_background_color">#00afcc</color>
+
+ <!-- Background color of dialpad -->
+ <color name="background_dialpad">#ffffff</color>
+ <!-- Pressed color of dialpad buttons -->
+ <color name="background_dialpad_pressed">#ececec</color>
+ <!-- Primary color of dialpad text, including the call button -->
+ <color name="dialpad_primary_text_color">#3B77E7</color>
+ <!-- Secondary color of dialpad text (used for the letters corresponding to each digit -->
+ <color name="dialpad_secondary_text_color">#8b8b8b</color>
+ <!-- Color of dialpad digits -->
+ <color name="dialpad_digits_text_color">#000000</color>
+ <!-- Color for dialpad separator lines -->
+ <color name="dialpad_separator_line_color">#dadada</color>
</resources>
diff --git a/res-common/values/dimens.xml b/res-common/values/dimens.xml
index d652197..374b4a1 100644
--- a/res-common/values/dimens.xml
+++ b/res-common/values/dimens.xml
@@ -101,4 +101,23 @@
<!-- Height of the selection indicator of a tab. -->
<dimen name="tab_selected_underline_height">3dp</dimen>
+
+ <!-- Text dimensions for dialpad keys -->
+ <dimen name="dialpad_key_numbers_size">40sp</dimen>
+ <dimen name="dialpad_key_letters_size">13sp</dimen>
+ <dimen name="dialpad_key_star_pound_size">26sp</dimen>
+ <dimen name="dialpad_key_numbers_width">30dp</dimen>
+ <dimen name="dialpad_key_letters_width">50dp</dimen>
+ <dimen name="dialpad_key_height">56sp</dimen>
+ <!-- The bottom row of the dialpad is slightly taller to account for the dial button -->
+ <dimen name="dialpad_bottom_key_height">70dp</dimen>
+ <dimen name="dialpad_key_plus_size">18sp</dimen>
+ <dimen name="dialpad_number_to_letters_padding">11dp</dimen>
+ <dimen name="dialpad_horizontal_padding">5dp</dimen>
+ <dimen name="dialpad_digits_text_size">33sp</dimen>
+ <dimen name="dialpad_digits_height">55dp</dimen>
+ <dimen name="dialpad_digits_padding">16dp</dimen>
+ <dimen name="dialpad_digits_margin_bottom">0px</dimen>
+ <dimen name="dialpad_center_margin">3dp</dimen>
+ <dimen name="dialpad_button_margin">2dp</dimen>
</resources>
diff --git a/res-common/values/strings.xml b/res-common/values/strings.xml
index c63fb33..1de1ba0 100644
--- a/res-common/values/strings.xml
+++ b/res-common/values/strings.xml
@@ -720,6 +720,22 @@
-->
<string name="description_dial_phone_number">Dial phone <xliff:g id="name">%1$s</xliff:g></string>
+ <!-- String describing the button to add a contact for the current number.
+
+ Note: AccessibilityServices use this attribute to announce what the view represents.
+ This is especially valuable for views without textual representation like ImageView.
+ -->
+ <string name="description_add_contact">Add contact</string>
+
+ <!-- String describing the overflow menu button in the dialpad -->
+ <string name="description_dialpad_overflow">More options</string>
+
+ <!-- String describing the Delete/Backspace ImageButton
+
+ Used by AccessibilityService to announce the purpose of the button.
+ -->
+ <string name="description_delete_button">backspace</string>
+
<!-- Attribution of a contact status update, when the time of update is unknown -->
<string name="contact_status_update_attribution">via <xliff:g id="source" example="Google Talk">%1$s</xliff:g></string>
diff --git a/res-common/values/styles.xml b/res-common/values/styles.xml
index 346815c..ebc7109 100644
--- a/res-common/values/styles.xml
+++ b/res-common/values/styles.xml
@@ -88,4 +88,50 @@
<item name="android:windowNoDisplay">true</item>
<item name="android:windowIsFloating">true</item>
</style>
+
+ <style name="DialpadKeyNumberStyle">
+ <item name="android:textColor">@color/actionbar_background_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_numbers_width</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:gravity">center</item>
+ </style>
+
+ <style name="DialpadKeyStarPoundStyle">
+ <item name="android:textColor">@color/dialpad_secondary_text_color</item>
+ <item name="android:textSize">@dimen/dialpad_key_star_pound_size</item>
+ <item name="android:fontFamily">sans-serif-light</item>
+ <item name="android:layout_width">@dimen/dialpad_key_numbers_width</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:gravity">center</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-light</item>
+ <item name="android:layout_width">@dimen/dialpad_key_letters_width</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:paddingLeft">@dimen/dialpad_number_to_letters_padding</item>
+ </style>
+
+ <style name="DialpadKeyButtonStyle">
+ <item name="android:soundEffectsEnabled">false</item>
+ <item name="android:clickable">true</item>
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">@dimen/dialpad_key_height</item>
+ <item name="android:background">@drawable/dialpad_key_colors</item>
+ <item name="android:focusable">true</item>
+ </style>
+
+ <style name="DialpadBottomKeyButtonStyle" parent="DialpadKeyButtonStyle">
+ <item name="android:layout_height">@dimen/dialpad_bottom_key_height</item>
+ </style>
+
+ <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</item>
+ </style>
</resources>