Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
T9 dialer from CM10
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Pearce committed Jul 20, 2012
1 parent 9646451 commit 6bf8ecb
Show file tree
Hide file tree
Showing 82 changed files with 1,343 additions and 124 deletions.
13 changes: 13 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,19 @@
android:label="@string/activity_title_settings"
android:theme="@style/ContactsPreferencesTheme" />

<!-- Used to set options -->
<activity
android:name=".preference.DialpadPreferenceActivity"
android:label="@string/dialer_ui_title"
android:icon="@mipmap/ic_launcher_phone"
android:theme="@android:style/Theme.Holo.DialogWhenLarge">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<!-- Used to filter contacts list by account -->
<activity
android:name=".list.AccountFilterActivity"
Expand Down
Binary file added res/drawable-bg-hdpi/dial_num_2_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-hdpi/dial_num_3_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-hdpi/dial_num_4_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-hdpi/dial_num_5_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-hdpi/dial_num_6_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-hdpi/dial_num_7_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-hdpi/dial_num_8_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-hdpi/dial_num_9_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_2_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_3_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_4_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_5_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_6_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_7_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_8_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-mdpi/dial_num_9_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_2_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_3_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_4_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_5_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_6_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_7_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_8_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-bg-xhdpi/dial_num_9_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-iw-hdpi/dial_num_2_wht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-iw-hdpi/dial_num_3_wht.png
Binary file added res/drawable-iw-hdpi/dial_num_4_wht.png
Binary file added res/drawable-iw-hdpi/dial_num_5_wht.png
Binary file added res/drawable-iw-hdpi/dial_num_6_wht.png
Binary file added res/drawable-iw-hdpi/dial_num_7_wht.png
Binary file added res/drawable-iw-hdpi/dial_num_8_wht.png
Binary file added res/drawable-iw-hdpi/dial_num_9_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_2_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_3_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_4_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_5_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_6_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_7_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_8_wht.png
Binary file added res/drawable-iw-mdpi/dial_num_9_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_2_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_3_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_4_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_5_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_6_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_7_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_8_wht.png
Binary file added res/drawable-iw-xhdpi/dial_num_9_wht.png
Binary file added res/drawable/expander_close.9.png
Binary file added res/drawable/expander_close_pressed.9.png
Binary file added res/drawable/expander_open.9.png
Binary file added res/drawable/expander_open_pressed.9.png
4 changes: 4 additions & 0 deletions res/drawable/t9result_state.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@android:color/holo_blue_dark" />
</selector>
6 changes: 6 additions & 0 deletions res/drawable/t9toggle_state.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:state_pressed="true" android:drawable="@drawable/expander_close_pressed" />
<item android:state_checked="false" android:state_pressed="true" android:drawable="@drawable/expander_open_pressed" />
<item android:state_checked="true" android:drawable="@drawable/expander_close" />
<item android:drawable="@drawable/expander_open" />
</selector>
56 changes: 56 additions & 0 deletions res/layout-land/call_log_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->

<!-- Layout parameters are set programmatically. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:divider="?android:attr/dividerHorizontal"
android:showDividers="end">

<FrameLayout
android:id="@+id/voicemail_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:visibility="gone">
<include layout="@layout/call_log_voicemail_status"
/>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="none"
android:scrollbarStyle="outsideOverlay"
android:divider="@null"
/>
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/recentCalls_empty"
android:gravity="center"
android:layout_marginTop="@dimen/empty_message_top_margin"
android:textColor="?android:attr/textColorSecondary"
android:textAppearance="?android:attr/textAppearanceLarge"
/>
</FrameLayout>
</LinearLayout>
94 changes: 94 additions & 0 deletions res/layout-land/dialpad.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?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="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginTop="@dimen/dialpad_vertical_margin"
android:paddingLeft="5dip">

<TableRow
android:layout_height="0px"
android:layout_weight="1">
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/one" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_1_wht"
android:contentDescription="@string/description_image_button_one" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/two" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_2_wht"
android:contentDescription="@string/description_image_button_two" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/three" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_3_wht"
android:contentDescription="@string/description_image_button_three" />
</TableRow>

<TableRow
android:layout_height="0px"
android:layout_weight="1">
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/four" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_4_wht"
android:contentDescription="@string/description_image_button_four" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/five" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_5_wht"
android:contentDescription="@string/description_image_button_five" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/six" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_6_wht"
android:contentDescription="@string/description_image_button_six" />
</TableRow>

<TableRow
android:layout_height="0px"
android:layout_weight="1">
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/seven" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_7_wht"
android:contentDescription="@string/description_image_button_seven" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/eight" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_8_wht"
android:contentDescription="@string/description_image_button_eight" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/nine" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_9_wht"
android:contentDescription="@string/description_image_button_nine" />
</TableRow>

<TableRow
android:layout_height="0px"
android:layout_weight="1">
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/star" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_star_wht"
android:contentDescription="@string/description_image_button_star" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/zero" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_0_wht"
android:contentDescription="@string/description_image_button_zero" />
<com.android.contacts.dialpad.DialpadImageButton
android:id="@+id/pound" style="@style/DialtactsDialpadButtonStyle"
android:src="@drawable/dial_num_pound_wht"
android:contentDescription="@string/description_image_button_pound" />
</TableRow>
</TableLayout>
151 changes: 117 additions & 34 deletions res/layout-land/dialpad_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,127 @@
limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>

<!-- Text field above the keypad where the digits are displayed.
It's type is set to PHONE (to put the keyboard in the right
config) in the java code.
-->
<!-- TODO: Use a textAppearance to control the display of the number -->
<EditText android:id="@+id/digits"
android:background="@drawable/dialpad_background"
android:orientation="horizontal">
<!-- Keypad section -->
<include
layout="@layout/dialpad" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dialpad_digits_height"
android:layout_marginBottom="@dimen/dialpad_digits_margin_bottom"
android:layout_marginTop="1dip"
android:layout_height="0px"
android:id="@+id/t9topbar"
android:layout_gravity="center"
android:gravity="center"
android:maxLines="1"
android:scrollHorizontally="true"
android:textSize="@dimen/dialpad_digits_text_size"
android:freezesText="true"
android:background="@drawable/dialpad_background"
android:textColor="@color/dialer_button_text"
android:hint="@string/dialerKeyboardHintText"
/>

<!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
<include layout="@layout/dialpad_additional_buttons" />

<!-- "Dialpad chooser" UI, shown only when the user brings up the
Dialer while a call is already in progress.
When this UI is visible, the other Dialer elements
(the textfield and button) are hidden. -->
<ListView android:id="@+id/dialpadChooser"
android:layout_weight="0.3">
<ListView
android:id="@+id/t9listtop"
android:visibility="invisible"
android:divider="@null"
android:gravity="center_vertical"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="40dp" />
<ToggleButton
android:id="@+id/t9toggle"
android:layout_width="40dp"
android:layout_height="40dp"
android:visibility="invisible"
android:scaleType="centerInside"
android:textOn=""
android:textOff=""
android:background="@drawable/t9toggle_state"
android:layout_gravity="center"/>
</LinearLayout>

<ViewSwitcher
android:id="@+id/t9flipper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:footerDividersEnabled="true"
/>
android:layout_height="0dp"
android:layout_weight="0.7">
<!-- Keypad section -->
<com.android.contacts.dialpad.DigitsEditText
android:id="@+id/digits"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:gravity="center"
android:textAppearance="@style/DialtactsDigitsTextAppearance"
android:textColor="?android:attr/textColorPrimary"
android:nextFocusRight="@+id/overflow_menu"
android:background="@android:color/transparent" />

<ListView
android:layout_width="match_parent"
android:id="@+id/t9list"
android:visibility="gone"
android:scrollingCache="true"
android:layout_height="match_parent" />
</ViewSwitcher>

<LinearLayout
android:id="@+id/dialButtonContainer"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.3"
android:orientation="horizontal" >

<!--
Onscreen "Dial" button, diused on all platforms by
default. Its usage can be disabled using resources (see
config.xml.)
-->

<ImageButton
android:id="@+id/dialButton"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="0.40"
android:background="@drawable/btn_call"
android:contentDescription="@string/description_dial_button"
android:src="@drawable/ic_dial_action_call"
android:state_enabled="false" />

<View
android:layout_width="1dip"
android:layout_height="24dip"
android:layout_gravity="center_vertical"
android:background="?android:attr/dividerVertical" />

<!-- Onscreen "Backspace/Delete" button -->

<ImageButton
android:id="@+id/deleteButton"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="0.30"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/description_delete_button"
android:src="@drawable/ic_dial_action_delete"
android:state_enabled="false" />
</LinearLayout>

</LinearLayout>
<!-- "Dialpad chooser" UI, shown only when the user brings up the Dialer
while a call is already in progress. When this UI is visible, the other Dialer
elements (the textfield and button) are hidden. -->
<ListView
android:id="@+id/dialpadChooser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:footerDividersEnabled="true" />
</LinearLayout>
</LinearLayout>
46 changes: 46 additions & 0 deletions res/layout-land/phone_contact_tile_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->

<!-- Use LinearLayout + FrameLayout, just to rely on android:divider and android:showDividers -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:divider="?android:attr/dividerHorizontal"
android:showDividers="end">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/contact_tile_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/contact_tile_list_padding_top"
android:clipToPadding="false"
android:fadingEdge="none"
android:divider="@null" />

<TextView
android:id="@+id/contact_tile_list_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:layout_marginTop="@dimen/empty_message_top_margin"
android:textColor="?android:attr/textColorSecondary"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</FrameLayout>
</LinearLayout>
Loading

0 comments on commit 6bf8ecb

Please sign in to comment.