diff options
author | Katherine Kuan <katherinekuan@google.com> | 2011-08-08 17:11:44 -0700 |
---|---|---|
committer | Katherine Kuan <katherinekuan@google.com> | 2011-08-26 20:43:22 -0700 |
commit | 5a7b563bdf571ebc14a1fa5f91f9a393948461cf (patch) | |
tree | 204bb1523fb20a14532c4cf6465a34fc9ffb2949 | |
parent | 37bddc2fa266fa0378fcd85ac5047b1fb0af2dc0 (diff) | |
download | packages_apps_Contacts-5a7b563bdf571ebc14a1fa5f91f9a393948461cf.tar.gz packages_apps_Contacts-5a7b563bdf571ebc14a1fa5f91f9a393948461cf.tar.bz2 packages_apps_Contacts-5a7b563bdf571ebc14a1fa5f91f9a393948461cf.zip |
Use framework style for section headers and visual tweaks
- Use list separator style from framework for the blue headers
in our app (frequent header, recent header, kind type headers)
--> this allows us to get reduce the number of views in our
view tree because the divider is now an asset and part of the
TextView background.
- Adjust padding so it lines up with the new headers now
- Minor visual tweaks
Bug: 5136189
Change-Id: I7b10cc7e608b809d1a97ad8d8c59e31ab9d77e11
24 files changed, 75 insertions, 169 deletions
diff --git a/res/drawable-hdpi/list_section_divider_holo_custom.9.png b/res/drawable-hdpi/list_section_divider_holo_custom.9.png Binary files differnew file mode 100644 index 000000000..6c0d25112 --- /dev/null +++ b/res/drawable-hdpi/list_section_divider_holo_custom.9.png diff --git a/res/drawable-mdpi/list_section_divider_holo_custom.9.png b/res/drawable-mdpi/list_section_divider_holo_custom.9.png Binary files differnew file mode 100644 index 000000000..cfc57eeea --- /dev/null +++ b/res/drawable-mdpi/list_section_divider_holo_custom.9.png diff --git a/res/drawable-xhdpi/list_section_divider_holo_custom.9.png b/res/drawable-xhdpi/list_section_divider_holo_custom.9.png Binary files differnew file mode 100644 index 000000000..32e79e155 --- /dev/null +++ b/res/drawable-xhdpi/list_section_divider_holo_custom.9.png diff --git a/res/layout-sw580dp-w1000dp/contact_detail_updates_fragment.xml b/res/layout-sw580dp-w1000dp/contact_detail_updates_fragment.xml index 5daf555fe..439b8f0a2 100644 --- a/res/layout-sw580dp-w1000dp/contact_detail_updates_fragment.xml +++ b/res/layout-sw580dp-w1000dp/contact_detail_updates_fragment.xml @@ -22,4 +22,6 @@ android:fadingEdge="none" android:divider="@null" android:paddingTop="@dimen/contact_detail_list_top_padding" + android:paddingLeft="16dip" + android:paddingRight="16dip" android:clipToPadding="false"/> diff --git a/res/layout-sw580dp-w1000dp/people_activity.xml b/res/layout-sw580dp-w1000dp/people_activity.xml index 9a7c5ae12..29aa1507d 100644 --- a/res/layout-sw580dp-w1000dp/people_activity.xml +++ b/res/layout-sw580dp-w1000dp/people_activity.xml @@ -142,7 +142,8 @@ android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="3" - android:layout_marginTop="32dip"/> + android:layout_marginTop="32dip" + android:layout_marginRight="16dip"/> </LinearLayout> </view> diff --git a/res/layout-sw580dp/contact_detail_updates_fragment.xml b/res/layout-sw580dp/contact_detail_updates_fragment.xml index 513254e31..3bcb01ce5 100644 --- a/res/layout-sw580dp/contact_detail_updates_fragment.xml +++ b/res/layout-sw580dp/contact_detail_updates_fragment.xml @@ -25,8 +25,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:fadingEdge="none" - android:divider="@null" - android:paddingTop="32dip"/> + android:divider="@null"/> <View android:id="@+id/alpha_overlay" diff --git a/res/layout-sw580dp/list_separator.xml b/res/layout-sw580dp/list_separator.xml new file mode 100644 index 000000000..a53bd6bd0 --- /dev/null +++ b/res/layout-sw580dp/list_separator.xml @@ -0,0 +1,28 @@ +<?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. +--> + +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/title" + style="?android:attr/listSeparatorTextViewStyle" + android:layout_height="32dip" + android:paddingLeft="8dip" + android:paddingRight="8dip" + android:background="@drawable/list_section_divider_holo_custom" + android:textColor="@color/people_app_theme_color" + android:textAllCaps="true" + android:singleLine="true" + android:ellipsize="end" />
\ No newline at end of file diff --git a/res/layout-sw580dp/people_activity.xml b/res/layout-sw580dp/people_activity.xml index feeff6cfb..e15c07946 100644 --- a/res/layout-sw580dp/people_activity.xml +++ b/res/layout-sw580dp/people_activity.xml @@ -134,7 +134,8 @@ android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" - android:layout_marginTop="32dip"/> + android:layout_marginTop="32dip" + android:layout_marginRight="16dip"/> </LinearLayout> </view> diff --git a/res/layout-sw580dp/updates_header_contact.xml b/res/layout-sw580dp/updates_header_contact.xml index 2f2177fa5..5192134af 100644 --- a/res/layout-sw580dp/updates_header_contact.xml +++ b/res/layout-sw580dp/updates_header_contact.xml @@ -24,6 +24,7 @@ class="com.android.contacts.widget.ProportionalLayout" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingBottom="8dip" ex:ratio="0.66" ex:direction="widthToHeight"> diff --git a/res/layout/contact_detail_kind_title_entry_view.xml b/res/layout/contact_detail_kind_title_entry_view.xml deleted file mode 100644 index 37b73ea47..000000000 --- a/res/layout/contact_detail_kind_title_entry_view.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* - * Copyright 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="wrap_content" - android:paddingLeft="@dimen/detail_item_side_margin" - android:paddingRight="@dimen/detail_item_side_margin" - android:orientation="vertical"> - - <TextView - android:id="@+id/kind" - android:layout_width="wrap_content" - android:layout_height="24dip" - android:textColor="@color/detail_kind_title_color" - android:textStyle="bold" - android:singleLine="true" - android:ellipsize="end" - android:paddingLeft="8dip" - android:paddingTop="5dip" - android:paddingBottom="2dip" /> - - <View - android:id="@+id/kind_divider" - android:layout_width="match_parent" - android:layout_height="2dip" - android:background="@color/detail_kind_title_color"/> - -</LinearLayout> diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml index 4d6ed5fa3..99f027fb7 100644 --- a/res/layout/contact_detail_list_item.xml +++ b/res/layout/contact_detail_list_item.xml @@ -47,12 +47,6 @@ android:gravity="center_vertical"> <TextView - android:id="@+id/kind" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:visibility="gone" /> - - <TextView android:id="@+id/data" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -121,7 +115,8 @@ <ImageView android:id="@+id/secondary_action_button" android:layout_width="32dip" - android:layout_height="match_parent" + android:layout_height="32dip" + android:layout_gravity="center_vertical" android:duplicateParentState="false" /> </FrameLayout> </LinearLayout> diff --git a/res/layout/contact_detail_tab_carousel.xml b/res/layout/contact_detail_tab_carousel.xml index fb60f17ab..28463a249 100644 --- a/res/layout/contact_detail_tab_carousel.xml +++ b/res/layout/contact_detail_tab_carousel.xml @@ -35,7 +35,7 @@ <!-- Vertical divider --> <View - android:layout_width="2dip" + android:layout_width="1dip" android:layout_height="match_parent" android:background="@android:color/white"/> diff --git a/res/layout/edit_kind_title.xml b/res/layout/edit_kind_title.xml index 8901d5bc1..f178876ba 100644 --- a/res/layout/edit_kind_title.xml +++ b/res/layout/edit_kind_title.xml @@ -17,34 +17,23 @@ */ --> -<LinearLayout +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="24dip" + android:layout_height="32dip" android:paddingLeft="8dip" android:paddingRight="8dip" - android:paddingBottom="4dip" - android:orientation="vertical"> + android:focusable="false"> <TextView android:id="@+id/kind_title" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingLeft="@dimen/editor_kind_title_left_padding" - android:textAppearance="?android:attr/textAppearanceSmall" + style="?android:attr/listSeparatorTextViewStyle" + android:paddingLeft="8dip" + android:paddingRight="8dip" + android:background="@drawable/list_section_divider_holo_custom" android:textColor="@color/people_app_theme_color" - android:textStyle="bold" android:textAllCaps="true" android:singleLine="true" - android:ellipsize="end" - android:layout_gravity="center_vertical" /> + android:ellipsize="end" /> - <ImageView - android:id="@+id/divider" - android:layout_width="match_parent" - android:layout_height="2dip" - android:scaleType="fitXY" - android:src="@color/people_app_theme_color"/> - -</LinearLayout> +</FrameLayout>
\ No newline at end of file diff --git a/res/layout/group_browse_list_item.xml b/res/layout/group_browse_list_item.xml index 88ff5750d..cc388f727 100644 --- a/res/layout/group_browse_list_item.xml +++ b/res/layout/group_browse_list_item.xml @@ -51,6 +51,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="8dip" + android:paddingLeft="8dip" android:paddingBottom="8dip" android:duplicateParentState="true" android:background="@drawable/group_list_item_background" diff --git a/res/layout/list_separator.xml b/res/layout/list_separator.xml index 39de1da58..2aeb1bae7 100644 --- a/res/layout/list_separator.xml +++ b/res/layout/list_separator.xml @@ -14,31 +14,23 @@ limitations under the License. --> -<!-- Layout used for list separators. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:orientation="vertical" +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" android:layout_height="32dip" - android:divider="?android:attr/dividerVertical" android:paddingLeft="16dip" - android:paddingRight="16dip"> + android:paddingRight="16dip" + android:focusable="false"> <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingTop="8dip" + android:id="@+id/title" + style="?android:attr/listSeparatorTextViewStyle" android:paddingLeft="8dip" - android:textStyle="bold" + android:paddingRight="8dip" + android:background="@drawable/list_section_divider_holo_custom" + android:textColor="@color/people_app_theme_color" android:textAllCaps="true" android:singleLine="true" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/people_app_theme_color" - android:gravity="left|center_vertical" - android:id="@+id/header_text" /> - - <View - android:layout_width="match_parent" - android:layout_height="1dip" - android:background="@color/people_app_theme_color" /> + android:ellipsize="end" /> -</LinearLayout>
\ No newline at end of file +</FrameLayout>
\ No newline at end of file diff --git a/res/layout/updates_title.xml b/res/layout/updates_title.xml deleted file mode 100644 index 995a3b9a2..000000000 --- a/res/layout/updates_title.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* - * Copyright 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="wrap_content" - android:paddingLeft="@dimen/detail_item_side_margin" - android:paddingRight="@dimen/detail_item_side_margin" - android:orientation="vertical"> - - <TextView - android:layout_width="wrap_content" - android:layout_height="24dip" - android:text="@string/recent_updates" - android:textColor="@color/detail_kind_title_color" - android:textStyle="bold" - android:textAllCaps="true" - android:singleLine="true" - android:ellipsize="end" - style="@style/UpdatesTitleStyle"/> - - <View - android:layout_width="match_parent" - android:layout_height="2dip" - android:background="@color/detail_kind_title_color"/> - -</LinearLayout> diff --git a/res/values-sw580dp/dimens.xml b/res/values-sw580dp/dimens.xml index ef0e04f7e..551a930f0 100644 --- a/res/values-sw580dp/dimens.xml +++ b/res/values-sw580dp/dimens.xml @@ -21,7 +21,7 @@ <dimen name="editor_round_button_padding_right">16dip</dimen> <dimen name="editor_kind_title_left_padding">16dip</dimen> <dimen name="editor_add_field_label_left_padding">24dip</dimen> - <dimen name="detail_item_side_margin">16dip</dimen> + <dimen name="detail_item_side_margin">0dip</dimen> <dimen name="detail_item_vertical_margin">16dip</dimen> <dimen name="detail_item_icon_margin">8dip</dimen> <dimen name="contact_name_text_size">26sp</dimen> @@ -32,7 +32,7 @@ <dimen name="shortcut_icon_size">64dip</dimen> <dimen name="list_section_height">37dip</dimen> <dimen name="group_detail_border_padding">16dip</dimen> - <dimen name="detail_update_section_side_padding">16dip</dimen> + <dimen name="detail_update_section_side_padding">0dip</dimen> <dimen name="detail_update_section_item_horizontal_padding">8dip</dimen> <dimen name="detail_update_section_item_vertical_padding">16dip</dimen> <dimen name="detail_update_section_between_items_vertical_padding">16dip</dimen> diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml index 8e56bac6e..07bb371db 100644 --- a/res/values-sw580dp/styles.xml +++ b/res/values-sw580dp/styles.xml @@ -132,10 +132,4 @@ <item name="android:windowIsFloating">true</item> </style> - <style name="UpdatesTitleStyle"> - <item name="android:paddingLeft">8dip</item> - <item name="android:layout_height">16dip</item> - <item name="android:layout_gravity">center_vertical</item> - <item name="android:gravity">center_vertical</item> - </style> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 419e9ce0a..32de03cc1 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -81,7 +81,7 @@ <dimen name="detail_header_view_margin">8dip</dimen> <!-- Height of the tab text label in the tab carousel on the contact detail page --> - <dimen name="detail_tab_carousel_tab_label_height">48dip</dimen> + <dimen name="detail_tab_carousel_tab_label_height">45dip</dimen> <!-- Height of the tab text label in the tab carousel on the contact detail page --> <dimen name="detail_tab_carousel_tab_label_indent">24dip</dimen> @@ -114,7 +114,7 @@ <dimen name="detail_update_section_item_last_row_extra_vertical_padding">0dip</dimen> <!-- Horizontal padding for individual stream items --> - <dimen name="detail_update_section_item_horizontal_padding">24dip</dimen> + <dimen name="detail_update_section_item_horizontal_padding">8dip</dimen> <!-- Horizontal padding between columns images and/or text in a single stream item --> <dimen name="detail_update_section_between_items_horizontal_padding">16dip</dimen> @@ -125,7 +125,6 @@ <!-- 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> @@ -139,7 +138,7 @@ <dimen name="detail_item_side_margin">16dip</dimen> <!-- Top and bottom padding for a contact detail item --> - <dimen name="detail_item_vertical_margin">12dip</dimen> + <dimen name="detail_item_vertical_margin">8dip</dimen> <!-- Minimum height of a row in the contact detail --> <dimen name="detail_min_line_item_height">48dip</dimen> diff --git a/res/values/styles.xml b/res/values/styles.xml index 51b2c0c97..9509d6da3 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -279,10 +279,4 @@ <item name="android:displayOptions"></item> </style> - <style name="UpdatesTitleStyle"> - <item name="android:paddingLeft">8dip</item> - <item name="android:paddingTop">5dip</item> - <item name="android:paddingBottom">2dip</item> - </style> - </resources> diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java index 0e3f100a2..a87f88687 100644 --- a/src/com/android/contacts/detail/ContactDetailFragment.java +++ b/src/com/android/contacts/detail/ContactDetailFragment.java @@ -1401,7 +1401,6 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen * {@link DetailViewEntry} */ private static class DetailViewCache { - public final TextView kind; public final TextView type; public final TextView data; public final TextView footer; @@ -1415,7 +1414,6 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen public DetailViewCache(View view, OnClickListener primaryActionClickListener, OnClickListener secondaryActionClickListener) { - kind = (TextView) view.findViewById(R.id.kind); type = (TextView) view.findViewById(R.id.type); data = (TextView) view.findViewById(R.id.data); footer = (TextView) view.findViewById(R.id.footer); @@ -1535,8 +1533,8 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen final KindTitleViewEntry entry = (KindTitleViewEntry) getItem(position); final View result = (convertView != null) ? convertView : - mInflater.inflate(R.layout.contact_detail_kind_title_entry_view, parent, false); - final TextView titleTextView = (TextView) result.findViewById(R.id.kind); + mInflater.inflate(R.layout.list_separator, parent, false); + final TextView titleTextView = (TextView) result.findViewById(R.id.title); titleTextView.setText(entry.getTitle()); return result; diff --git a/src/com/android/contacts/detail/StreamItemAdapter.java b/src/com/android/contacts/detail/StreamItemAdapter.java index 6586b2340..c923cf82e 100644 --- a/src/com/android/contacts/detail/StreamItemAdapter.java +++ b/src/com/android/contacts/detail/StreamItemAdapter.java @@ -27,6 +27,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; +import android.widget.TextView; import java.util.List; @@ -101,7 +102,10 @@ public class StreamItemAdapter extends BaseAdapter { return mInflater.inflate(R.layout.updates_header_contact, null); } if (position == 1) { - return mInflater.inflate(R.layout.updates_title, null); + final View titleView = mInflater.inflate(R.layout.list_separator, null); + TextView titleTextView = (TextView) titleView.findViewById(R.id.title); + titleTextView.setText(mContext.getString(R.string.recent_updates)); + return titleView; } final StreamItemEntry streamItem = (StreamItemEntry) getItem(position); final AccountTypeManager manager = AccountTypeManager.getInstance(mContext); diff --git a/src/com/android/contacts/list/ContactTileAdapter.java b/src/com/android/contacts/list/ContactTileAdapter.java index 075537664..304b10965 100644 --- a/src/com/android/contacts/list/ContactTileAdapter.java +++ b/src/com/android/contacts/list/ContactTileAdapter.java @@ -404,13 +404,11 @@ public class ContactTileAdapter extends BaseAdapter { */ private View getDivider() { View dividerView = View.inflate(mContext, R.layout.list_separator, null); - dividerView.setFocusable(false); - TextView text = (TextView) dividerView.findViewById(R.id.header_text); + TextView text = (TextView) dividerView.findViewById(R.id.title); text.setText(mDisplayType == DisplayType.STREQUENT_PHONE_ONLY ? mContext.getString(R.string.favoritesFrequentCalled) : mContext.getString(R.string.favoritesFrequentContacted)); - return dividerView; } diff --git a/src/com/android/contacts/model/BaseAccountType.java b/src/com/android/contacts/model/BaseAccountType.java index aafa3ea9c..dae09b2b8 100644 --- a/src/com/android/contacts/model/BaseAccountType.java +++ b/src/com/android/contacts/model/BaseAccountType.java @@ -344,7 +344,7 @@ public class BaseAccountType extends AccountType { protected DataKind addDataKindNote(Context context) { DataKind kind = addKind(new DataKind(Note.CONTENT_ITEM_TYPE, R.string.label_notes, -1, 110, true, - R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium)); + R.layout.text_fields_editor_view, android.R.style.TextAppearance_Small)); kind.isList = false; kind.actionHeader = new SimpleInflater(R.string.label_notes); kind.actionBody = new SimpleInflater(Note.NOTE); |