Merge change I386dd954 into eclair
* changes:
Remove GAIA string
diff --git a/res/drawable-hdpi-finger/ic_join.png b/res/drawable-hdpi-finger/ic_join.png
new file mode 100644
index 0000000..8f140d4
--- /dev/null
+++ b/res/drawable-hdpi-finger/ic_join.png
Binary files differ
diff --git a/res/drawable-hdpi/bg_infobar_new.9.png b/res/drawable-hdpi/bg_infobar_new.9.png
new file mode 100644
index 0000000..104ced9
--- /dev/null
+++ b/res/drawable-hdpi/bg_infobar_new.9.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/ic_join.png b/res/drawable-mdpi-finger/ic_join.png
new file mode 100644
index 0000000..177a582
--- /dev/null
+++ b/res/drawable-mdpi-finger/ic_join.png
Binary files differ
diff --git a/res/drawable-mdpi/bg_infobar_new.9.png b/res/drawable-mdpi/bg_infobar_new.9.png
new file mode 100644
index 0000000..f3a83d4
--- /dev/null
+++ b/res/drawable-mdpi/bg_infobar_new.9.png
Binary files differ
diff --git a/res/drawable/call_background.xml b/res/drawable/call_background.xml
new file mode 100644
index 0000000..fbc9b3c
--- /dev/null
+++ b/res/drawable/call_background.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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_window_focused="false"
+ android:drawable="@android:color/transparent" />
+ <item android:state_focused="false" android:state_pressed="true"
+ android:drawable="@*android:drawable/list_selector_background_transition" />
+ <item android:state_focused="false" android:state_pressed="false"
+ android:drawable="@android:drawable/screen_background_dark"/>
+
+</selector>
diff --git a/res/layout-finger/contact_card_layout.xml b/res/layout-finger/contact_card_layout.xml
index fe931ec..3f090f5 100644
--- a/res/layout-finger/contact_card_layout.xml
+++ b/res/layout-finger/contact_card_layout.xml
@@ -36,16 +36,6 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
- <TextView android:id="@+id/account_name"
- style="?android:attr/listSeparatorTextViewStyle"
- android:textColor="@*android:color/dim_foreground_dark"
- android:textSize="12sp"
- android:textStyle="normal"
- android:background="@drawable/section_dark"
- android:paddingLeft="7dp"
- android:gravity="left|center_vertical"
- android:visibility="gone" />
-
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dip"
diff --git a/res/layout-finger/contacts_list_content_join.xml b/res/layout-finger/contacts_list_content_join.xml
index ce82d2c..95f9c20 100644
--- a/res/layout-finger/contacts_list_content_join.xml
+++ b/res/layout-finger/contacts_list_content_join.xml
@@ -25,14 +25,15 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@*android:drawable/title_bar_medium"
- android:padding="5dip"
+ android:paddingLeft="5dip"
+ android:paddingRight="5dip"
android:gravity="center_vertical"
>
<ImageView
android:layout_width="48dip"
android:layout_height="48dip"
- android:src="@drawable/ic_menu_merge"
+ android:src="@drawable/ic_join"
android:gravity="center"
android:scaleType="fitCenter"
/>
@@ -48,9 +49,11 @@
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView
+ android:id="@+id/join_contact_blurb"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:text="@string/blurbJoinContactDataWith"
+ android:layout_marginTop="-2dip"
+ android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
</LinearLayout>
diff --git a/res/layout-finger/contacts_list_item.xml b/res/layout-finger/contacts_list_item.xml
index 4bba0bd..0e7852e 100644
--- a/res/layout-finger/contacts_list_item.xml
+++ b/res/layout-finger/contacts_list_item.xml
@@ -61,7 +61,7 @@
android:background="@*android:drawable/divider_vertical_dark_opaque"
/>
- <ImageView android:id="@+id/call_button"
+ <com.android.contacts.ui.widget.DontPressWithParentImageView android:id="@+id/call_button"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="14dip"
@@ -69,7 +69,7 @@
android:layout_centerVertical="true"
android:gravity="center"
android:src="@android:drawable/sym_action_call"
- android:background="@android:drawable/list_selector_background"
+ android:background="@drawable/call_background"
/>
</LinearLayout>
diff --git a/res/layout-finger/contacts_list_item_photo.xml b/res/layout-finger/contacts_list_item_photo.xml
index 75c8cec..527463f 100644
--- a/res/layout-finger/contacts_list_item_photo.xml
+++ b/res/layout-finger/contacts_list_item_photo.xml
@@ -61,7 +61,7 @@
android:background="@*android:drawable/divider_vertical_dark_opaque"
/>
- <ImageView android:id="@+id/call_button"
+ <com.android.contacts.ui.widget.DontPressWithParentImageView android:id="@+id/call_button"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="14dip"
@@ -69,7 +69,7 @@
android:layout_centerVertical="true"
android:gravity="center"
android:src="@android:drawable/sym_action_call"
- android:background="@android:drawable/list_selector_background"
+ android:background="@drawable/call_background"
/>
</LinearLayout>
diff --git a/res/layout-finger/contacts_list_show_all_item.xml b/res/layout-finger/contacts_list_show_all_item.xml
new file mode 100644
index 0000000..5937b9f
--- /dev/null
+++ b/res/layout-finger/contacts_list_show_all_item.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright 2009, 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.
+ */
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+>
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical|left"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:text="@string/showAllContactsJoinItem"
+ android:paddingLeft="14dip"
+ />
+
+ <View android:id="@+id/list_divider"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="@*android:drawable/divider_horizontal_dark_opaque"
+ />
+</LinearLayout>
diff --git a/res/layout-finger/dialpad.xml b/res/layout-finger/dialpad.xml
index 0acb721..82179db 100644
--- a/res/layout-finger/dialpad.xml
+++ b/res/layout-finger/dialpad.xml
@@ -21,8 +21,11 @@
android:id="@+id/dialpad"
android:paddingLeft="7dp"
android:paddingRight="7dp"
- android:layout_width="fill_parent"
+ android:paddingTop="6dp"
+ android:paddingBottom="6dp"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
>
<ImageButton android:id="@+id/one"
android:layout_width="88dp"
diff --git a/res/layout-finger/recent_calls_list_item.xml b/res/layout-finger/recent_calls_list_item.xml
index 0f53d87..288892d 100644
--- a/res/layout-finger/recent_calls_list_item.xml
+++ b/res/layout-finger/recent_calls_list_item.xml
@@ -20,7 +20,7 @@
android:paddingLeft="7dip"
>
- <ImageView android:id="@+id/call_icon"
+ <com.android.contacts.ui.widget.DontPressWithParentImageView android:id="@+id/call_icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="14dip"
@@ -29,7 +29,7 @@
android:gravity="center_vertical"
android:src="@android:drawable/sym_action_call"
- android:background="@android:drawable/list_selector_background"
+ android:background="@drawable/call_background"
/>
<View android:id="@+id/divider"
diff --git a/res/layout-finger/tab_account_name.xml b/res/layout-finger/tab_account_name.xml
new file mode 100644
index 0000000..dc99af1
--- /dev/null
+++ b/res/layout-finger/tab_account_name.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<!-- looks like Widget.TextView.ListSeparator -->
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/account_name"
+ android:background="@drawable/bg_infobar_new"
+ android:layout_width="fill_parent"
+ android:layout_height="@dimen/account_name_height"
+ android:layout_below="@+id/tab_scroll_view"
+ android:textStyle="normal"
+ android:textColor="@*android:color/dim_foreground_dark"
+ android:textSize="12sp"
+ android:gravity="left|center_vertical"
+ android:paddingLeft="7dip"
+/>
diff --git a/res/layout-finger/tab_layout.xml b/res/layout-finger/tab_layout.xml
index 23359b7..9a793c3 100644
--- a/res/layout-finger/tab_layout.xml
+++ b/res/layout-finger/tab_layout.xml
@@ -15,6 +15,7 @@
-->
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/tab_scroll_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
diff --git a/res/layout-finger/total_contacts.xml b/res/layout-finger/total_contacts.xml
index 1221ef3..ab15ce1 100644
--- a/res/layout-finger/total_contacts.xml
+++ b/res/layout-finger/total_contacts.xml
@@ -24,6 +24,5 @@
android:textStyle="normal"
android:background="@drawable/section_dark"
android:paddingLeft="7dp"
- android:gravity="left|center_vertical"
- android:visibility="gone"
+ android:gravity="center|center_vertical"
/>
\ No newline at end of file
diff --git a/res/layout-finger/twelve_key_dialer.xml b/res/layout-finger/twelve_key_dialer.xml
index 018bee8..83eb2cf 100644
--- a/res/layout-finger/twelve_key_dialer.xml
+++ b/res/layout-finger/twelve_key_dialer.xml
@@ -25,9 +25,8 @@
<!-- TODO: Use a textAppearance to control the display of the number -->
<EditText android:id="@+id/digits"
android:layout_width="fill_parent"
- android:layout_height="66dip"
+ android:layout_height="67dip"
android:layout_marginBottom="6dip"
- android:layout_marginTop="1dip"
android:gravity="center"
android:maxLines="1"
android:scrollHorizontally="true"
@@ -42,42 +41,7 @@
<include layout="@layout/dialpad" />
<!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
- <LinearLayout android:id="@+id/voicemailAndDialAndDelete"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="6dip"
- android:orientation="horizontal">
-
- <!-- Onscreen "Voicemail" button -->
- <ImageButton android:id="@+id/voicemailButton"
- android:layout_width="90dip"
- android:layout_height="52dip"
- android:layout_gravity="center_vertical"
- android:state_enabled="false"
- android:background="@drawable/btn_dial_voicemail"
- android:src="@drawable/ic_dial_action_voice_mail" />
-
- <!-- Onscreen "Dial" button, used on all platforms by
- default. Its usage can be disabled using resources (see
- config.xml.) -->
- <ImageButton android:id="@+id/dialButton"
- android:layout_width="116dip"
- android:layout_height="52dip"
- android:layout_gravity="center_vertical"
- android:state_enabled="false"
- android:background="@drawable/btn_dial_action"
- android:src="@drawable/ic_dial_action_call" />
-
- <!-- Onscreen "Backspace/Delete" button -->
- <ImageButton android:id="@+id/deleteButton"
- android:layout_width="90dip"
- android:layout_height="52dip"
- android:layout_gravity="center_vertical"
- android:state_enabled="false"
- android:background="@drawable/btn_dial_delete"
- android:src="@drawable/ic_dial_action_delete" />
- </LinearLayout>
+ <include layout="@layout/voicemail_dial_delete" />
<!-- "Dialpad chooser" UI, shown only when the user brings up the
Dialer while a call is already in progress.
diff --git a/res/layout-finger/voicemail_dial_delete.xml b/res/layout-finger/voicemail_dial_delete.xml
new file mode 100644
index 0000000..1aa2ac4
--- /dev/null
+++ b/res/layout-finger/voicemail_dial_delete.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/voicemailAndDialAndDelete"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="6dip"
+ android:orientation="horizontal">
+
+ <!-- Onscreen "Voicemail" button.
+ The width is 75 (from the mocks) + 12 of padding from the
+ 9patch, total is 87.
+ -->
+ <ImageButton android:id="@+id/voicemailButton"
+ android:layout_width="87dip"
+ android:layout_height="50dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_voicemail"
+ android:src="@drawable/ic_dial_action_voice_mail" />
+
+ <!-- Onscreen "Dial" button, used on all platforms by
+ default. Its usage can be disabled using resources (see
+ config.xml.) -->
+ <ImageButton android:id="@+id/dialButton"
+ android:layout_width="116dip"
+ android:layout_height="50dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_action"
+ android:src="@drawable/ic_dial_action_call" />
+
+ <!-- Onscreen "Backspace/Delete" button
+ The width is 75 (from the mocks) + 12 of padding from the
+ 9patch, total is 87.
+ -->
+ <ImageButton android:id="@+id/deleteButton"
+ android:layout_width="87dip"
+ android:layout_height="50dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_delete"
+ android:src="@drawable/ic_dial_action_delete" />
+</LinearLayout>
+
diff --git a/res/layout-land-finger/twelve_key_dialer.xml b/res/layout-land-finger/twelve_key_dialer.xml
index 11ec8d6..8c66ff3 100644
--- a/res/layout-land-finger/twelve_key_dialer.xml
+++ b/res/layout-land-finger/twelve_key_dialer.xml
@@ -26,7 +26,7 @@
<EditText android:id="@+id/digits"
android:layout_width="fill_parent"
android:layout_height="66dip"
- android:layout_marginBottom="6dip"
+ android:layout_marginBottom="50dip"
android:layout_marginTop="1dip"
android:gravity="center"
android:maxLines="1"
@@ -39,42 +39,7 @@
/>
<!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
- <LinearLayout android:id="@+id/voicemailAndDialAndDelete"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="6dip"
- android:orientation="horizontal">
-
- <!-- Onscreen "Voicemail" button -->
- <ImageButton android:id="@+id/voicemailButton"
- android:layout_width="90dip"
- android:layout_height="52dip"
- android:layout_gravity="center_vertical"
- android:state_enabled="false"
- android:background="@drawable/btn_dial_voicemail"
- android:src="@drawable/ic_dial_action_voice_mail" />
-
- <!-- Onscreen "Dial" button, used on all platforms by
- default. Its usage can be disabled using resources (see
- config.xml.) -->
- <ImageButton android:id="@+id/dialButton"
- android:layout_width="116dip"
- android:layout_height="52dip"
- android:layout_gravity="center_vertical"
- android:state_enabled="false"
- android:background="@drawable/btn_dial_action"
- android:src="@drawable/ic_dial_action_call" />
-
- <!-- Onscreen "Backspace/Delete" button -->
- <ImageButton android:id="@+id/deleteButton"
- android:layout_width="90dip"
- android:layout_height="52dip"
- android:layout_gravity="center_vertical"
- android:state_enabled="false"
- android:background="@drawable/btn_dial_delete"
- android:src="@drawable/ic_dial_action_delete" />
- </LinearLayout>
+ <include layout="@layout/voicemail_dial_delete" />
<!-- "Dialpad chooser" UI, shown only when the user brings up the
Dialer while a call is already in progress.
diff --git a/res/layout-long-finger/dialpad.xml b/res/layout-long-finger/dialpad.xml
new file mode 100644
index 0000000..af303fc
--- /dev/null
+++ b/res/layout-long-finger/dialpad.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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 Contact app.
+ Tall screen version with taller buttons.
+ -->
+
+<com.android.contacts.ButtonGridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/dialpad"
+ android:paddingLeft="7dp"
+ android:paddingRight="7dp"
+ android:paddingTop="6dp"
+ android:paddingBottom="6dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+>
+ <ImageButton android:id="@+id/one"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_1_no_vm"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_one"
+ />
+
+ <ImageButton android:id="@+id/two"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_2"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_two"
+ />
+
+ <ImageButton android:id="@+id/three"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_3"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_three"
+ />
+
+ <ImageButton android:id="@+id/four"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_4"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_four"
+ />
+
+ <ImageButton android:id="@+id/five"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_5"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_five"
+ />
+
+ <ImageButton android:id="@+id/six"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_6"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_six"
+ />
+
+ <ImageButton android:id="@+id/seven"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_7"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_seven"
+ />
+
+ <ImageButton android:id="@+id/eight"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_8"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_eight"
+ />
+
+ <ImageButton android:id="@+id/nine"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_9"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_nine"
+ />
+
+ <ImageButton android:id="@+id/star"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_star"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_star"
+ />
+
+ <ImageButton android:id="@+id/zero"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_0"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_zero"
+ />
+
+ <ImageButton android:id="@+id/pound"
+ android:layout_width="88dp"
+ android:layout_height="58dp"
+ android:src="@drawable/dial_num_pound"
+ android:background="@drawable/btn_dial"
+ android:soundEffectsEnabled="false"
+ android:contentDescription="@string/description_image_button_pound"
+ />
+</com.android.contacts.ButtonGridLayout>
diff --git a/res/layout-long-finger/twelve_key_dialer.xml b/res/layout-long-finger/twelve_key_dialer.xml
new file mode 100644
index 0000000..77f471e
--- /dev/null
+++ b/res/layout-long-finger/twelve_key_dialer.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/top"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+>
+
+ <!-- Text field above the keypad where the digits are displayed -->
+ <!-- TODO: Use a textAppearance to control the display of the number -->
+ <EditText android:id="@+id/digits"
+ android:layout_width="fill_parent"
+ android:layout_height="74dip"
+ android:layout_marginBottom="20dip"
+ android:gravity="center"
+ android:maxLines="1"
+ android:scrollHorizontally="true"
+ android:textSize="34sp"
+ android:freezesText="true"
+ android:background="@drawable/btn_dial_textfield"
+ android:textColor="@color/dialer_button_text"
+ android:focusableInTouchMode="false"
+ />
+
+ <!-- Keypad section -->
+ <include layout="@layout/dialpad" />
+
+ <!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
+ <include layout="@layout/voicemail_dial_delete" />
+
+ <!-- "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/button and the dialpad) are hidden. -->
+ <ListView android:id="@+id/dialpadChooser"
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:layout_weight="1"
+ />
+
+</LinearLayout>
diff --git a/res/layout-long-finger/voicemail_dial_delete.xml b/res/layout-long-finger/voicemail_dial_delete.xml
new file mode 100644
index 0000000..58c482b
--- /dev/null
+++ b/res/layout-long-finger/voicemail_dial_delete.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<!-- Horizontal row of buttons (Voicemail + DialButton + Delete.)
+ Tall screen version with taller buttons.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/voicemailAndDialAndDelete"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="24dip"
+ android:orientation="horizontal">
+
+ <!-- Onscreen "Voicemail" button -->
+ <ImageButton android:id="@+id/voicemailButton"
+ android:layout_width="87dip"
+ android:layout_height="58dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_voicemail"
+ android:src="@drawable/ic_dial_action_voice_mail" />
+
+ <!-- Onscreen "Dial" button, used on all platforms by
+ default. Its usage can be disabled using resources (see
+ config.xml.) -->
+ <ImageButton android:id="@+id/dialButton"
+ android:layout_width="116dip"
+ android:layout_height="58dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_action"
+ android:src="@drawable/ic_dial_action_call" />
+
+ <!-- Onscreen "Backspace/Delete" button -->
+ <ImageButton android:id="@+id/deleteButton"
+ android:layout_width="87dip"
+ android:layout_height="58dip"
+ android:layout_gravity="center_vertical"
+ android:state_enabled="false"
+ android:background="@drawable/btn_dial_delete"
+ android:src="@drawable/ic_dial_action_delete" />
+</LinearLayout>
+
diff --git a/res/layout-long-land-finger/twelve_key_dialer.xml b/res/layout-long-land-finger/twelve_key_dialer.xml
new file mode 100644
index 0000000..618792a
--- /dev/null
+++ b/res/layout-long-land-finger/twelve_key_dialer.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/top"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+>
+
+ <!-- Text field above the keypad where the digits are displayed -->
+ <!-- TODO: Use a textAppearance to control the display of the number -->
+ <EditText android:id="@+id/digits"
+ android:layout_width="fill_parent"
+ android:layout_height="74dip"
+ android:layout_marginBottom="30dip"
+ android:layout_marginTop="1dip"
+ android:gravity="center"
+ android:maxLines="1"
+ android:scrollHorizontally="true"
+ android:textSize="34sp"
+ android:freezesText="true"
+ android:background="@drawable/btn_dial_textfield"
+ android:textColor="@color/dialer_button_text"
+ android:hint="@string/dialerKeyboardHintText"
+ />
+
+ <!-- Horizontal row of buttons (Voicemail + DialButton + Delete.) -->
+ <include layout="@layout/voicemail_dial_delete" />
+
+ <!-- "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="fill_parent"
+ android:layout_height="wrap_content"
+ android:footerDividersEnabled="true"
+ />
+
+</LinearLayout>
diff --git a/res/layout/act_edit.xml b/res/layout/act_edit.xml
index 47f1454..250a0e1 100644
--- a/res/layout/act_edit.xml
+++ b/res/layout/act_edit.xml
@@ -37,16 +37,6 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
- <TextView android:id="@+id/account_name"
- style="?android:attr/listSeparatorTextViewStyle"
- android:textColor="@*android:color/dim_foreground_dark"
- android:textSize="12sp"
- android:textStyle="normal"
- android:background="@drawable/section_dark"
- android:paddingLeft="7dp"
- android:gravity="left|center_vertical"
- android:visibility="gone" />
-
<include
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 0742250..4361fd4 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -20,4 +20,5 @@
<!-- The height of the ScrollingTabWidget -->
<dimen name="tab_height">40dip</dimen>
+ <dimen name="account_name_height">25dip</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3fdcf76..1ea5409 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -142,11 +142,13 @@
<string name="titleJoinContactDataWith">Join contacts</string>
<!-- Info blurb on the Join Contact screen -->
- <string name="blurbJoinContactDataWith">Contact data will be combined with
- another contact selected from the list.</string>
+ <string name="blurbJoinContactDataWith">Select the contact you want to join with <xliff:g id="name">%s</xliff:g>.</string>
+
+ <!-- An item in the Join Contact activity that opens up the full contact A-Z list -->
+ <string name="showAllContactsJoinItem">Show all contacts</string>
<!-- List separator for the Join Contact list: Suggestions -->
- <string name="separatorJoinAggregateSuggestions">Suggestions</string>
+ <string name="separatorJoinAggregateSuggestions">Suggested contacts</string>
<!-- List separator for the Join Contact list: A-Z -->
<string name="separatorJoinAggregateAll">All contacts</string>
@@ -969,9 +971,12 @@
<string name="dialog_sync_add">Add sync group</string>
<string name="display_more_groups">More groups\u2026</string>
+ <!-- List title for a special contacts group that covers all contacts.-->
+ <string name="display_ungrouped">All Other Contacts</string>
+
<!-- List title for a special contacts group that covers all contacts that
- aren't members of any other group. -->
- <string name="display_ungrouped">(Ungrouped contacts)</string>
+ aren't members of any other group. -->
+ <string name="display_all_contacts">All Contacts</string>
<!-- Warning message given to users just before they remove a currently syncing
group that would also cause all ungrouped contacts to stop syncing. -->
@@ -1153,6 +1158,6 @@
<string name="split_explanation">Make this data its own contact.</string>
<!-- Formatting string for account name -->
- <string name="account_name_format">From account: <xliff:g id="account" example="user@gmail.com">%s</xliff:g></string>
+ <string name="account_name_format">From <xliff:g id="source" example="Gmail">%1$s</xliff:g> account: <xliff:g id="account" example="user@gmail.com">%2$s</xliff:g></string>
</resources>
diff --git a/src/com/android/contacts/ButtonGridLayout.java b/src/com/android/contacts/ButtonGridLayout.java
index 69eed97..b8936e3 100644
--- a/src/com/android/contacts/ButtonGridLayout.java
+++ b/src/com/android/contacts/ButtonGridLayout.java
@@ -18,13 +18,40 @@
import android.content.Context;
import android.util.AttributeSet;
+import android.view.View.MeasureSpec;
import android.view.View;
import android.view.ViewGroup;
-import android.view.View.MeasureSpec;
+/**
+ * Create a 4x3 grid of dial buttons.
+ *
+ * It was easier and more efficient to do it this way than use
+ * standard layouts. It's perfectly fine (and actually encouraged) to
+ * use custom layouts rather than piling up standard layouts.
+ *
+ * The horizontal and vertical spacings between buttons are controlled
+ * by the amount of padding (attributes on the ButtonGridLayout element):
+ * - horizontal = left + right padding and
+ * - vertical = top + bottom padding.
+ *
+ * This class assumes that all the buttons have the same size.
+ *
+ * Invocation: onMeasure is called first by the framework to know our
+ * size. Then onLayout is invoked to layout the buttons.
+ */
+// TODO: Blindly layout the buttons w/o checking if we overrun the
+// bottom-right corner.
public class ButtonGridLayout extends ViewGroup {
+ private final int COLUMNS = 3;
+ private final int ROWS = 4;
- private final int mColumns = 3;
+ // Width and height of a button
+ private int mButtonWidth;
+ private int mButtonHeight;
+
+ // Width and height of a button + padding.
+ private int mWidthInc;
+ private int mHeightInc;
public ButtonGridLayout(Context context) {
super(context);
@@ -40,64 +67,43 @@
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ int i = 0;
int y = mPaddingTop;
- final int rows = getRows();
- final View child0 = getChildAt(0);
- final int yInc = (getHeight() - mPaddingTop - mPaddingBottom) / rows;
- final int xInc = (getWidth() - mPaddingLeft - mPaddingRight) / mColumns;
- final int childWidth = child0.getMeasuredWidth();
- final int childHeight = child0.getMeasuredHeight();
- final int xOffset = (xInc - childWidth) / 2;
- final int yOffset = (yInc - childHeight) / 2;
-
- for (int row = 0; row < rows; row++) {
+ for (int row = 0; row < ROWS; row++) {
int x = mPaddingLeft;
- for (int col = 0; col < mColumns; col++) {
- int cell = row * mColumns + col;
- if (cell >= getChildCount()) {
- break;
- }
- View child = getChildAt(cell);
- child.layout(x + xOffset, y + yOffset,
- x + xOffset + childWidth,
- y + yOffset + childHeight);
- x += xInc;
- }
- y += yInc;
- }
- }
+ for (int col = 0; col < COLUMNS; col++) {
+ View child = getChildAt(i);
- private int getRows() {
- return (getChildCount() + mColumns - 1) / mColumns;
- }
+ child.layout(x, y, x + mButtonWidth, y + mButtonHeight);
+
+ x += mWidthInc;
+ i++;
+ }
+ y += mHeightInc;
+ }
+ }
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int width = mPaddingLeft + mPaddingRight;
- int height = mPaddingTop + mPaddingBottom;
-
// Measure the first child and get it's size
View child = getChildAt(0);
child.measure(MeasureSpec.UNSPECIFIED , MeasureSpec.UNSPECIFIED);
- int childWidth = child.getMeasuredWidth();
- int childHeight = child.getMeasuredHeight();
+
// Make sure the other children are measured as well, to initialize
for (int i = 1; i < getChildCount(); i++) {
getChildAt(i).measure(MeasureSpec.UNSPECIFIED , MeasureSpec.UNSPECIFIED);
}
- // All cells are going to be the size of the first child
- width += mColumns * childWidth;
- final int finalWidth = resolveSize(width, widthMeasureSpec);
- // The vertical padding between button must be the same as the
- // horizontal one. The cumulative horizontal padding is the
- // difference between 'width' and 'finalWidth'.
- final int padding = (finalWidth - width) / mColumns;
+ // Store these to be reused in onLayout.
+ mButtonWidth = child.getMeasuredWidth();
+ mButtonHeight = child.getMeasuredHeight();
+ mWidthInc = mButtonWidth + mPaddingLeft + mPaddingRight;
+ mHeightInc = mButtonHeight + mPaddingTop + mPaddingBottom;
- height += getRows() * (childHeight + padding);
+ final int width = resolveSize(COLUMNS * mWidthInc, widthMeasureSpec);
+ final int height = resolveSize(ROWS * mHeightInc, heightMeasureSpec);
- final int finalHeight = resolveSize(height, heightMeasureSpec);
- setMeasuredDimension(finalWidth, finalHeight);
+ setMeasuredDimension(width, height);
}
}
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 6d2ea57..f164289 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -40,6 +40,7 @@
import android.content.res.Resources;
import android.database.CharArrayBuffer;
import android.database.Cursor;
+import android.database.MatrixCursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
@@ -160,6 +161,14 @@
*/
public static final String EXTRA_AGGREGATE_ID =
"com.android.contacts.action.AGGREGATE_ID";
+ /**
+ * Used with {@link #JOIN_AGGREGATE} to give it the name of the aggregation target.
+ * <p>
+ * Type: STRING
+ */
+ public static final String EXTRA_AGGREGATE_NAME =
+ "com.android.contacts.action.AGGREGATE_NAME";
+
public static final String AUTHORITIES_FILTER_KEY = "authorities";
@@ -351,9 +360,21 @@
private static final String CLAUSE_ONLY_VISIBLE = Contacts.IN_VISIBLE_GROUP + "=1";
private static final String CLAUSE_ONLY_PHONES = Contacts.HAS_PHONE_NUMBER + "=1";
+ /**
+ * In the {@link #MODE_JOIN} determines whether we display a list item with the label
+ * "Show all contacts" or actually show all contacts
+ */
+ private boolean mJoinModeShowAllContacts;
+
+ /**
+ * The ID of the special item described above.
+ */
+ private static final long JOIN_MODE_SHOW_ALL_CONTACTS_ID = -2;
+
// Uri matcher for contact id
private static final int CONTACTS_ID = 1001;
private static final UriMatcher sContactsIdMatcher;
+
static {
sContactsIdMatcher = new UriMatcher(UriMatcher.NO_MATCH);
sContactsIdMatcher.addURI(ContactsContract.AUTHORITY, "contacts/#", CONTACTS_ID);
@@ -550,6 +571,15 @@
if (mMode == MODE_JOIN_CONTACT) {
setContentView(R.layout.contacts_list_content_join);
+ TextView blurbView = (TextView)findViewById(R.id.join_contact_blurb);
+ String contactName = intent.getStringExtra(EXTRA_AGGREGATE_NAME);
+ if (contactName == null) {
+ contactName = "";
+ }
+
+ String blurb = getString(R.string.blurbJoinContactDataWith, contactName);
+ blurbView.setText(blurb);
+ mJoinModeShowAllContacts = true;
} else {
setContentView(R.layout.contacts_list_content);
}
@@ -566,14 +596,9 @@
list.setTextFilterEnabled(true);
}
- final LayoutInflater inflater = getLayoutInflater();
- if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
- View totalContacts = inflater.inflate(R.layout.total_contacts, list, false);
- list.addHeaderView(totalContacts);
- }
-
if ((mMode & MODE_MASK_CREATE_NEW) != 0) {
// Add the header for creating a new contact
+ final LayoutInflater inflater = getLayoutInflater();
View header = inflater.inflate(R.layout.create_new_contact, list, false);
list.addHeaderView(header);
}
@@ -585,11 +610,6 @@
setListAdapter(mAdapter);
getListView().setOnScrollListener(mAdapter);
- if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
- TextView totalContacts = (TextView) findViewById(R.id.totalContactsText);
- totalContacts.setVisibility(View.VISIBLE);
- }
-
// We manually save/restore the listview state
list.setSaveEnabled(false);
@@ -1094,13 +1114,6 @@
getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(mList.getWindowToken(), 0);
- if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
- if (position == 0) {
- return;
- }
- position--;
- }
-
if (mMode == MODE_INSERT_OR_EDIT_CONTACT) {
Intent intent;
if (position == 0) {
@@ -1132,7 +1145,12 @@
final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivityForResult(intent, SUBACTIVITY_VIEW_CONTACT);
} else if (mMode == MODE_JOIN_CONTACT) {
- returnPickerResult(null, null, uri, id);
+ if (id == JOIN_MODE_SHOW_ALL_CONTACTS_ID) {
+ mJoinModeShowAllContacts = false;
+ startQuery();
+ } else {
+ returnPickerResult(null, null, uri, id);
+ }
} else if (mMode == MODE_QUERY_PICK_TO_VIEW) {
// Started with query that should launch to view contact
final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
@@ -1544,7 +1562,10 @@
mQueryHandler.setLoadingJoinSuggestions(false);
String[] projection = getProjectionForQuery();
- Uri uri = getUriToQuery();
+ Uri uri = getUriToQuery().buildUpon()
+ .appendQueryParameter(ContactsContract.REQUESTING_PACKAGE_PARAM_KEY,
+ getCallingPackage())
+ .build();
// Kick off the new query
switch (mMode) {
@@ -1698,6 +1719,7 @@
Cursor cursor = resolver.query(getJoinSuggestionsUri(filter), projection, null,
null, null);
mAdapter.setSuggestionsCursor(cursor);
+ mJoinModeShowAllContacts = false;
return resolver.query(getContactFilterUri(filter), projection,
Contacts._ID + " != " + mQueryAggregateId + " AND " + CLAUSE_ONLY_VISIBLE,
null, getSortOrder(projection));
@@ -1706,6 +1728,15 @@
throw new UnsupportedOperationException("filtering not allowed in mode " + mMode);
}
+ private Cursor getShowAllContactsLabelCursor(String[] projection) {
+ MatrixCursor matrixCursor = new MatrixCursor(projection);
+ Object[] row = new Object[projection.length];
+ // The only columns we care about is the id
+ row[SUMMARY_ID_COLUMN_INDEX] = JOIN_MODE_SHOW_ALL_CONTACTS_ID;
+ matrixCursor.addRow(row);
+ return matrixCursor;
+ }
+
/**
* Calls the currently selected list item.
* @return true if the call was initiated, false otherwise
@@ -1835,15 +1866,21 @@
if (cursor.getCount() > 0) {
activity.mAdapter.setSuggestionsCursor(cursor);
} else {
+ cursor.close();
activity.mAdapter.setSuggestionsCursor(null);
}
- startQuery(QUERY_TOKEN, null, activity.getContactFilterUri(activity.mQuery),
- CONTACTS_SUMMARY_PROJECTION,
- Contacts._ID + " != " + activity.mQueryAggregateId
- + " AND " + CLAUSE_ONLY_VISIBLE, null,
- getSortOrder(CONTACTS_SUMMARY_PROJECTION));
- return;
+ if (activity.mAdapter.mSuggestionsCursorCount == 0
+ || !activity.mJoinModeShowAllContacts) {
+ startQuery(QUERY_TOKEN, null, activity.getContactFilterUri(activity.mQuery),
+ CONTACTS_SUMMARY_PROJECTION,
+ Contacts._ID + " != " + activity.mQueryAggregateId
+ + " AND " + CLAUSE_ONLY_VISIBLE, null,
+ getSortOrder(CONTACTS_SUMMARY_PROJECTION));
+ return;
+ }
+
+ cursor = activity.getShowAllContactsLabelCursor(CONTACTS_SUMMARY_PROJECTION);
}
activity.mAdapter.setLoading(false);
@@ -2071,6 +2108,12 @@
@Override
public int getItemViewType(int position) {
+ if (position == 0 && (mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
+ return IGNORE_ITEM_VIEW_TYPE;
+ }
+ if (isShowAllContactsItemPosition(position)) {
+ return IGNORE_ITEM_VIEW_TYPE;
+ }
if (getSeparatorId(position) != 0) {
// We don't want the separator view to be recycled.
return IGNORE_ITEM_VIEW_TYPE;
@@ -2085,6 +2128,23 @@
"this should only be called when the cursor is valid");
}
+ // handle the total contacts item
+ if (position == 0 && (mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
+ final LayoutInflater inflater = getLayoutInflater();
+ TextView totalContacts = (TextView) inflater.inflate(R.layout.total_contacts,
+ parent, false);
+ int stringId = mDisplayOnlyPhones ? R.string.listTotalPhoneContacts
+ : R.string.listTotalAllContacts;
+ totalContacts.setText(getString(stringId, getCount()));
+ return totalContacts;
+ }
+
+ if (isShowAllContactsItemPosition(position)) {
+ LayoutInflater inflater =
+ (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ return inflater.inflate(R.layout.contacts_list_show_all_item, parent, false);
+ }
+
// Handle the separator specially
int separatorId = getSeparatorId(position);
if (separatorId != 0) {
@@ -2121,6 +2181,11 @@
return v;
}
+ private boolean isShowAllContactsItemPosition(int position) {
+ return mMode == MODE_JOIN_CONTACT && mJoinModeShowAllContacts
+ && mSuggestionsCursorCount != 0 && position == mSuggestionsCursorCount + 2;
+ }
+
private int getSeparatorId(int position) {
int separatorId = 0;
if (position == mFrequentSeparatorPos) {
@@ -2380,12 +2445,6 @@
}
super.changeCursor(cursor);
- if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
- TextView totalContacts = (TextView) findViewById(R.id.totalContactsText);
- int stringId = mDisplayOnlyPhones
- ? R.string.listTotalPhoneContacts : R.string.listTotalAllContacts;
- totalContacts.setText(getString(stringId, cursorCount));
- }
// Update the indexer for the fast scroll widget
updateIndexer(cursor);
}
@@ -2497,6 +2556,12 @@
@Override
public boolean isEnabled(int position) {
+ if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
+ if (position == 0) {
+ return false;
+ }
+ position--;
+ }
if (mSuggestionsCursorCount > 0) {
return position != 0 && position != mSuggestionsCursorCount + 1;
}
@@ -2519,6 +2584,9 @@
}
private int getRealPosition(int pos) {
+ if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
+ pos--;
+ }
if (mSuggestionsCursorCount != 0) {
// When showing suggestions, we have 2 additional list items: the "Suggestions"
// and "All contacts" separators.
diff --git a/src/com/android/contacts/ScrollingTabWidget.java b/src/com/android/contacts/ScrollingTabWidget.java
index 6974a6e..b45abe4 100644
--- a/src/com/android/contacts/ScrollingTabWidget.java
+++ b/src/com/android/contacts/ScrollingTabWidget.java
@@ -18,12 +18,7 @@
import android.content.Context;
import android.graphics.Canvas;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -32,7 +27,6 @@
import android.view.View.OnFocusChangeListener;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
-import android.widget.LinearLayout;
import android.widget.RelativeLayout;
/*
@@ -82,6 +76,7 @@
mTabsScrollWrapper = (HorizontalScrollView) mInflater.inflate(
R.layout.tab_layout, this, false);
mTabsView = (TabStripView) mTabsScrollWrapper.findViewById(android.R.id.tabs);
+ View accountNameView = mInflater.inflate(R.layout.tab_account_name, this, false);
mLeftArrowView.setVisibility(View.INVISIBLE);
mRightArrowView.setVisibility(View.INVISIBLE);
@@ -89,6 +84,7 @@
addView(mTabsScrollWrapper);
addView(mLeftArrowView);
addView(mRightArrowView);
+ addView(accountNameView);
}
@Override
diff --git a/src/com/android/contacts/TwelveKeyDialer.java b/src/com/android/contacts/TwelveKeyDialer.java
index d07d785..58ba9d8 100644
--- a/src/com/android/contacts/TwelveKeyDialer.java
+++ b/src/com/android/contacts/TwelveKeyDialer.java
@@ -1028,6 +1028,8 @@
digits.replace(selectionStart, selectionStart, newDigits);
} else {
digits.replace(selectionStart, selectionEnd, newDigits);
+ // Unselect: back to a regular cursor, just pass the character inserted.
+ mDigits.setSelection(selectionStart + 1);
}
} else {
int len = mDigits.length();
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index b1910d6..8172423 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -215,9 +215,9 @@
mTabWidget.setTabSelectionListener(this);
mTabWidget.setVisibility(View.GONE);
mTabsVisible = false;
+ mAccountName = (TextView) mTabWidget.findViewById(R.id.account_name);
mBelowHeader = findViewById(R.id.below_header);
- mAccountName = (TextView) findViewById(R.id.account_name);
mTabRawContactIdMap = new SparseArray<Long>();
@@ -397,12 +397,14 @@
return;
}
- float tabHeight = getResources().getDimension(R.dimen.tab_height);
+ final Resources resources = getResources();
+ final float tabHeight = resources.getDimension(R.dimen.tab_height)
+ + resources.getDimension(R.dimen.account_name_height);
if (show) {
TranslateAnimation showAnimation = new TranslateAnimation(
Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,
Animation.ABSOLUTE, -tabHeight, Animation.ABSOLUTE, 0);
- showAnimation.setDuration(getResources().getInteger(
+ showAnimation.setDuration(resources.getInteger(
android.R.integer.config_longAnimTime));
showAnimation.setAnimationListener(new AnimationListener() {
@@ -428,7 +430,7 @@
TranslateAnimation hideTabsAnimation = new TranslateAnimation(
Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,
Animation.ABSOLUTE, 0, Animation.ABSOLUTE, -tabHeight);
- hideTabsAnimation.setDuration(getResources().getInteger(
+ hideTabsAnimation.setDuration(resources.getInteger(
android.R.integer.config_longAnimTime));
hideTabsAnimation.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation animation) {
@@ -446,7 +448,7 @@
TranslateAnimation hideListAnimation = new TranslateAnimation(
Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,
Animation.ABSOLUTE, tabHeight, Animation.ABSOLUTE, 0);
- hideListAnimation.setDuration(getResources().getInteger(
+ hideListAnimation.setDuration(resources.getInteger(
android.R.integer.config_longAnimTime));
@@ -761,8 +763,15 @@
* Shows a list of aggregates that can be joined into the currently viewed aggregate.
*/
public void showJoinAggregateActivity() {
+ String displayName = null;
+ if (mCursor.moveToFirst()) {
+ displayName = mCursor.getString(0);
+ }
Intent intent = new Intent(ContactsListActivity.JOIN_AGGREGATE);
intent.putExtra(ContactsListActivity.EXTRA_AGGREGATE_ID, ContentUris.parseId(mUri));
+ if (displayName != null) {
+ intent.putExtra(ContactsListActivity.EXTRA_AGGREGATE_NAME, displayName);
+ }
startActivityForResult(intent, REQUEST_JOIN_CONTACT);
}
@@ -945,13 +954,11 @@
continue;
}
- if (mTabsVisible) {
- final String accountName = entValues.getAsString(RawContacts.ACCOUNT_NAME);
- mAccountName.setText(getString(R.string.account_name_format, accountName));
- mAccountName.setVisibility(View.VISIBLE);
- } else {
- mAccountName.setVisibility(View.GONE);
- }
+ final ContactsSource source = sources.getInflatedSource(accountType,
+ ContactsSource.LEVEL_SUMMARY);
+ final String accountName = entValues.getAsString(RawContacts.ACCOUNT_NAME);
+ mAccountName.setText(getString(R.string.account_name_format,
+ source.getDisplayLabel(this), accountName));
for (NamedContentValues subValue : entity.getSubValues()) {
ViewEntry entry = new ViewEntry();
diff --git a/src/com/android/contacts/ui/DisplayGroupsActivity.java b/src/com/android/contacts/ui/DisplayGroupsActivity.java
index dcbe0f6..7bd7b9d 100644
--- a/src/com/android/contacts/ui/DisplayGroupsActivity.java
+++ b/src/com/android/contacts/ui/DisplayGroupsActivity.java
@@ -187,6 +187,7 @@
*/
protected static class GroupDelta extends ValuesDelta {
private boolean mUngrouped = false;
+ private boolean mAccountHasGroups;
private GroupDelta() {
super();
@@ -197,7 +198,7 @@
* {@link Settings#ACCOUNT_NAME} and {@link Settings#ACCOUNT_TYPE}.
*/
public static GroupDelta fromSettings(ContentResolver resolver, String accountName,
- String accountType) {
+ String accountType, boolean accountHasGroups) {
final Uri settingsUri = Settings.CONTENT_URI.buildUpon()
.appendQueryParameter(Settings.ACCOUNT_NAME, accountName)
.appendQueryParameter(Settings.ACCOUNT_TYPE, accountType).build();
@@ -214,12 +215,12 @@
// Read existing values when present
values.put(Settings.SHOULD_SYNC, cursor.getInt(0));
values.put(Settings.UNGROUPED_VISIBLE, cursor.getInt(1));
- return fromBefore(values).setUngrouped();
+ return fromBefore(values).setUngrouped(accountHasGroups);
} else {
// Nothing found, so treat as create
values.put(Settings.SHOULD_SYNC, DEFAULT_SHOULD_SYNC);
values.put(Settings.UNGROUPED_VISIBLE, DEFAULT_VISIBLE);
- return fromAfter(values).setUngrouped();
+ return fromAfter(values).setUngrouped(accountHasGroups);
}
} finally {
if (cursor != null) cursor.close();
@@ -240,8 +241,9 @@
return entry;
}
- protected GroupDelta setUngrouped() {
+ protected GroupDelta setUngrouped(boolean accountHasGroups) {
mUngrouped = true;
+ mAccountHasGroups = accountHasGroups;
return this;
}
@@ -270,7 +272,11 @@
public CharSequence getTitle(Context context) {
if (mUngrouped) {
- return context.getText(R.string.display_ungrouped);
+ if (mAccountHasGroups) {
+ return context.getText(R.string.display_ungrouped);
+ } else {
+ return context.getText(R.string.display_all_contacts);
+ }
} else {
final Integer titleRes = getAsInteger(Groups.TITLE_RES);
if (titleRes != null) {
@@ -359,9 +365,7 @@
mName = accountName;
mType = accountType;
- // Create single entry handling ungrouped status
- mUngrouped = GroupDelta.fromSettings(resolver, accountName, accountType);
- addGroup(mUngrouped);
+ boolean hasGroups = false;
final Uri groupsUri = Groups.CONTENT_URI.buildUpon()
.appendQueryParameter(Groups.ACCOUNT_NAME, accountName)
@@ -374,12 +378,17 @@
final ContentValues values = iterator.next().getEntityValues();
final GroupDelta group = GroupDelta.fromBefore(values);
addGroup(group);
+ hasGroups = true;
}
} catch (RemoteException e) {
Log.w(TAG, "Problem reading groups: " + e.toString());
} finally {
if (iterator != null) iterator.close();
}
+
+ // Create single entry handling ungrouped status
+ mUngrouped = GroupDelta.fromSettings(resolver, accountName, accountType, hasGroups);
+ addGroup(mUngrouped);
}
/**
diff --git a/src/com/android/contacts/ui/EditContactActivity.java b/src/com/android/contacts/ui/EditContactActivity.java
index 14f80b9..450f4a9 100644
--- a/src/com/android/contacts/ui/EditContactActivity.java
+++ b/src/com/android/contacts/ui/EditContactActivity.java
@@ -126,7 +126,7 @@
mTabWidget = (ScrollingTabWidget)this.findViewById(R.id.tab_widget);
mTabWidget.setTabSelectionListener(this);
- mAccountName = (TextView)this.findViewById(R.id.account_name);
+ mAccountName = (TextView)mTabWidget.findViewById(R.id.account_name);
// Build editor and listen for photo requests
mEditor = (ContactEditorView)this.findViewById(android.R.id.tabcontent);
@@ -181,7 +181,7 @@
}
} else if (android.provider.Contacts.AUTHORITY.equals(authority)) {
final long rawContactId = ContentUris.parseId(data);
- selection = RawContacts._ID + "=" + rawContactId;
+ selection = Data.RAW_CONTACT_ID + "=" + rawContactId;
}
target.mQuerySelection = selection;
@@ -402,7 +402,8 @@
final ContactsSource source = sources.getInflatedSource(accountType,
ContactsSource.LEVEL_CONSTRAINTS);
- mAccountName.setText(getString(R.string.account_name_format, accountName));
+ mAccountName.setText(getString(R.string.account_name_format,
+ source.getDisplayLabel(this), accountName));
mAccountName.setVisibility(View.VISIBLE);
// Assign editor state based on entity and source
diff --git a/src/com/android/contacts/ui/widget/DontPressWithParentImageView.java b/src/com/android/contacts/ui/widget/DontPressWithParentImageView.java
new file mode 100644
index 0000000..bdb0e0a
--- /dev/null
+++ b/src/com/android/contacts/ui/widget/DontPressWithParentImageView.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2009 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.contacts.ui.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageView;
+
+/**
+ * Special class to to allow the parent to be pressed without being pressed itself.
+ * This way the line of a tab can be pressed, but the image itself is not.
+ */
+public class DontPressWithParentImageView extends ImageView {
+
+ public DontPressWithParentImageView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public void setPressed(boolean pressed) {
+ // If the parent is pressed, do not set to pressed.
+ if (pressed && ((View) getParent()).isPressed()) {
+ return;
+ }
+ super.setPressed(pressed);
+ }
+}