Support for local profile
Bug: 5121834 Support local profile
5086184 Account name is overlapped by number of contacts
5082317 Text is chopped on the top in contact list
1. New headers were added at the top of the contact list to
present an empty local profile.
2. Clicking the empty local profile opens the editor to allow
the user to create a local profile.
3. Profiles are shown at the top of the contacts list with the
"ME" header and the number of contatcs.
4. "Add to contacts" button and the starred button were removed
from the details view when it is a profile.
5. Fixed a problem with a header view that remained when you had
a profile or was in search mode.
6. Fixed problem with contacts count apearing in search mode
Change-Id: I45615616e03a603759888d9e7169a853b3328b14
diff --git a/res/layout/contacts_list_content.xml b/res/layout/contacts_list_content.xml
index 92841b6..567e63d 100644
--- a/res/layout/contacts_list_content.xml
+++ b/res/layout/contacts_list_content.xml
@@ -18,68 +18,54 @@
android:layout_marginTop is ignored when used with <fragment></fragment>, which
only happens in Tablet UI since we rely on ViewPager in Phone UI.
Instead, android:layout_marginTop inside <fragment /> is effective. -->
-<FrameLayout
+
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pinned_header_list_layout"
android:paddingTop="@dimen/contact_browser_list_top_margin"
+ android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <!-- Shown only when an Account filter is set. -->
- <LinearLayout
- android:id="@+id/account_filter_header_container"
+ <!-- Shown only when an Account filter is set. -->
+ <LinearLayout
+ android:id="@+id/account_filter_header_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginLeft="@dimen/contact_browser_list_header_left_margin"
+ android:layout_marginRight="@dimen/contact_browser_list_header_right_margin"
+ android:visibility="gone">
+ <TextView
+ android:id="@+id/account_filter_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginLeft="@dimen/contact_browser_list_header_left_margin"
- android:layout_marginRight="@dimen/contact_browser_list_header_right_margin"
- android:visibility="gone">
- <TextView
- android:id="@+id/account_filter_header"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="@dimen/contact_filter_header_min_height"
- android:layout_marginLeft="8dip"
- android:singleLine="true"
- android:ellipsize="end"
- android:gravity="left"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary" />
- <View
- android:id="@+id/account_filter_header_bottom_divider"
- style="@style/SectionDivider" />
- </LinearLayout>
-
- <view
- class="com.android.contacts.list.ContactEntryListView"
- android:id="@android:id/list"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
- android:layout_marginRight="@dimen/contact_browser_list_right_margin"
- android:fastScrollEnabled="true"
- android:layout_weight="1" />
-
- <ViewStub
- android:id="@+id/footer_stub"
- android:layout="@layout/footer_panel"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
+ android:minHeight="@dimen/contact_filter_header_min_height"
+ android:layout_marginLeft="8dip"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:gravity="left"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorSecondary" />
+ <View
+ android:id="@+id/account_filter_header_bottom_divider"
+ style="@style/SectionDivider" />
</LinearLayout>
- <TextView
- android:id="@+id/contacts_count"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="@dimen/contacts_count_right_margin"
- android:singleLine="true"
- android:ellipsize="end"
- android:gravity="right"
- android:layout_gravity="top|right"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/contact_count_text_color"
- android:background="@color/contact_browser_list_bk_color" />
-</FrameLayout>
+
+ <view
+ class="com.android.contacts.list.ContactEntryListView"
+ android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
+ android:layout_marginRight="@dimen/contact_browser_list_right_margin"
+ android:fastScrollEnabled="true"
+ android:layout_weight="1" />
+
+ <ViewStub
+ android:id="@+id/footer_stub"
+ android:layout="@layout/footer_panel"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+
+</LinearLayout>
diff --git a/res/layout/user_profile_button.xml b/res/layout/user_profile_button.xml
new file mode 100644
index 0000000..b7b5e1d
--- /dev/null
+++ b/res/layout/user_profile_button.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<Button
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="?android:attr/selectableItemBackground"
+ android:paddingLeft="@dimen/contact_browser_list_left_margin"
+ android:singleLine="true"
+ android:text="@string/profile_display_name"
+ android:ellipsize="end"
+ android:gravity="left|center_vertical"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
diff --git a/res/layout/user_profile_header.xml b/res/layout/user_profile_header.xml
new file mode 100644
index 0000000..ae803ba
--- /dev/null
+++ b/res/layout/user_profile_header.xml
@@ -0,0 +1,60 @@
+<?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:background="@color/contact_browser_list_bk_color"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+
+ <TextView
+ android:id="@+id/profile_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
+ android:singleLine="true"
+ android:text="@string/user_profile_contacts_list_header"
+ android:textStyle="bold"
+ android:ellipsize="end"
+ android:gravity="left"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/people_app_theme_color" />
+
+ <TextView
+ android:id="@+id/contacts_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:layout_gravity="right"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/contact_count_text_color" />
+ </LinearLayout>
+
+ <View
+ android:background="@color/people_app_theme_color"
+ android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
+ android:layout_width="match_parent"
+ android:layout_height="1px" />
+
+</LinearLayout>
\ No newline at end of file