Adding common contact list view and card layout
Bug: 16553819
Bug: 17157006
Change-Id: I498b3de918a98b59e589e5216ea6ae3a0d3902a7
diff --git a/res-common/layout/contact_list_card.xml b/res-common/layout/contact_list_card.xml
new file mode 100644
index 0000000..93786aa
--- /dev/null
+++ b/res-common/layout/contact_list_card.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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="horizontal"
+ android:id="@+id/list_card"
+ android:visibility="invisible">
+ <View
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="@integer/contact_list_space_layout_weight"
+ android:background="@color/background_primary"/>
+ <View
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:background="@color/contact_all_list_background_color"
+ android:layout_weight="@integer/contact_list_card_layout_weight"
+ android:elevation="@dimen/contact_list_card_elevation"/>
+ <View
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="@integer/contact_list_space_layout_weight"
+ android:background="@color/background_primary"/>
+</LinearLayout>
diff --git a/res-common/layout/contact_list_content.xml b/res-common/layout/contact_list_content.xml
index 3a8ad7d..1e5934c 100644
--- a/res-common/layout/contact_list_content.xml
+++ b/res-common/layout/contact_list_content.xml
@@ -37,6 +37,7 @@
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" >
+ <include layout="@layout/contact_list_card"/>
<view
class="com.android.contacts.common.list.PinnedHeaderListView"
android:id="@android:id/list"
diff --git a/res-common/layout/contact_tile_starred.xml b/res-common/layout/contact_tile_starred.xml
index 834cdc8..777cc05 100644
--- a/res-common/layout/contact_tile_starred.xml
+++ b/res-common/layout/contact_tile_starred.xml
@@ -44,7 +44,7 @@
android:layout_height="wrap_content"
android:paddingTop="7dp"
android:textColor="#202020"
- android:textSize="16sp"
+ android:textSize="@dimen/contact_browser_list_item_text_size"
android:singleLine="true"
android:fadingEdge="horizontal"
android:fadingEdgeLength="3dip"
diff --git a/res-common/layout/list_separator.xml b/res-common/layout/list_separator.xml
index bb9f1d4..80abacb 100644
--- a/res-common/layout/list_separator.xml
+++ b/res-common/layout/list_separator.xml
@@ -24,4 +24,4 @@
android:paddingBottom="15dip"
android:paddingTop="16dip"
android:textStyle="bold"
- android:textSize="24sp"/>
+ android:textSize="@dimen/frequently_contacted_title_text_size"/>
diff --git a/res-common/values/colors.xml b/res-common/values/colors.xml
index 14fdcff..d9dcf15 100644
--- a/res-common/values/colors.xml
+++ b/res-common/values/colors.xml
@@ -146,4 +146,8 @@
<color name="search_shortcut_background_color">#b6b6b6</color>
<color name="search_shortcut_icon_color">#f8f8f8</color>
+
+ <!-- Color of the background of the contact detail and editor pages -->
+ <color name="background_primary">#f5f5f5</color>
+ <color name="contact_all_list_background_color">#FFFFFF</color>
</resources>
diff --git a/res-common/values/dimens.xml b/res-common/values/dimens.xml
index cf6ba84..bbf95e0 100644
--- a/res-common/values/dimens.xml
+++ b/res-common/values/dimens.xml
@@ -143,6 +143,10 @@
item in the list -->
<dimen name="frequently_contacted_title_top_margin">57dp</dimen>
+ <dimen name="frequently_contacted_title_text_size">24sp</dimen>
+
<!-- Size of icon for contacts number shortcuts -->
<dimen name="search_shortcut_radius">40dp</dimen>
+
+ <dimen name="contact_list_card_elevation">2dp</dimen>
</resources>
diff --git a/res-common/values/integers.xml b/res-common/values/integers.xml
index e5211d1..fc1209f 100644
--- a/res-common/values/integers.xml
+++ b/res-common/values/integers.xml
@@ -23,4 +23,11 @@
<!-- The number of characters in the snippet before we need to tokenize and ellipse. -->
<integer name="snippet_length_before_tokenize">30</integer>
+
+ <!-- Layout weight of space elements in contact list view.
+ Default to 0 to indicate no padding-->
+ <integer name="contact_list_space_layout_weight">0</integer>
+ <!-- Layout weight of card in contact list view.
+ Default to 0 to indicate no padding -->
+ <integer name="contact_list_card_layout_weight">0</integer>
</resources>