Merge "Replace tab texts with icons"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 01a6f95..a1829d1 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -557,12 +557,6 @@
android:theme="@android:style/Theme.Translucent">
</activity>
- <!-- Makes .PeopleActivity the search target for any activity in Contacts -->
- <meta-data
- android:name="android.app.default_searchable"
- android:value=".activities.PeopleActivity" />
-
-
<!-- LIVE FOLDERS -->
<activity
android:name=".ContactsLiveFolders$AllContacts"
diff --git a/res/drawable-hdpi/ab_stacked_solid_inverse_holo.9.png b/res/drawable-hdpi/ab_stacked_solid_inverse_holo.9.png
new file mode 100644
index 0000000..42528b1
--- /dev/null
+++ b/res/drawable-hdpi/ab_stacked_solid_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ab_stacked_solid_inverse_holo.9.png b/res/drawable-mdpi/ab_stacked_solid_inverse_holo.9.png
new file mode 100644
index 0000000..a823841
--- /dev/null
+++ b/res/drawable-mdpi/ab_stacked_solid_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ab_stacked_solid_inverse_holo.9.png b/res/drawable-xhdpi/ab_stacked_solid_inverse_holo.9.png
new file mode 100644
index 0000000..16b9bef
--- /dev/null
+++ b/res/drawable-xhdpi/ab_stacked_solid_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable/group_source_button_background.xml b/res/drawable/group_source_button_background.xml
new file mode 100644
index 0000000..7ebf604
--- /dev/null
+++ b/res/drawable/group_source_button_background.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+ <item android:state_pressed="true" android:drawable="@drawable/action_bar_item_pressed_holo_light"/>
+ <item android:drawable="@drawable/ab_stacked_solid_inverse_holo" />
+</selector>
diff --git a/res/layout-land/group_editor_view.xml b/res/layout-land/group_editor_view.xml
new file mode 100644
index 0000000..293e529
--- /dev/null
+++ b/res/layout-land/group_editor_view.xml
@@ -0,0 +1,59 @@
+<?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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="8dip"
+ android:paddingRight="8dip"
+ android:orientation="horizontal"
+ >
+
+ <EditText
+ android:id="@+id/group_name"
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:inputType="textCapWords"
+ android:imeOptions="flagNoExtractUi|flagNoFullscreen"
+ android:hint="@string/group_name_hint"
+ android:minHeight="48dip"
+ android:paddingRight="8dip"
+ />
+
+ <LinearLayout
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:paddingLeft="8dip"
+ android:orientation="vertical"
+ >
+ <include
+ layout="@layout/group_editor_autocomplete_view"
+ android:id="@+id/add_member_field"/>
+ <include
+ layout="@layout/group_editor_existing_member_list"
+ android:id="@android:id/list"/>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
diff --git a/res/layout-sw580dp/group_editor_view.xml b/res/layout-sw580dp/group_editor_view.xml
index a31a36a..a16c240 100644
--- a/res/layout-sw580dp/group_editor_view.xml
+++ b/res/layout-sw580dp/group_editor_view.xml
@@ -41,7 +41,6 @@
android:layout_height="wrap_content"
android:minHeight="48dip"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textStyle="bold"
android:inputType="textCapWords"
android:hint="@string/group_name_hint"
android:paddingLeft="16dip"/>
diff --git a/res/layout-w470dp/contact_detail_fragment.xml b/res/layout-w470dp/contact_detail_fragment.xml
index b523ff8..415bb56 100644
--- a/res/layout-w470dp/contact_detail_fragment.xml
+++ b/res/layout-w470dp/contact_detail_fragment.xml
@@ -39,12 +39,10 @@
<ImageView android:id="@+id/photo"
android:scaleType="centerCrop"
- android:layout_width="100dip"
- android:layout_height="100dip"
+ android:layout_width="128dip"
+ android:layout_height="128dip"
android:layout_marginLeft="@dimen/detail_contact_photo_margin"
- android:layout_marginRight="@dimen/detail_contact_photo_margin"
- android:layout_marginTop="@dimen/detail_contact_photo_margin"
- android:layout_marginBottom="@dimen/detail_contact_photo_margin"/>
+ android:layout_marginTop="@dimen/detail_contact_photo_margin"/>
<ListView android:id="@android:id/list"
android:layout_width="0dip"
diff --git a/res/layout-w470dp/group_source_button.xml b/res/layout-w470dp/group_source_button.xml
index fb57e83..1acd510 100644
--- a/res/layout-w470dp/group_source_button.xml
+++ b/res/layout-w470dp/group_source_button.xml
@@ -24,9 +24,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:divider="?android:attr/dividerVertical"
- android:showDividers="end"
- android:dividerPadding="12dip"
android:orientation="horizontal"
style="?android:attr/actionButtonStyle">
@@ -34,7 +31,6 @@
android:id="@+id/group_source"
android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:paddingRight="5dip"
android:orientation="horizontal">
<TextView
diff --git a/res/layout/contact_tile_frequent.xml b/res/layout/contact_tile_frequent.xml
index 52b7126..b9d637d 100644
--- a/res/layout/contact_tile_frequent.xml
+++ b/res/layout/contact_tile_frequent.xml
@@ -26,13 +26,18 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <QuickContactBadge
- android:id="@+id/contact_tile_quick"
- android:layout_width="64dip"
- android:layout_height="64dip"
- android:scaleType="centerCrop"
- android:focusable="true"
- android:layout_alignParentRight="true" />
+ <view
+ class="com.android.contacts.list.ContactTileImageContainer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <QuickContactBadge
+ android:id="@+id/contact_tile_quick"
+ android:layout_width="64dip"
+ android:layout_height="64dip"
+ android:scaleType="centerCrop"
+ android:focusable="true"
+ android:layout_alignParentRight="true" />
+ </view>
<LinearLayout
android:layout_width="match_parent"
diff --git a/res/layout/contact_tile_frequent_phone.xml b/res/layout/contact_tile_frequent_phone.xml
index 7d24cef..1f5171d 100644
--- a/res/layout/contact_tile_frequent_phone.xml
+++ b/res/layout/contact_tile_frequent_phone.xml
@@ -27,14 +27,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <QuickContactBadge
- android:id="@id/contact_tile_quick"
- android:nextFocusRight="@id/contact_tile_frequent_phone"
- android:layout_width="64dip"
- android:layout_height="64dip"
- android:scaleType="centerCrop"
- android:focusable="true"
- android:layout_alignParentLeft="true" />
+ <view
+ class="com.android.contacts.list.ContactTileImageContainer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <QuickContactBadge
+ android:id="@id/contact_tile_quick"
+ android:nextFocusRight="@id/contact_tile_frequent_phone"
+ android:layout_width="64dip"
+ android:layout_height="64dip"
+ android:scaleType="centerCrop"
+ android:focusable="true"
+ android:layout_alignParentLeft="true" />
+ </view>
<TextView
android:id="@+id/contact_tile_name"
diff --git a/res/layout/contact_tile_starred.xml b/res/layout/contact_tile_starred.xml
index 3f8d91d..4116157 100644
--- a/res/layout/contact_tile_starred.xml
+++ b/res/layout/contact_tile_starred.xml
@@ -25,11 +25,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <ImageView
- android:id="@+id/contact_tile_image"
+ <view
+ class="com.android.contacts.list.ContactTileImageContainer"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop" />
+ android:layout_height="match_parent">
+ <ImageView
+ android:id="@+id/contact_tile_image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop" />
+ </view>
<LinearLayout
android:layout_width="match_parent"
@@ -63,6 +68,7 @@
android:paddingBottom="4dip"
android:fadingEdge="horizontal"
android:fadingEdgeLength="3dip"
+ android:layout_marginTop="-3dip"
android:ellipsize="marquee" />
</LinearLayout>
diff --git a/res/layout/contact_tile_starred_quick_contact.xml b/res/layout/contact_tile_starred_quick_contact.xml
index 3f072d1..223f1b8 100644
--- a/res/layout/contact_tile_starred_quick_contact.xml
+++ b/res/layout/contact_tile_starred_quick_contact.xml
@@ -24,11 +24,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <ImageView
- android:id="@+id/contact_tile_image"
+ <view
+ class="com.android.contacts.list.ContactTileImageContainer"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop" />
+ android:layout_height="match_parent">
+ <ImageView
+ android:id="@+id/contact_tile_image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop" />
+ </view>
<LinearLayout
android:layout_width="match_parent"
@@ -61,6 +66,7 @@
android:drawablePadding="4dip"
android:fadingEdge="horizontal"
android:fadingEdgeLength="3dip"
+ android:layout_marginTop="-3dip"
android:ellipsize="marquee" />
</LinearLayout>
diff --git a/res/layout/contact_tile_starred_secondary_target.xml b/res/layout/contact_tile_starred_secondary_target.xml
index 6543dc1..2ce59c5 100644
--- a/res/layout/contact_tile_starred_secondary_target.xml
+++ b/res/layout/contact_tile_starred_secondary_target.xml
@@ -24,11 +24,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <ImageView
- android:id="@+id/contact_tile_image"
+ <view
+ class="com.android.contacts.list.ContactTileImageContainer"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop" />
+ android:layout_height="match_parent">
+ <ImageView
+ android:id="@+id/contact_tile_image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop" />
+ </view>
<TextView
android:id="@+id/contact_tile_name"
diff --git a/res/layout/group_detail_fragment.xml b/res/layout/group_detail_fragment.xml
index 34eb285..d95a6db 100644
--- a/res/layout/group_detail_fragment.xml
+++ b/res/layout/group_detail_fragment.xml
@@ -20,18 +20,37 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
+ <!--
+ This layout can contain the second row of the action bar containing a group source
+ button if applicable (this is a fake stacked action bar)
+ -->
<FrameLayout
android:id="@+id/group_source_view_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical" />
+ android:layout_gravity="center_vertical"/>
- <ListView
- android:id="@android:id/list"
+ <FrameLayout
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="1"
- android:fadingEdge="none"
- android:scrollbarStyle="outsideOverlay"/>
+ android:layout_weight="1">
+
+ <ListView
+ android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fadingEdge="none"
+ android:scrollbarStyle="outsideOverlay"/>
+
+ <!--
+ Shadow overlay over the list of group members (since we have a fake stacked
+ action bar)
+ -->
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="20dip"
+ android:background="?android:attr/windowContentOverlay"/>
+
+ </FrameLayout>
</LinearLayout>
diff --git a/res/layout/group_editor_autocomplete_view.xml b/res/layout/group_editor_autocomplete_view.xml
index 46539de..8482ab5 100644
--- a/res/layout/group_editor_autocomplete_view.xml
+++ b/res/layout/group_editor_autocomplete_view.xml
@@ -22,6 +22,7 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorPrimary"
+ android:imeOptions="flagNoExtractUi|flagNoFullscreen"
android:hint="@string/enter_contact_name"
android:minHeight="48dip"
android:paddingLeft="@dimen/group_editor_autocomplete_left_padding"/>
\ No newline at end of file
diff --git a/res/layout/group_editor_view.xml b/res/layout/group_editor_view.xml
index e94b387..19cb82d 100644
--- a/res/layout/group_editor_view.xml
+++ b/res/layout/group_editor_view.xml
@@ -35,8 +35,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textStyle="bold"
android:inputType="textCapWords"
+ android:imeOptions="flagNoExtractUi|flagNoFullscreen"
android:hint="@string/group_name_hint"
android:minHeight="48dip"
android:paddingLeft="8dip"/>
diff --git a/res/layout/group_source_button.xml b/res/layout/group_source_button.xml
index 0aa9c58..49aa2db 100644
--- a/res/layout/group_source_button.xml
+++ b/res/layout/group_source_button.xml
@@ -24,8 +24,10 @@
android:id="@+id/group_source"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="?android:attr/selectableItemBackground"
- android:padding="10dip" >
+ android:minHeight="48dip"
+ android:background="@drawable/group_source_button_background"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip" >
<TextView
android:layout_width="0dip"
@@ -34,15 +36,21 @@
android:layout_gravity="center_vertical"
android:duplicateParentState="true"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/view_updates_from_group"/>
+ android:textColor="@color/action_bar_button_text_color"
+ android:text="@string/view_updates_from_group"
+ style="@android:style/Widget.Holo.ActionBar.TabText"/>
- <ImageView
- android:id="@android:id/icon"
- android:layout_width="30dip"
- android:layout_height="30dip"
- android:duplicateParentState="true"
- android:layout_marginLeft="7dip"
- android:layout_marginRight="7dip"
- android:layout_centerVertical="true"/>
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:id="@android:id/icon"
+ android:layout_width="32dip"
+ android:layout_height="32dip"
+ android:duplicateParentState="true"
+ android:layout_gravity="center_vertical"/>
+
+ </FrameLayout>
</LinearLayout>
diff --git a/res/layout/select_dialog_item.xml b/res/layout/select_dialog_item.xml
new file mode 100644
index 0000000..ea671dd
--- /dev/null
+++ b/res/layout/select_dialog_item.xml
@@ -0,0 +1,33 @@
+<?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.
+-->
+
+<!--
+ List item in the pop-up window that appears when tapping a contact's photo
+ in the contact editor. This is similar to the framework's select_dialog_item.xml layout
+ except the text appearance is medium.
+-->
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/text1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="48dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorAlertDialogListItem"
+ android:gravity="center_vertical"
+ android:paddingLeft="14dip"
+ android:paddingRight="15dip"
+ android:ellipsize="marquee"
+/>
diff --git a/res/layout/stream_item_row_image_and_text.xml b/res/layout/stream_item_row_one_image.xml
similarity index 89%
rename from res/layout/stream_item_row_image_and_text.xml
rename to res/layout/stream_item_row_one_image.xml
index 0ee6357..03dcedf 100644
--- a/res/layout/stream_item_row_image_and_text.xml
+++ b/res/layout/stream_item_row_one_image.xml
@@ -25,7 +25,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/detail_update_section_between_items_padding"
android:orientation="horizontal"
android:weightSum="2">
@@ -48,8 +47,4 @@
</LinearLayout>
- <include
- android:id="@+id/stream_item_second_text"
- layout="@layout/stream_item_row_text_only"/>
-
</LinearLayout>
diff --git a/res/layout/stream_item_row_text_only.xml b/res/layout/stream_item_row_text.xml
similarity index 95%
rename from res/layout/stream_item_row_text_only.xml
rename to res/layout/stream_item_row_text.xml
index 9d82edd..919ee52 100644
--- a/res/layout/stream_item_row_text_only.xml
+++ b/res/layout/stream_item_row_text.xml
@@ -17,7 +17,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/detail_update_section_between_items_padding"
android:orientation="vertical">
<TextView android:id="@+id/stream_item_html"
diff --git a/res/values-sw580dp-w1000dp/dimens.xml b/res/values-sw580dp-w1000dp/dimens.xml
index 7329930..f1b607c 100644
--- a/res/values-sw580dp-w1000dp/dimens.xml
+++ b/res/values-sw580dp-w1000dp/dimens.xml
@@ -15,5 +15,6 @@
-->
<resources>
<dimen name="group_detail_border_padding">32dip</dimen>
+ <dimen name="detail_contact_photo_margin">16dip</dimen>
<dimen name="contact_detail_list_top_padding">32dip</dimen>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index cd02d04..defd229 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -61,17 +61,20 @@
<!-- Vertical padding above and below individual stream items -->
<dimen name="detail_update_section_item_vertical_padding">16dip</dimen>
+ <!-- Vertical padding between text and images in a single stream item -->
+ <dimen name="detail_update_section_between_items_vertical_padding">8dip</dimen>
+
<!-- Horizontal padding for individual stream items -->
<dimen name="detail_update_section_item_horizontal_padding">8dip</dimen>
- <!-- Padding between columns images and/or text in a single stream item -->
+ <!-- Padding between images in a single stream item -->
<dimen name="detail_update_section_between_items_padding">1dip</dimen>
<!-- Horizontal padding between attribution and comments -->
<dimen name="detail_update_section_attribution_comments_padding">4dip</dimen>
<!-- Margin around the contact's photo on the contact card -->
- <dimen name="detail_contact_photo_margin">16dip</dimen>
+ <dimen name="detail_contact_photo_margin">8dip</dimen>
<!-- Width and height of the contact photo on the contact detail page -->
<dimen name="detail_contact_photo_size">256dip</dimen>
diff --git a/src/com/android/contacts/CallDetailActivity.java b/src/com/android/contacts/CallDetailActivity.java
index e008516..7d9b758 100644
--- a/src/com/android/contacts/CallDetailActivity.java
+++ b/src/com/android/contacts/CallDetailActivity.java
@@ -688,16 +688,6 @@
}
}
- @Override
- public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData,
- boolean globalSearch) {
- if (globalSearch) {
- super.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
- } else {
- ContactsSearchManager.startSearch(this, initialQuery);
- }
- }
-
protected void updateVoicemailStatusMessage(Cursor statusCursor) {
if (statusCursor == null) {
mStatusMessageView.setVisibility(View.GONE);
diff --git a/src/com/android/contacts/activities/CallLogActivity.java b/src/com/android/contacts/activities/CallLogActivity.java
index 4f1c8d9..dd81dab 100644
--- a/src/com/android/contacts/activities/CallLogActivity.java
+++ b/src/com/android/contacts/activities/CallLogActivity.java
@@ -16,7 +16,6 @@
package com.android.contacts.activities;
-import com.android.contacts.ContactsSearchManager;
import com.android.contacts.R;
import com.android.contacts.calllog.CallLogFragment;
import com.android.internal.telephony.ITelephony;
@@ -99,14 +98,4 @@
}
return super.onKeyUp(keyCode, event);
}
-
- @Override
- public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData,
- boolean globalSearch) {
- if (globalSearch) {
- super.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
- } else {
- ContactsSearchManager.startSearch(this, initialQuery);
- }
- }
}
diff --git a/src/com/android/contacts/activities/ContactDetailActivity.java b/src/com/android/contacts/activities/ContactDetailActivity.java
index 5921bab..49d6672 100644
--- a/src/com/android/contacts/activities/ContactDetailActivity.java
+++ b/src/com/android/contacts/activities/ContactDetailActivity.java
@@ -124,11 +124,6 @@
}
@Override
- public boolean onSearchRequested() {
- return true; // Don't respond to the search key.
- }
-
- @Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
diff --git a/src/com/android/contacts/activities/ContactEditorActivity.java b/src/com/android/contacts/activities/ContactEditorActivity.java
index c69cc04..abdde87 100644
--- a/src/com/android/contacts/activities/ContactEditorActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorActivity.java
@@ -131,11 +131,6 @@
}
@Override
- public boolean onSearchRequested() {
- return true; // Don't respond to the search key.
- }
-
- @Override
public void onBackPressed() {
mFragment.save(SaveMode.CLOSE);
}
diff --git a/src/com/android/contacts/activities/GroupDetailActivity.java b/src/com/android/contacts/activities/GroupDetailActivity.java
index 47e02a7..2708d5d 100644
--- a/src/com/android/contacts/activities/GroupDetailActivity.java
+++ b/src/com/android/contacts/activities/GroupDetailActivity.java
@@ -169,9 +169,4 @@
}
return super.onOptionsItemSelected(item);
}
-
- @Override
- public boolean onSearchRequested() {
- return true; // Don't respond to the search key.
- }
}
diff --git a/src/com/android/contacts/activities/GroupEditorActivity.java b/src/com/android/contacts/activities/GroupEditorActivity.java
index 544cd16..7fed0f8 100644
--- a/src/com/android/contacts/activities/GroupEditorActivity.java
+++ b/src/com/android/contacts/activities/GroupEditorActivity.java
@@ -106,11 +106,6 @@
}
@Override
- public boolean onSearchRequested() {
- return true; // Don't respond to the search key.
- }
-
- @Override
public void onBackPressed() {
// If the change could not be saved, then revert to the default "back" button behavior.
if (!mFragment.save(SaveMode.CLOSE)) {
diff --git a/src/com/android/contacts/activities/JoinContactActivity.java b/src/com/android/contacts/activities/JoinContactActivity.java
index 725a9e7..b948b71 100644
--- a/src/com/android/contacts/activities/JoinContactActivity.java
+++ b/src/com/android/contacts/activities/JoinContactActivity.java
@@ -29,9 +29,6 @@
import android.os.Bundle;
import android.provider.ContactsContract;
import android.util.Log;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
@@ -136,11 +133,6 @@
}
@Override
- public boolean onSearchRequested() {
- return false;
- }
-
- @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == ContactEntryListFragment.ACTIVITY_REQUEST_CODE_PICKER
&& resultCode == RESULT_OK) {
diff --git a/src/com/android/contacts/activities/ShowOrCreateActivity.java b/src/com/android/contacts/activities/ShowOrCreateActivity.java
index 5e14db4..c60d0fb 100755
--- a/src/com/android/contacts/activities/ShowOrCreateActivity.java
+++ b/src/com/android/contacts/activities/ShowOrCreateActivity.java
@@ -17,7 +17,6 @@
package com.android.contacts.activities;
import com.android.contacts.ContactsActivity;
-import com.android.contacts.ContactsSearchManager;
import com.android.contacts.R;
import com.android.contacts.util.Constants;
import com.android.contacts.util.NotifyingAsyncQueryHandler;
@@ -258,14 +257,4 @@
mParent.finish();
}
}
-
- @Override
- public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData,
- boolean globalSearch) {
- if (globalSearch) {
- super.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
- } else {
- ContactsSearchManager.startSearch(this, initialQuery);
- }
- }
}
diff --git a/src/com/android/contacts/detail/ContactDetailDisplayUtils.java b/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
index f94629b..f6690d6 100644
--- a/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
+++ b/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
@@ -267,37 +267,46 @@
List<StreamItemPhotoEntry> photos = streamItem.getPhotos();
final int photoCount = photos.size();
- // Process the photos, two at a time.
- for (int index = 0; index < photoCount; index += 2) {
- final StreamItemPhotoEntry firstPhoto = photos.get(index);
- if (index + 1 < photoCount) {
- // Put in two photos, side by side.
- final StreamItemPhotoEntry secondPhoto = photos.get(index + 1);
-
- View photoContainer = inflater.inflate(R.layout.stream_item_row_two_images,
- contentTable, false);
- loadPhoto(contactPhotoManager, streamItem, firstPhoto, photoContainer,
- R.id.stream_item_first_image, photoClickListener);
- loadPhoto(contactPhotoManager, streamItem, secondPhoto, photoContainer,
- R.id.stream_item_second_image, photoClickListener);
- contentTable.addView(photoContainer);
- } else {
- // Put in a single photo with text on the side.
- View photoContainer = inflater.inflate(
- R.layout.stream_item_row_image_and_text, contentTable, false);
- loadPhoto(contactPhotoManager, streamItem, firstPhoto, photoContainer,
- R.id.stream_item_first_image, photoClickListener);
- addStreamItemText(context, streamItem,
- photoContainer.findViewById(R.id.stream_item_second_text));
- contentTable.addView(photoContainer);
- }
- }
-
- if (photoCount % 2 == 0) {
- // Even number of photos, add the text below them. Otherwise, it should have been
- // already added next to the last photo.
- View textContainer = inflater.inflate(R.layout.stream_item_row_text_only, contentTable,
+ // This stream item only has text.
+ if (photoCount == 0) {
+ View textOnlyContainer = inflater.inflate(R.layout.stream_item_row_text, contentTable,
false);
+ addStreamItemText(context, streamItem, textOnlyContainer);
+ contentTable.addView(textOnlyContainer);
+ } else {
+ // This stream item has text and photos. Process the photos, two at a time.
+ for (int index = 0; index < photoCount; index += 2) {
+ final StreamItemPhotoEntry firstPhoto = photos.get(index);
+ if (index + 1 < photoCount) {
+ // Put in two photos, side by side.
+ final StreamItemPhotoEntry secondPhoto = photos.get(index + 1);
+ View photoContainer = inflater.inflate(R.layout.stream_item_row_two_images,
+ contentTable, false);
+ loadPhoto(contactPhotoManager, streamItem, firstPhoto, photoContainer,
+ R.id.stream_item_first_image, photoClickListener);
+ loadPhoto(contactPhotoManager, streamItem, secondPhoto, photoContainer,
+ R.id.stream_item_second_image, photoClickListener);
+ contentTable.addView(photoContainer);
+ } else {
+ // Put in a single photo
+ View photoContainer = inflater.inflate(
+ R.layout.stream_item_row_one_image, contentTable, false);
+ loadPhoto(contactPhotoManager, streamItem, firstPhoto, photoContainer,
+ R.id.stream_item_first_image, photoClickListener);
+ contentTable.addView(photoContainer);
+ }
+ }
+
+ // Add text, comments, and attribution if applicable
+ View textContainer = inflater.inflate(R.layout.stream_item_row_text, contentTable,
+ false);
+ // Add extra padding between the text and the images
+ int extraVerticalPadding = context.getResources().getDimensionPixelSize(
+ R.dimen.detail_update_section_between_items_vertical_padding);
+ textContainer.setPadding(textContainer.getPaddingLeft(),
+ textContainer.getPaddingTop() + extraVerticalPadding,
+ textContainer.getPaddingRight(),
+ textContainer.getPaddingBottom());
addStreamItemText(context, streamItem, textContainer);
contentTable.addView(textContainer);
}
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index bacc5db..775b50a 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -132,6 +132,13 @@
private static final String KEY_CONTACT_URI = "contactUri";
private static final String KEY_LIST_STATE = "liststate";
+ // TODO: Make maxLines a field in {@link DataKind}
+ private static final int WEBSITE_MAX_LINES = 1;
+ private static final int SIP_ADDRESS_MAX_LINES= 1;
+ private static final int POSTAL_ADDRESS_MAX_LINES = 10;
+ private static final int GROUP_MAX_LINES = 10;
+ private static final int NOTE_MAX_LINES = 100;
+
private Context mContext;
private View mView;
private OnScrollListener mVerticalScrollListener;
@@ -632,7 +639,7 @@
}
} else if (StructuredPostal.CONTENT_ITEM_TYPE.equals(mimeType) && hasData) {
// Build postal entries
- entry.maxLines = 4;
+ entry.maxLines = POSTAL_ADDRESS_MAX_LINES;
entry.intent = new Intent(
Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(entry.data)));
mPostalEntries.add(entry);
@@ -665,12 +672,12 @@
} else if (Note.CONTENT_ITEM_TYPE.equals(mimeType) && hasData) {
// Build note entries
entry.uri = null;
- entry.maxLines = 100;
+ entry.maxLines = NOTE_MAX_LINES;
mNoteEntries.add(entry);
} else if (Website.CONTENT_ITEM_TYPE.equals(mimeType) && hasData) {
// Build Website entries
entry.uri = null;
- entry.maxLines = 1;
+ entry.maxLines = WEBSITE_MAX_LINES;
try {
WebAddress webAddress = new WebAddress(entry.data);
entry.intent = new Intent(Intent.ACTION_VIEW,
@@ -682,7 +689,7 @@
} else if (SipAddress.CONTENT_ITEM_TYPE.equals(mimeType) && hasData) {
// Build SipAddress entries
entry.uri = null;
- entry.maxLines = 1;
+ entry.maxLines = SIP_ADDRESS_MAX_LINES;
if (mHasSip) {
entry.intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts(Constants.SCHEME_SIP, entry.data, null));
@@ -747,7 +754,7 @@
entry.mimetype = GroupMembership.MIMETYPE;
entry.kind = mContext.getString(R.string.groupsLabel);
entry.data = sb.toString();
- entry.maxLines = 10;
+ entry.maxLines = GROUP_MAX_LINES;
mGroupEntries.add(entry);
}
}
diff --git a/src/com/android/contacts/detail/ContactDetailTabCarousel.java b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
index 9300b54..4700078 100644
--- a/src/com/android/contacts/detail/ContactDetailTabCarousel.java
+++ b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
@@ -146,6 +146,7 @@
if (mScrollToCurrentTab) {
mScrollToCurrentTab = false;
scrollTo(mCurrentTab == TAB_INDEX_ABOUT ? 0 : mAllowedHorizontalScrollLength, 0);
+ updateAlphaLayers();
}
}
diff --git a/src/com/android/contacts/editor/PhotoActionPopup.java b/src/com/android/contacts/editor/PhotoActionPopup.java
index ac2d64f..cca6f9d 100644
--- a/src/com/android/contacts/editor/PhotoActionPopup.java
+++ b/src/com/android/contacts/editor/PhotoActionPopup.java
@@ -69,7 +69,7 @@
context.getString(resId)));
}
final ListAdapter adapter = new ArrayAdapter<ChoiceListItem>(context,
- android.R.layout.select_dialog_item, choices);
+ R.layout.select_dialog_item, choices);
final ListPopupWindow listPopupWindow = new ListPopupWindow(context);
final OnItemClickListener clickListener = new OnItemClickListener() {
diff --git a/src/com/android/contacts/group/GroupEditorFragment.java b/src/com/android/contacts/group/GroupEditorFragment.java
index fdb3cd4..96e0c8a 100644
--- a/src/com/android/contacts/group/GroupEditorFragment.java
+++ b/src/com/android/contacts/group/GroupEditorFragment.java
@@ -180,9 +180,6 @@
private LayoutInflater mLayoutInflater;
private TextView mGroupNameView;
- private ImageView mAccountIcon;
- private TextView mAccountTypeTextView;
- private TextView mAccountNameTextView;
private AutoCompleteTextView mAutoCompleteTextView;
private String mAccountName;
@@ -404,23 +401,25 @@
}
mGroupNameView = (TextView) editorView.findViewById(R.id.group_name);
- mAccountIcon = (ImageView) editorView.findViewById(R.id.account_icon);
- mAccountTypeTextView = (TextView) editorView.findViewById(R.id.account_type);
- mAccountNameTextView = (TextView) editorView.findViewById(R.id.account_name);
mAutoCompleteTextView = (AutoCompleteTextView) editorView.findViewById(
R.id.add_member_field);
mListView = (ListView) editorView.findViewById(android.R.id.list);
mListView.setAdapter(mMemberListAdapter);
- // Setup the account header
- CharSequence accountTypeDisplayLabel = accountType.getDisplayLabel(mContext);
- if (!TextUtils.isEmpty(mAccountName)) {
- mAccountNameTextView.setText(
- mContext.getString(R.string.from_account_format, mAccountName));
+ // Setup the account header, only when exists.
+ if (editorView.findViewById(R.id.account_header) != null) {
+ CharSequence accountTypeDisplayLabel = accountType.getDisplayLabel(mContext);
+ ImageView accountIcon = (ImageView) editorView.findViewById(R.id.account_icon);
+ TextView accountTypeTextView = (TextView) editorView.findViewById(R.id.account_type);
+ TextView accountNameTextView = (TextView) editorView.findViewById(R.id.account_name);
+ if (!TextUtils.isEmpty(mAccountName)) {
+ accountNameTextView.setText(
+ mContext.getString(R.string.from_account_format, mAccountName));
+ }
+ accountTypeTextView.setText(accountTypeDisplayLabel);
+ accountIcon.setImageDrawable(accountType.getDisplayIcon(mContext));
}
- mAccountTypeTextView.setText(accountTypeDisplayLabel);
- mAccountIcon.setImageDrawable(accountType.getDisplayIcon(mContext));
// Setup the autocomplete adapter (for contacts to suggest to add to the group) based on the
// account name and type. For groups that cannot have membership edited, there will be no
diff --git a/src/com/android/contacts/list/AccountFilterActivity.java b/src/com/android/contacts/list/AccountFilterActivity.java
index f383ec2..aa1fe27 100644
--- a/src/com/android/contacts/list/AccountFilterActivity.java
+++ b/src/com/android/contacts/list/AccountFilterActivity.java
@@ -17,7 +17,6 @@
package com.android.contacts.list;
import com.android.contacts.ContactsActivity;
-import com.android.contacts.ContactsSearchManager;
import com.android.contacts.R;
import com.android.contacts.model.AccountType;
import com.android.contacts.model.AccountTypeManager;
@@ -31,14 +30,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.Loader;
-import android.database.Cursor;
import android.graphics.drawable.Drawable;
-import android.net.Uri;
import android.os.Bundle;
-import android.provider.BaseColumns;
-import android.provider.ContactsContract;
-import android.provider.ContactsContract.RawContacts;
-import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -210,16 +203,6 @@
}
}
- @Override
- public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData,
- boolean globalSearch) {
- if (globalSearch) {
- super.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
- } else {
- ContactsSearchManager.startSearch(this, initialQuery);
- }
- }
-
private static class FilterListAdapter extends BaseAdapter {
private final List<ContactListFilter> mFilters;
private final LayoutInflater mLayoutInflater;
diff --git a/src/com/android/contacts/list/ContactEntryListFragment.java b/src/com/android/contacts/list/ContactEntryListFragment.java
index df2f0cc..e361a19 100644
--- a/src/com/android/contacts/list/ContactEntryListFragment.java
+++ b/src/com/android/contacts/list/ContactEntryListFragment.java
@@ -921,14 +921,6 @@
}
/**
- * Processes a user request to start search. This may be triggered by the
- * search key, a menu item or some other user action.
- */
- public void startSearch(String initialQuery) {
- ContactsSearchManager.startSearch(getActivity(), initialQuery, mRequest);
- }
-
- /**
* Processes a result returned by the contact picker.
*/
public void onPickerResult(Intent data) {
diff --git a/src/com/android/contacts/list/ContactPickerFragment.java b/src/com/android/contacts/list/ContactPickerFragment.java
index 5d0f692..43081e5 100644
--- a/src/com/android/contacts/list/ContactPickerFragment.java
+++ b/src/com/android/contacts/list/ContactPickerFragment.java
@@ -210,12 +210,6 @@
}
@Override
- public void startSearch(String initialQuery) {
- ContactsSearchManager.startSearchForResult(getActivity(), initialQuery,
- ACTIVITY_REQUEST_CODE_PICKER, getContactsRequest());
- }
-
- @Override
public void onPickerResult(Intent data) {
mListener.onPickContactAction(data.getData());
}
diff --git a/src/com/android/contacts/list/ContactTileImageContainer.java b/src/com/android/contacts/list/ContactTileImageContainer.java
new file mode 100644
index 0000000..e1a791b
--- /dev/null
+++ b/src/com/android/contacts/list/ContactTileImageContainer.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package com.android.contacts.list;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.FrameLayout;
+
+/**
+ * Custom container for ImageView or ContactBadge inside {@link ContactTileView}.
+ *
+ * This improves the performance of favorite tabs by not passing the layout request to the parent
+ * views, assuming that once measured this will not need to resize itself.
+ */
+public class ContactTileImageContainer extends FrameLayout {
+
+ public ContactTileImageContainer(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public void requestLayout() {
+ forceLayout();
+ }
+}
\ No newline at end of file
diff --git a/src/com/android/contacts/list/ContactTileView.java b/src/com/android/contacts/list/ContactTileView.java
index 4562864..137f6e7 100644
--- a/src/com/android/contacts/list/ContactTileView.java
+++ b/src/com/android/contacts/list/ContactTileView.java
@@ -151,12 +151,4 @@
public interface Listener {
void onClick(ContactTileView contactTileView);
}
-
- @Override
- public void requestLayout() {
- // We will assume that once measured this will not need to resize
- // itself, so there is no need to pass the layout request to the parent
- // view (ListView).
- forceLayout();
- }
}
diff --git a/src/com/android/contacts/list/CustomContactListFilterActivity.java b/src/com/android/contacts/list/CustomContactListFilterActivity.java
index 1ac1d32..bbfbf32 100644
--- a/src/com/android/contacts/list/CustomContactListFilterActivity.java
+++ b/src/com/android/contacts/list/CustomContactListFilterActivity.java
@@ -17,7 +17,6 @@
package com.android.contacts.list;
import com.android.contacts.ContactsActivity;
-import com.android.contacts.ContactsSearchManager;
import com.android.contacts.R;
import com.android.contacts.model.AccountType;
import com.android.contacts.model.AccountTypeManager;
@@ -896,16 +895,6 @@
}
@Override
- public void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData,
- boolean globalSearch) {
- if (globalSearch) {
- super.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
- } else {
- ContactsSearchManager.startSearch(this, initialQuery);
- }
- }
-
- @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
diff --git a/src/com/android/contacts/list/JoinContactListFragment.java b/src/com/android/contacts/list/JoinContactListFragment.java
index 59b29ed..7931699 100644
--- a/src/com/android/contacts/list/JoinContactListFragment.java
+++ b/src/com/android/contacts/list/JoinContactListFragment.java
@@ -163,15 +163,6 @@
}
@Override
- public void startSearch(String initialQuery) {
- ContactsRequest request = new ContactsRequest();
- request.setActionCode(ContactsRequest.ACTION_PICK_CONTACT);
- request.setDirectorySearchEnabled(false);
- ContactsSearchManager.startSearchForResult(getActivity(), initialQuery,
- ACTIVITY_REQUEST_CODE_PICKER, request);
- }
-
- @Override
public void onPickerResult(Intent data) {
mListener.onPickContactAction(data.getData());
}
diff --git a/src/com/android/contacts/list/PhoneNumberPickerFragment.java b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
index 8eced78..88e5ecf 100644
--- a/src/com/android/contacts/list/PhoneNumberPickerFragment.java
+++ b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
@@ -253,12 +253,6 @@
}
@Override
- public void startSearch(String initialQuery) {
- ContactsSearchManager.startSearchForResult(getActivity(), initialQuery,
- ACTIVITY_REQUEST_CODE_PICKER, getContactsRequest());
- }
-
- @Override
public void onPickerResult(Intent data) {
mListener.onPickPhoneNumberAction(data.getData());
}
diff --git a/src/com/android/contacts/util/HtmlUtils.java b/src/com/android/contacts/util/HtmlUtils.java
index 4663657..faaa9c2 100644
--- a/src/com/android/contacts/util/HtmlUtils.java
+++ b/src/com/android/contacts/util/HtmlUtils.java
@@ -7,6 +7,7 @@
import android.text.Html.TagHandler;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
+import android.text.TextUtils;
import android.text.style.ImageSpan;
import android.text.style.QuoteSpan;
@@ -23,6 +24,9 @@
* Converts HTML string to a {@link Spanned} text, adjusting formatting.
*/
public static Spanned fromHtml(Context context, String text) {
+ if (TextUtils.isEmpty(text)) {
+ return null;
+ }
Spanned spanned = Html.fromHtml(text);
postprocess(context, spanned);
return spanned;
@@ -34,6 +38,9 @@
*/
public static CharSequence fromHtml(Context context, String text, ImageGetter imageGetter,
TagHandler tagHandler) {
+ if (TextUtils.isEmpty(text)) {
+ return null;
+ }
Spanned spanned = Html.fromHtml(text, imageGetter, tagHandler);
postprocess(context, spanned);
return spanned;
diff --git a/tests/src/com/android/contacts/detail/ContactDetailDisplayUtilsTest.java b/tests/src/com/android/contacts/detail/ContactDetailDisplayUtilsTest.java
index 487eec9..3d383ff 100644
--- a/tests/src/com/android/contacts/detail/ContactDetailDisplayUtilsTest.java
+++ b/tests/src/com/android/contacts/detail/ContactDetailDisplayUtilsTest.java
@@ -108,7 +108,7 @@
*/
private View addStreamItemText(StreamItemEntry streamItem) {
return ContactDetailDisplayUtils.addStreamItemText(getContext(), streamItem,
- mLayoutInflater.inflate(R.layout.stream_item_row_text_only, null));
+ mLayoutInflater.inflate(R.layout.stream_item_row_text, null));
}
private StreamItemEntryBuilder getTestBuilder() {