Styled frequent contacts to look like contact list
Instead of refactoring the ContactTileAdapter to use functionality
from ContactEntryListAdapter, I changed ContactTileAdapter
to use the Attribute#ContactListItemView values when possible.
Also fixed the touch feedback inside contact_tile_starred
(has been broken for a while).
Change-Id: Ib9bafceef518aaa16b77d0b585b06778178b76a4
diff --git a/res-common/layout/contact_tile_frequent.xml b/res-common/layout/contact_tile_frequent.xml
index 404b2fe..880ce81 100644
--- a/res-common/layout/contact_tile_frequent.xml
+++ b/res-common/layout/contact_tile_frequent.xml
@@ -17,65 +17,37 @@
xmlns:android="http://schemas.android.com/apk/res/android"
class="com.android.contacts.common.list.ContactTileFrequentView"
android:focusable="true"
- android:background="?android:attr/selectableItemBackground"
- android:nextFocusRight="@+id/contact_tile_quick">
+ android:background="?android:attr/selectableItemBackground">
- <RelativeLayout
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="match_parent" >
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ android:paddingStart="?list_item_padding_left"
+ android:paddingEnd="?list_item_padding_right"
+ android:paddingTop="?list_item_padding_top"
+ android:paddingBottom="?list_item_padding_bottom">
- <com.android.contacts.common.widget.LayoutSuppressingQuickContactBadge
- android:id="@+id/contact_tile_quick"
- android:layout_width="64dip"
- android:layout_height="64dip"
- android:layout_alignParentEnd="true"
+ <com.android.contacts.common.widget.LayoutSuppressingImageView
+ android:id="@+id/contact_tile_image"
+ android:layout_width="?list_item_photo_size"
+ android:layout_height="?list_item_photo_size"
android:scaleType="centerCrop"
- android:focusable="true" />
+ android:layout_marginEnd="?list_item_gap_between_image_and_text"/>
- <LinearLayout
+ <TextView
+ android:id="@+id/contact_tile_name"
android:layout_width="match_parent"
- android:layout_height="64dip"
- android:orientation="vertical"
- android:layout_alignParentBottom="true"
- android:gravity="center_vertical"
- android:paddingLeft="8dip"
- android:paddingRight="80dip"
- android:paddingStart="8dip"
- android:paddingEnd="80dip">
+ android:layout_height="wrap_content"
+ android:textColor="@android:color/black"
+ android:textSize="@dimen/contact_browser_list_item_text_size"
+ android:singleLine="true"
+ android:fadingEdge="horizontal"
+ android:fadingEdgeLength="3dip"
+ android:ellipsize="marquee"
+ android:textAlignment="viewStart" />
- <TextView
- android:id="@+id/contact_tile_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textColor="@color/primary_text_color"
- android:textSize="18sp"
- android:singleLine="true"
- android:fadingEdge="horizontal"
- android:fadingEdgeLength="3dip"
- android:ellipsize="marquee"
- android:textAlignment="viewStart" />
-
- <TextView
- android:id="@+id/contact_tile_status"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:singleLine="true"
- android:drawablePadding="4dip"
- android:fadingEdge="horizontal"
- android:fadingEdgeLength="3dip"
- android:ellipsize="marquee" />
-
- </LinearLayout>
-
- <View
- android:id="@+id/contact_tile_horizontal_divider"
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:background="?android:attr/listDivider"
- android:layout_below="@id/contact_tile_quick" />
-
- </RelativeLayout>
+ </LinearLayout>
</view>
diff --git a/res-common/layout/contact_tile_starred.xml b/res-common/layout/contact_tile_starred.xml
index ed29042..3d9abb5 100644
--- a/res-common/layout/contact_tile_starred.xml
+++ b/res-common/layout/contact_tile_starred.xml
@@ -16,17 +16,16 @@
<view
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:background="@null"
- class="com.android.contacts.common.list.ContactTileStarredView" >
+ class="com.android.contacts.common.list.ContactTileStarredView"
+ android:focusable="true"
+ android:background="?android:attr/selectableItemBackground">
<LinearLayout
android:id="@+id/contact_tile_push_state"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:paddingTop="21dp"
- android:focusable="true"
- android:background="?android:attr/selectableItemBackground">
+ android:paddingTop="21dp">
<view
android:id="@+id/contact_tile_container"
android:layout_width="match_parent"