Merge "Pushed the contact text in search results to the right." into lmp-dev
diff --git a/res/layout-sw600dp-land/contact_list_content.xml b/res/layout-sw600dp/contact_list_content.xml
similarity index 92%
rename from res/layout-sw600dp-land/contact_list_content.xml
rename to res/layout-sw600dp/contact_list_content.xml
index 7a23430..1b52068 100644
--- a/res/layout-sw600dp-land/contact_list_content.xml
+++ b/res/layout-sw600dp/contact_list_content.xml
@@ -25,18 +25,18 @@
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
-            android:layout_weight="@integer/people_activity_land_space_layout_weight"
+            android:layout_weight="@integer/people_activity_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/people_activity_land_list_view_layout_weight"
+            android:layout_weight="@integer/people_activity_list_view_layout_weight"
             android:elevation="@dimen/people_activity_card_elevation"/>
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
-            android:layout_weight="@integer/people_activity_land_space_layout_weight"
+            android:layout_weight="@integer/people_activity_space_layout_weight"
             android:background="@color/background_primary"/>
     </LinearLayout>
     <LinearLayout
diff --git a/res/layout-sw600dp-land/contact_tile_list.xml b/res/layout-sw600dp/contact_tile_list.xml
similarity index 90%
rename from res/layout-sw600dp-land/contact_tile_list.xml
rename to res/layout-sw600dp/contact_tile_list.xml
index 5b8200e..102a58d 100644
--- a/res/layout-sw600dp-land/contact_tile_list.xml
+++ b/res/layout-sw600dp/contact_tile_list.xml
@@ -26,18 +26,18 @@
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
-            android:layout_weight="@integer/people_activity_land_space_layout_weight"
+            android:layout_weight="@integer/people_activity_space_layout_weight"
             android:background="@color/background_primary"/>
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
             android:background="@color/contact_favorites_list_background_color"
-            android:layout_weight="@integer/people_activity_land_list_view_layout_weight"
+            android:layout_weight="@integer/people_activity_list_view_layout_weight"
             android:elevation="@dimen/people_activity_card_elevation"/>
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
-            android:layout_weight="@integer/people_activity_land_space_layout_weight"
+            android:layout_weight="@integer/people_activity_space_layout_weight"
             android:background="@color/background_primary"/>
     </LinearLayout>
     <FrameLayout
diff --git a/res/layout-sw600dp-land/contacts_unavailable_fragment.xml b/res/layout-sw600dp/contacts_unavailable_fragment.xml
similarity index 87%
rename from res/layout-sw600dp-land/contacts_unavailable_fragment.xml
rename to res/layout-sw600dp/contacts_unavailable_fragment.xml
index eb3e5f2..8727359 100644
--- a/res/layout-sw600dp-land/contacts_unavailable_fragment.xml
+++ b/res/layout-sw600dp/contacts_unavailable_fragment.xml
@@ -26,18 +26,18 @@
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
-            android:layout_weight="@integer/people_activity_land_space_layout_weight"
+            android:layout_weight="@integer/people_activity_space_layout_weight"
             android:background="@color/background_primary"/>
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
             android:background="@color/contact_favorites_list_background_color"
-            android:layout_weight="@integer/people_activity_land_list_view_layout_weight"
+            android:layout_weight="@integer/people_activity_list_view_layout_weight"
             android:elevation="@dimen/people_activity_card_elevation"/>
         <View
             android:layout_width="0dp"
             android:layout_height="match_parent"
-            android:layout_weight="@integer/people_activity_land_space_layout_weight"
+            android:layout_weight="@integer/people_activity_space_layout_weight"
             android:background="@color/background_primary"/>
     </LinearLayout>
     <ScrollView
diff --git a/res/layout/edit_date_picker.xml b/res/layout/edit_date_picker.xml
index ce9a85f..e2c4278 100644
--- a/res/layout/edit_date_picker.xml
+++ b/res/layout/edit_date_picker.xml
@@ -30,5 +30,5 @@
     android:layout_marginStart="@dimen/editor_field_left_padding"
     android:layout_marginEnd="@dimen/editor_field_right_padding"
     android:textAppearance="?android:attr/textAppearanceMedium"
-    android:paddingLeft="12dip"
-    android:paddingStart="12dip" />
+    android:paddingStart="12dip"
+    android:paddingEnd="@dimen/editor_spinner_end_padding_workaround" />
diff --git a/res/layout/item_group_membership.xml b/res/layout/item_group_membership.xml
index 7f58c2d..fa447bb 100644
--- a/res/layout/item_group_membership.xml
+++ b/res/layout/item_group_membership.xml
@@ -37,7 +37,7 @@
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:gravity="start|center_vertical"
         android:focusable="true"
-        android:paddingLeft="12dip"
-        android:paddingStart="12dip" />
+        android:paddingStart="12dip"
+        android:paddingEnd="@dimen/editor_spinner_end_padding_workaround"/>
 
 </com.android.contacts.editor.GroupMembershipView>
diff --git a/res/layout/quickcontact_content.xml b/res/layout/quickcontact_content.xml
index 494b93b..5ead702 100644
--- a/res/layout/quickcontact_content.xml
+++ b/res/layout/quickcontact_content.xml
@@ -23,7 +23,7 @@
     android:background="@color/card_margin_color">
 
     <!-- All the cards should be inserted into this LinearLayout -->
-    <LinearLayout
+    <view class="com.android.contacts.common.widget.ActivityTouchLinearLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical"
@@ -54,6 +54,6 @@
             android:visibility="gone"
             cardview:cardCornerRadius="@dimen/expanding_entry_card_card_corner_radius" />
 
-    </LinearLayout>
+    </view>
 
 </com.android.contacts.widget.TouchlessScrollView>
\ No newline at end of file
diff --git a/res/values-km-rKH/strings.xml b/res/values-km-rKH/strings.xml
index 61c45c0..fbd1830 100644
--- a/res/values-km-rKH/strings.xml
+++ b/res/values-km-rKH/strings.xml
@@ -42,13 +42,13 @@
     <string name="menu_removeStar" msgid="5844227078364227030">"លុប​ចេញពី​សំណព្វ"</string>
     <string name="description_action_menu_remove_star" msgid="4699640108012265178">"បាន​លុប​ចេញ​​និយម​ប្រើ"</string>
     <string name="description_action_menu_add_star" msgid="3327186327234177456">"បន្ថែម​ទៅ​និយម​ប្រើ"</string>
-    <string name="menu_editContact" msgid="9042415603857662633">"កែសម្រួល"</string>
+    <string name="menu_editContact" msgid="9042415603857662633">"កែសម្រួល​"</string>
     <string name="menu_deleteContact" msgid="6788644058868189393">"លុប"</string>
     <string name="menu_create_contact_shortcut" msgid="1217971915748509640">"ដាក់​លើ​អេក្រង់​ដើម"</string>
     <string name="menu_call" msgid="3992595586042260618">"ហៅ​ទំនាក់ទំនង"</string>
     <string name="menu_sendSMS" msgid="5535886767547006515">"អត្ថបទ​ទំនាក់ទំនង"</string>
     <string name="menu_splitAggregate" msgid="8368636463748691868">"បំបែក"</string>
-    <string name="menu_editGroup" msgid="5062005185370983720">"កែសម្រួល"</string>
+    <string name="menu_editGroup" msgid="5062005185370983720">"កែសម្រួល​"</string>
     <string name="menu_deleteGroup" msgid="3486380004411482874">"លុប"</string>
     <string name="menu_new_contact_action_bar" msgid="7263362129442119188">"បន្ថែម​ទំនាក់ទំនង"</string>
     <string name="menu_new_group_action_bar" msgid="3520232877587377175">"បន្ថែម​ក្រុម"</string>
@@ -121,7 +121,7 @@
     <string name="quickcontact_add_phone_number" msgid="731665835910658965">"បន្ថែម​លេខទូរស័ព្ទ"</string>
     <string name="quickcontact_add_email" msgid="739298028384348482">"បន្ថែម​អ៊ីមែល"</string>
     <string name="missing_app" msgid="1466111003546611387">"រក​មិន​ឃើញ​កម្មវិធី​ដើម្បី​គ្រប់គ្រង​សកម្មភាព​នេះ​ទេ។"</string>
-    <string name="menu_share" msgid="943789700636542260">"ចែករំលែក"</string>
+    <string name="menu_share" msgid="943789700636542260">"ចែករំលែក​"</string>
     <string name="menu_add_contact" msgid="3198704337220892684">"បន្ថែម​ទៅ​ទំនាក់ទំនង"</string>
     <string name="share_via" msgid="563121028023030093">"ចែករំលែក​ទំនាក់ទំនង​តាម"</string>
     <string name="dialog_new_group_account" msgid="2318032089273496830">"បង្កើត​ក្រុម​នៅ​ក្នុង​គណនី"</string>
@@ -176,7 +176,7 @@
     <string name="non_phone_caption" msgid="1541655052330027380">"លេខទូរស័ព្ទ"</string>
     <string name="non_phone_add_to_contacts" msgid="6590985286250471169">"បន្ថែម​ទៅ​ទំនាក់ទំនង"</string>
     <string name="activity_title_confirm_add_detail" msgid="4065089866210730616">"បន្ថែម​ទៅ​ទំនាក់ទំនង"</string>
-    <string name="non_phone_close" msgid="7608506439725515667">"បិទ"</string>
+    <string name="non_phone_close" msgid="7608506439725515667">"បិទ​"</string>
     <string name="widget_name_and_phonetic" msgid="8739586586600099979">"<xliff:g id="DISPLAY_NAME">%1$s</xliff:g> (<xliff:g id="PHONETIC_NAME">%2$s</xliff:g>)"</string>
     <string name="date_year_toggle" msgid="7356532842767854606">"ផ្ដល់​ឆ្នាំ"</string>
     <string name="social_widget_label" msgid="6378905543028924592">"ទំនាក់ទំនង"</string>
diff --git a/res/values-my-rMM/strings.xml b/res/values-my-rMM/strings.xml
index e4830b2..8991c89 100644
--- a/res/values-my-rMM/strings.xml
+++ b/res/values-my-rMM/strings.xml
@@ -41,7 +41,7 @@
     <string name="menu_addStar" msgid="2908478235715404876">"အနှစ်သက်ဆုံးများထဲ ထည့်ပါ"</string>
     <string name="menu_removeStar" msgid="5844227078364227030">"အနှစ်သက်ဆုံးများမှ ထုတ်ပါ"</string>
     <string name="description_action_menu_remove_star" msgid="4699640108012265178">"အကြိုက်ဆုံးများထဲမှ ထုတ်လိုက်ပါပြီ"</string>
-    <string name="description_action_menu_add_star" msgid="3327186327234177456">"အကြိုက်ဆုံးများ ထဲကို ထည့်ပြီး"</string>
+    <string name="description_action_menu_add_star" msgid="3327186327234177456">"အကြိုက်ဆုံးများ ထဲကို ထည့်ပြီး"</string>
     <string name="menu_editContact" msgid="9042415603857662633">"ပြင်ဆင်ရန်"</string>
     <string name="menu_deleteContact" msgid="6788644058868189393">"ဖျက်ရန်"</string>
     <string name="menu_create_contact_shortcut" msgid="1217971915748509640">"ပင်မစာမျက်နှာတွင် တင်ထားပါ"</string>
@@ -67,7 +67,7 @@
     <string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"ဒီအဆက်အသွယ်မှာ အကောင့်အများအပြား၏ အချက်အလက်များ ပါဝင်ပါသည်။ ဖတ်ရန်အတွက်သာ အကောင့်များမှ အချက်အလက်များကို ဖျောက်ထားမှာဖြစ်ပြီး ဖျက်ပစ်ထားတာ မဟုတ်ပါ"</string>
     <string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"ဤအဆက်အသွယ်အားဖျက်ခြင်းကြောင့် တခြားအကောင့်များမှ အချက်အလက်များလည်း ပျက်ပါလိမ့်မည်"</string>
     <string name="deleteConfirmation" msgid="811706994761610640">"ဒီလိပ်စာကို ဖျက်ပစ်ပါလိမ့်မည်"</string>
-    <string name="menu_discard" msgid="6854657936970228164">"အပြောင်းအလဲများ စွန့်ပစ်ရန်"</string>
+    <string name="menu_discard" msgid="6854657936970228164">"အပြောင်းအလဲများ စွန့်ပစ်ရန်"</string>
     <string name="invalidContactMessage" msgid="8215051456181842274">"လိပ်စာ မရှိပါ"</string>
     <string name="createContactShortcutSuccessful" msgid="7874133287558150877">"အဆက်အသွယ်ပြ ဝဒ်ဂျက်ကို ပင်မစာမျက်နှာသို့ ထည့်ပြီးပါပြီ"</string>
     <string name="pickerNewContactHeader" msgid="7750705279843568147">"အဆက်အသွယ်သစ်တစ်ခု ပြုလုပ်ရန်"</string>
@@ -118,8 +118,8 @@
     <string name="search_settings_description" msgid="2675223022992445813">"အဆက်အသွယ်များ၏နာမည်များ"</string>
     <string name="quickcontact_missing_app" msgid="358168575340921552">"ဤလုပ်ဆောင်ချက်ကို ပြုလုပ်ပေးမည့် အပလီကေးရှင်း မရှိပါ။"</string>
     <string name="quickcontact_transparent_view_description" msgid="987959416759562455">"ယခင် မျက်နှာပြင်သို့ ပြန်ရန် ကလစ်ပါ"</string>
-    <string name="quickcontact_add_phone_number" msgid="731665835910658965">"ဖုန်း နံပါတ် ထည့်ရန်"</string>
-    <string name="quickcontact_add_email" msgid="739298028384348482">"အီးမေးလ် ထည့်ရန်"</string>
+    <string name="quickcontact_add_phone_number" msgid="731665835910658965">"ဖုန်း နံပါတ် ထည့်ရန်"</string>
+    <string name="quickcontact_add_email" msgid="739298028384348482">"အီးမေးလ် ထည့်ရန်"</string>
     <string name="missing_app" msgid="1466111003546611387">"ဤလုပ်ဆောင်ချက်ကို ပြုလုပ်မည့် အပလီကေးရှင်း မရှိပါ။"</string>
     <string name="menu_share" msgid="943789700636542260">"မျှဝေခြင်း"</string>
     <string name="menu_add_contact" msgid="3198704337220892684">"အဆက်အသွယ်များ ထဲသို့ ထည့်ရန်"</string>
@@ -212,21 +212,21 @@
     <string name="local_profile_title" msgid="2021416826991393684">"မိမိ၏ဖုန်းမှပရိုဖိုင်လ်"</string>
     <string name="external_profile_title" msgid="8034998767621359438">"ကျွန်ုပ်၏ <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g> ကိုယ်ရေးအကောင့်"</string>
     <string name="toast_displaying_all_contacts" msgid="2737388783898593875">"အဆက်အသွယ်အားလုံးအားပြနေစဉ်"</string>
-    <string name="no_account_prompt" msgid="6424883302325061025">"အဆက်အသွယ်များ၏ အလုပ်မှာ Google အကောင့်နှင့် ပိုအဆင်ပြေသည်။\n\n• မည်သည့် ဝက်ဘ် ဘရောင်ဇာဖြင့် မဆို ချဉ်းကပ်ပါ။\n• သင်၏ အဆက်အသွယ်များကို စိတ်ချရစွာ ဘက်အာပ် လုပ်ထားပါ။"</string>
+    <string name="no_account_prompt" msgid="6424883302325061025">"အဆက်အသွယ်များ၏ အလုပ်မှာ Google အကောင့်နှင့် ပိုအဆင်ပြေသည်။\n\n• မည်သည့် ဝက်ဘ် ဘရောင်ဇာဖြင့် မဆို ချဉ်းကပ်ပါ။\n• သင်၏ အဆက်အသွယ်များကို စိတ်ချရစွာ ဘက်အာပ် လုပ်ထားပါ။"</string>
     <string name="generic_no_account_prompt" msgid="7218827704367325460">"အွန်လိုင်း ဝန်ဆောင်မှုဖြင့် ထပ်တူကျအောင် ပြုလုပ်ထားခြင်းအားဖြင့် ဖုန်းပျောက်သွားသည့်တိုင်အောင် အဆက်အသွယ်များအား လုံခြုံစွာ သိမ်းထားနိုင်ပါသည်"</string>
-    <string name="generic_no_account_prompt_title" msgid="753783911899054860">"အကောင့် ထပ်ဖြည့်ပါ"</string>
+    <string name="generic_no_account_prompt_title" msgid="753783911899054860">"အကောင့် ထပ်ဖြည့်ပါ"</string>
     <string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"သင့် အဆက်အသွယ်အသစ်ကို အရံသိမ်းဆည်းထားခြင်း မရှိပါ။ အဆယ်အသွယ်များကို အွန်လိုင်းပေါ်မှာ အရံသိမ်းဆည်းပေးရန် အကောင့်သစ် ထပ်ထည့်ချင်ပါသလား"</string>
     <string name="contact_editor_prompt_one_account" msgid="8669032699767375976">"သင့်ရဲ့ အဆက်အသွယ်အသစ်ကို <xliff:g id="ACCOUNT_NAME">%1$s</xliff:g> နှင့် ထပ်တူဖြစ်အောင် ပြုလုပ်ပါမည်"</string>
     <string name="contact_editor_prompt_multiple_accounts" msgid="611828200100438242">"သင်ရဲ့အဆက်အသွယ် အသစ်ကို အောက်ပါ အကောင့်တွေထဲက တစ်ခုခုဖြင့် ထပ်တူဖြစ်အောင် ပြုလုပ်နိုင်ပါသည်။ ဘယ်တစ်ခုကို သုံးချင်ပါသလဲ?"</string>
     <string name="contact_editor_title_new_contact" msgid="7192223018128934940">"လိပ်စာအသစ် ပေါင်းမည်"</string>
     <string name="contact_editor_title_existing_contact" msgid="4898475703683187798">"အဆက်အသွယ်အားပြင်ရန်"</string>
     <string name="keep_local" msgid="1258761699192993322">"ဖုန်းထဲတွင်သာသိမ်းပါ"</string>
-    <string name="add_account" msgid="8201790677994503186">"အကောင့်ထပ်ထည့်ရန်"</string>
+    <string name="add_account" msgid="8201790677994503186">"အကောင့်ထပ်ထည့်ရန်"</string>
     <string name="add_new_account" msgid="5748627740680940264">"အကောင့်အသစ်ထည့်ပါ"</string>
     <string name="menu_export_database" msgid="2659719297530170820">"ဒေ့ဘာဘေ့စ်ဖိုင်များကို အပြင်သို့ထုတ်ပါ"</string>
-    <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"အဆက်အသွယ် အသစ်ကို ထည့်ရန်"</string>
+    <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"အဆက်အသွယ် အသစ်ကို ထည့်ရန်"</string>
     <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"ပိုပြီး ကြည့်ရန်"</string>
-    <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"လျှော့ပြီး ကြည့်ရန်"</string>
+    <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"လျှော့ပြီး ကြည့်ရန်"</string>
     <string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"အားလုံးကို ကြည့်ရန်"</string>
     <string name="recent_card_title" msgid="8982782042698001695">"မကြာမီတုန်းက"</string>
     <string name="about_card_title" msgid="2920942314212825637">"အကြောင်း"</string>
diff --git a/res/values-sw600dp-land/integers.xml b/res/values-sw600dp-land/integers.xml
index bcc008d..4bf44c0 100644
--- a/res/values-sw600dp-land/integers.xml
+++ b/res/values-sw600dp-land/integers.xml
@@ -18,4 +18,11 @@
     <integer name="contact_tile_column_count_in_favorites">4</integer>
 
     <integer name="contact_tile_column_count">3</integer>
+
+    <!-- Layout weight of space elements in PeopleActivity for favorites list and all
+        contacts list-->
+    <integer name="people_activity_space_layout_weight">1</integer>
+    <!-- Layout weight of ListViews in PeopleActivityfor tile favorites list and all
+         contacts list in PeopleActivity -->
+    <integer name="people_activity_list_view_layout_weight">3</integer>
 </resources>
diff --git a/res/values-sw600dp/bools.xml b/res/values-sw600dp/bools.xml
new file mode 100644
index 0000000..2ef703c
--- /dev/null
+++ b/res/values-sw600dp/bools.xml
@@ -0,0 +1,20 @@
+<?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.
+-->
+<resources>
+
+    <bool name="contact_all_list_show_card_frame">true</bool>
+
+</resources>
diff --git a/res/values-sw600dp/integers.xml b/res/values-sw600dp/integers.xml
index c629f7e..ab2a52d 100644
--- a/res/values-sw600dp/integers.xml
+++ b/res/values-sw600dp/integers.xml
@@ -15,4 +15,10 @@
 -->
 <resources>
     <integer name="contact_tile_column_count">2</integer>
+    <!-- Layout weight of space elements in PeopleActivity for favorites list and all
+       contacts list-->
+    <integer name="people_activity_space_layout_weight">1</integer>
+    <!-- Layout weight of ListViews in PeopleActivityfor tile favorites list and all
+         contacts list in PeopleActivity -->
+    <integer name="people_activity_list_view_layout_weight">5</integer>
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 6439c1d..52918d5 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -47,6 +47,13 @@
     <!-- Left padding of a field in the Editor -->
     <dimen name="editor_field_left_padding">4dip</dimen>
 
+    <!-- End padding added to spinners in the editor. This separates the spinner text from the
+        spinner graphic when Button gravity is incorrectly set in RTL mode
+        (see framework bug b/17011078. In LTR mode this shouldn't have an observable affect.
+        We set paddingEnd instead of drawablePadding since the spinner graphic is not a normal
+        drawable.  -->
+    <dimen name="editor_spinner_end_padding_workaround">24dip</dimen>
+
     <!-- Width of the Type-Label in the Editor -->
     <dimen name="editor_type_label_width">100dip</dimen>
 
@@ -144,6 +151,8 @@
     <dimen name="expanding_entry_card_title_text_size">16sp</dimen>
     <!-- Padding for the title text for a ExpandingEntryCardView -->
     <dimen name="expanding_entry_card_title_padding">16dp</dimen>
+    <!-- Extra top padding if the title is set to null -->
+    <dimen name="expanding_entry_card_null_title_top_extra_padding">2dp</dimen>
 
     <!-- Height of the separator between entries in an ExpandingEntryCardView -->
     <dimen name="expanding_entry_card_item_separator_height">1dp</dimen>
diff --git a/res/values/integers.xml b/res/values/integers.xml
index 3cd5711..0de1de1 100644
--- a/res/values/integers.xml
+++ b/res/values/integers.xml
@@ -24,10 +24,4 @@
     <!-- Number of lines the QuickContact title can have -->
     <integer name="quickcontact_title_lines">1</integer>
 
-    <!-- Layout weight of space elements in PeopleActivity for favorites list and all
-         contacts list when in sw600dp landscape. -->
-    <integer name="people_activity_land_space_layout_weight">2</integer>
-    <!-- Layout weight of ListViews in PeopleActivityfor tile favorites list and all
-         contacts list in PeopleActivity when in sw600dp landscape. -->
-    <integer name="people_activity_land_list_view_layout_weight">6</integer>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4d07bc7..5f17bcd 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -46,8 +46,8 @@
     <!-- Activity title when the user is selecting a contact.  [CHAR LIMIT=128] -->
     <string name="contactPickerActivityTitle">Choose a contact</string>
 
-    <!-- Activity title when the user is selecting a contact.  [CHAR LIMIT=30] -->
-    <string name="header_entry_contact_list_adapter_header_title">Select new contact</string>
+    <!-- Entry that prompts user to select a newly created contact.  [CHAR LIMIT=30] -->
+    <string name="header_entry_contact_list_adapter_header_title">Create new contact</string>
 
     <!-- Title for the activity that shows only starred contacts -->
     <string name="starredList">Starred</string>
diff --git a/src/com/android/contacts/list/ContactTileListFragment.java b/src/com/android/contacts/list/ContactTileListFragment.java
index 622c090..bce7bfe 100644
--- a/src/com/android/contacts/list/ContactTileListFragment.java
+++ b/src/com/android/contacts/list/ContactTileListFragment.java
@@ -97,15 +97,22 @@
         mListView.setItemsCanFocus(true);
         mListView.setAdapter(mAdapter);
 
-        // If the device is in the sw600dp class and in landscape mode, set a padding on the list
+        // If the device is in the sw600dp class, set a padding on the list
         // view so it appears in the center of the card in the layout.
         if (mContactAllListShowCardFrame) {
             SchedulingUtils.doOnPreDraw(mListView, true, new Runnable() {
                 @Override
                 public void run() {
+                    Resources res = getResources();
+                    int listSpaceWeight = res.getInteger(R.integer
+                            .people_activity_space_layout_weight);
+                    int listViewWeight = res.getInteger(R.integer
+                            .people_activity_list_view_layout_weight);
+                    double paddingPercent = (double) listSpaceWeight / (double)
+                            (listSpaceWeight * 2 + listViewWeight);
                     int width = mListView.getWidth();
-                    mListView.setPadding(width / 4, mListView.getPaddingTop(),
-                            width / 4, mListView.getPaddingBottom());
+                    mListView.setPadding((int) (width * paddingPercent), mListView.getPaddingTop(),
+                            (int)(width * paddingPercent), mListView.getPaddingBottom());
                 }
             });
         }
diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
index 9891a8f..7501bb8 100644
--- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
+++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
@@ -353,6 +353,15 @@
     }
 
     private void addEntry(View entry) {
+        // If no title and the first entry in the group, add extra padding
+        if (TextUtils.isEmpty(mTitleTextView.getText()) &&
+                mEntriesViewGroup.getChildCount() == 0) {
+            entry.setPadding(entry.getPaddingLeft(),
+                    entry.getPaddingTop() + getResources().getDimensionPixelSize(
+                            R.dimen.expanding_entry_card_null_title_top_extra_padding),
+                    entry.getPaddingRight(),
+                    entry.getPaddingBottom());
+        }
         mEntriesViewGroup.addView(entry);
     }
 
@@ -786,13 +795,30 @@
         if (mTitleTextView == null) {
             Log.e(TAG, "mTitleTextView is null");
         }
-        if (title == null) {
-            mTitleTextView.setVisibility(View.GONE);
-            findViewById(R.id.title_separator).setVisibility(View.GONE);
-        }
         mTitleTextView.setText(title);
-        mTitleTextView.setVisibility(View.VISIBLE);
-        findViewById(R.id.title_separator).setVisibility(View.VISIBLE);
+        mTitleTextView.setVisibility(TextUtils.isEmpty(title) ? View.GONE : View.VISIBLE);
+        findViewById(R.id.title_separator).setVisibility(TextUtils.isEmpty(title) ?
+                View.GONE : View.VISIBLE);
+        // If the title is set after children have been added, reset the top entry's padding to
+        // the default. Else if the title is cleared after children have been added, set
+        // the extra top padding
+        if (!TextUtils.isEmpty(title) && mEntriesViewGroup.getChildCount() > 0) {
+            View firstEntry = mEntriesViewGroup.getChildAt(0);
+            firstEntry.setPadding(firstEntry.getPaddingLeft(),
+                    getResources().getDimensionPixelSize(
+                            R.dimen.expanding_entry_card_item_padding_top),
+                    firstEntry.getPaddingRight(),
+                    firstEntry.getPaddingBottom());
+        } else if (!TextUtils.isEmpty(title) && mEntriesViewGroup.getChildCount() > 0) {
+            View firstEntry = mEntriesViewGroup.getChildAt(0);
+            firstEntry.setPadding(firstEntry.getPaddingLeft(),
+                    getResources().getDimensionPixelSize(
+                            R.dimen.expanding_entry_card_item_padding_top) +
+                            getResources().getDimensionPixelSize(
+                                    R.dimen.expanding_entry_card_null_title_top_extra_padding),
+                    firstEntry.getPaddingRight(),
+                    firstEntry.getPaddingBottom());
+        }
     }
 
     public boolean shouldShow() {
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index edcb662..357cae6 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -16,9 +16,6 @@
 
 package com.android.contacts.quickcontact;
 
-import android.animation.Animator;
-import android.animation.Animator.AnimatorListener;
-import android.animation.AnimatorListenerAdapter;
 import android.animation.ArgbEvaluator;
 import android.animation.ObjectAnimator;
 import android.app.Activity;
@@ -34,6 +31,7 @@
 import android.content.pm.ResolveInfo;
 import android.graphics.Bitmap;
 import android.graphics.Color;
+import android.graphics.Point;
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffColorFilter;
 import android.graphics.drawable.BitmapDrawable;
@@ -67,6 +65,7 @@
 import android.provider.ContactsContract.QuickContact;
 import android.provider.ContactsContract.RawContacts;
 import android.support.v7.graphics.Palette;
+import android.telecomm.TelecommManager;
 import android.text.TextUtils;
 import android.util.Log;
 import android.util.Pair;
@@ -80,7 +79,6 @@
 import android.view.View.OnCreateContextMenuListener;
 import android.view.WindowManager;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.Toast;
 import android.widget.Toolbar;
 
@@ -93,6 +91,7 @@
 import com.android.contacts.common.Collapser;
 import com.android.contacts.common.ContactsUtils;
 import com.android.contacts.common.editor.SelectAccountDialogFragment;
+import com.android.contacts.common.interactions.TouchPointManager;
 import com.android.contacts.common.lettertiles.LetterTileDrawable;
 import com.android.contacts.common.list.ShortcutIntentBuilder;
 import com.android.contacts.common.list.ShortcutIntentBuilder.OnShortcutIntentCreatedListener;
@@ -136,6 +135,7 @@
 import com.android.contacts.util.StructuredPostalUtils;
 import com.android.contacts.widget.MultiShrinkScroller;
 import com.android.contacts.widget.MultiShrinkScroller.MultiShrinkScrollerListener;
+
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 
@@ -213,9 +213,15 @@
     private SelectAccountDialogFragmentListener mSelectAccountFragmentListener;
     private AsyncTask<Void, Void, Pair<List<List<DataItem>>, Map<String, List<DataItem>>>>
             mEntriesAndActionsTask;
+    /**
+     *  This scrim's opacity is controlled in two different ways. 1) Before the initial entrance
+     *  animation finishes, the opacity is animated by a value animator. This is designed to
+     *  distract the user from the length of the initial loading time. 2) After the initial
+     *  entrance animation, the opacity is directly related to scroll position.
+     */
     private ColorDrawable mWindowScrim;
+    private boolean mIsEntranceAnimationFinished;
     private MaterialColorMapUtils mMaterialColorMapUtils;
-    private boolean mIsWaitingForOtherPieceOfExitAnimation;
     private boolean mIsExitAnimationInProgress;
     private boolean mHasComputedThemeColor;
 
@@ -328,6 +334,17 @@
                 Log.w(TAG, "Invalid Data ID");
             }
 
+            // Pass the touch point through the intent for use in the InCallUI
+            if (Intent.ACTION_CALL.equals(intent.getAction())) {
+                final Point touchPoint = TouchPointManager.getInstance().getPoint();
+
+                if (touchPoint.x != 0 || touchPoint.y != 0) {
+                    Bundle extras = new Bundle();
+                    extras.putParcelable(TouchPointManager.TOUCH_POINT, touchPoint);
+                    intent.putExtra(TelecommManager.EXTRA_OUTGOING_CALL_EXTRAS, extras);
+                }
+            }
+
             startActivity(intent);
         }
     };
@@ -406,11 +423,7 @@
             = new MultiShrinkScrollerListener() {
         @Override
         public void onScrolledOffBottom() {
-            if (!mIsWaitingForOtherPieceOfExitAnimation) {
-                finish();
-                return;
-            }
-            mIsWaitingForOtherPieceOfExitAnimation = false;
+            finish();
         }
 
         @Override
@@ -425,24 +438,19 @@
 
         @Override
         public void onStartScrollOffBottom() {
-            // Remove the window shim now that we are starting an Activity exit animation.
-            final int duration = getResources().getInteger(android.R.integer.config_shortAnimTime);
-            final ObjectAnimator animator = ObjectAnimator.ofInt(mWindowScrim, "alpha", 0xFF, 0);
-            animator.addListener(mExitWindowShimAnimationListener);
-            animator.setDuration(duration).start();
-            mIsWaitingForOtherPieceOfExitAnimation = true;
             mIsExitAnimationInProgress = true;
         }
-    };
 
-    final AnimatorListener mExitWindowShimAnimationListener = new AnimatorListenerAdapter() {
         @Override
-        public void onAnimationEnd(Animator animation) {
-            if (!mIsWaitingForOtherPieceOfExitAnimation) {
-                finish();
-                return;
+        public void onEntranceAnimationDone() {
+            mIsEntranceAnimationFinished = true;
+        }
+
+        @Override
+        public void onTransparentViewHeightChange(float ratio) {
+            if (mIsEntranceAnimationFinished) {
+                mWindowScrim.setAlpha((int) (0xFF * ratio));
             }
-            mIsWaitingForOtherPieceOfExitAnimation = false;
         }
     };
 
@@ -584,13 +592,10 @@
         toolbar.addView(getLayoutInflater().inflate(R.layout.quickcontact_title_placeholder, null));
 
         mHasAlreadyBeenOpened = savedInstanceState != null;
-
+        mIsEntranceAnimationFinished = mHasAlreadyBeenOpened;
         mWindowScrim = new ColorDrawable(SCRIM_COLOR);
+        mWindowScrim.setAlpha(0);
         getWindow().setBackgroundDrawable(mWindowScrim);
-        if (!mHasAlreadyBeenOpened) {
-            final int duration = getResources().getInteger(android.R.integer.config_shortAnimTime);
-            ObjectAnimator.ofInt(mWindowScrim, "alpha", 0, 0xFF).setDuration(duration).start();
-        }
 
         mScroller.initialize(mMultiShrinkScrollerListener, mExtraMode == MODE_FULLY_EXPANDED);
         // mScroller needs to perform asynchronous measurements after initalize(), therefore
@@ -609,6 +614,26 @@
         }
         mSelectAccountFragmentListener.setQuickContactActivity(this);
 
+        SchedulingUtils.doOnPreDraw(mScroller, /* drawNextFrame = */ true,
+                new Runnable() {
+                    @Override
+                    public void run() {
+                        if (!mHasAlreadyBeenOpened) {
+                            // The initial scrim opacity must match the scrim opacity that would be
+                            // achieved by scrolling to the starting position.
+                            final float alphaRatio = mExtraMode == MODE_FULLY_EXPANDED ?
+                                    1 : mScroller.getStartingTransparentHeightRatio();
+                            final int duration = getResources().getInteger(
+                                    android.R.integer.config_shortAnimTime);
+                            final int desiredAlpha = (int) (0xFF * alphaRatio);
+                            ObjectAnimator o = ObjectAnimator.ofInt(mWindowScrim, "alpha", 0,
+                                    desiredAlpha).setDuration(duration);
+
+                            o.start();
+                        }
+                    }
+                });
+
         if (savedInstanceState != null) {
             final int color = savedInstanceState.getInt(KEY_THEME_COLOR, 0);
             SchedulingUtils.doOnPreDraw(mScroller, /* drawNextFrame = */ false,
@@ -648,6 +673,7 @@
     protected void onNewIntent(Intent intent) {
         super.onNewIntent(intent);
         mHasAlreadyBeenOpened = true;
+        mIsEntranceAnimationFinished = true;
         mHasComputedThemeColor = false;
         processIntent(intent);
     }
diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java
index ff84b2f..82b3970 100644
--- a/src/com/android/contacts/widget/MultiShrinkScroller.java
+++ b/src/com/android/contacts/widget/MultiShrinkScroller.java
@@ -9,6 +9,8 @@
 import android.animation.Animator.AnimatorListener;
 import android.animation.AnimatorListenerAdapter;
 import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
+import android.animation.ValueAnimator.AnimatorUpdateListener;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.TypedArray;
@@ -163,6 +165,10 @@
 
         void onStartScrollOffBottom();
 
+        void onTransparentViewHeightChange(float ratio);
+
+        void onEntranceAnimationDone();
+
         void onEnterFullscreen();
 
         void onExitFullscreen();
@@ -560,6 +566,19 @@
         }
     }
 
+    /**
+     * Return ratio of non-transparent:viewgroup-height for this viewgroup at the starting position.
+     */
+    public float getStartingTransparentHeightRatio() {
+        return getTransparentHeightRatio(mTransparentStartHeight);
+    }
+
+    private float getTransparentHeightRatio(int transparentHeight) {
+        final float heightRatio = (float) transparentHeight / getHeight();
+        // Clamp between [0, 1] in case this is called before height is initialized.
+        return 1.0f - Math.max(Math.min(1.0f, heightRatio), 0f);
+    }
+
     public void scrollOffBottom() {
         final Interpolator interpolator = new AcceleratingFlingInterpolator(
                 EXIT_FLING_ANIMATION_DURATION_MS, getCurrentVelocity(),
@@ -588,10 +607,19 @@
                 - (getHeight() - getTransparentViewHeight()) + 1;
         final Interpolator interpolator = AnimationUtils.loadInterpolator(getContext(),
                 android.R.interpolator.linear_out_slow_in);
+        final int desiredValue = currentPosition + (scrollToCurrentPosition ? currentPosition
+                : getTransparentViewHeight());
         final ObjectAnimator animator = ObjectAnimator.ofInt(this, "scroll", bottomScrollPosition,
-                currentPosition + (scrollToCurrentPosition ? currentPosition
-                : getTransparentViewHeight()));
+                desiredValue);
         animator.setInterpolator(interpolator);
+        animator.addUpdateListener(new AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                if (animation.getAnimatedValue().equals(desiredValue) && mListener != null) {
+                    mListener.onEntranceAnimationDone();
+                }
+            }
+        });
         animator.start();
     }
 
@@ -614,6 +642,10 @@
             } else if (!wasFullscreen && isFullscreen) {
                 mListener.onEnterFullscreen();
             }
+            if (!isFullscreen || !wasFullscreen) {
+                mListener.onTransparentViewHeightChange(
+                        getTransparentHeightRatio(getTransparentViewHeight()));
+            }
         }
     }
 
@@ -954,10 +986,14 @@
         // How offset the title should be from the bottom of the toolbar
         final int pretendBottomMargin =  (int) (mCollapsedTitleBottomMargin * (1 - x)
                 + mMaximumTitleMargin * x) ;
-        // Calculate how offset the title should be from the top of the screen.
+        // Calculate how offset the title should be from the top of the screen. Instead of
+        // calling mLargeTextView.getHeight() use the mMaximumHeaderTextSize for this calculation.
+        // The getHeight() value acts unexpectedly when mLargeTextView is partially clipped by
+        // its parent.
         titleLayoutParams.topMargin = getTransparentViewHeight()
                 + toolbarLayoutParams.height - pretendBottomMargin
-                - mLargeTextView.getHeight();
+                - mMaximumHeaderTextSize;
+        titleLayoutParams.bottomMargin = 0;
         mLargeTextView.setLayoutParams(titleLayoutParams);
     }