Merge "[DO NOT MERGE] Change icon shape and color for search shortcuts" into lmp-preview-dev
diff --git a/res/drawable/call_log_background.xml b/res/drawable/call_log_background.xml
index c0c4889..4857fb5 100644
--- a/res/drawable/call_log_background.xml
+++ b/res/drawable/call_log_background.xml
@@ -15,5 +15,5 @@
      limitations under the License.
 -->
 <ripple xmlns:android="http://schemas.android.com/apk/res/android"
-                android:tint="?android:attr/colorControlHighlight"
-                android:pinned="false" />
+    android:tint="?android:attr/colorControlHighlight"
+    android:pinned="false" />
\ No newline at end of file
diff --git a/res/drawable/recent_lists_footer_background.xml b/res/drawable/recent_lists_footer_background.xml
new file mode 100644
index 0000000..566e353
--- /dev/null
+++ b/res/drawable/recent_lists_footer_background.xml
@@ -0,0 +1,23 @@
+<?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
+  -->
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    android:tint="?android:attr/colorControlHighlight"
+    android:pinned="false">
+    <!-- Mask to constrain the ripple to the bounds of the view. -->
+    <item android:drawable="@android:color/transparent" />
+</ripple>
diff --git a/res/layout/call_log_fragment.xml b/res/layout/call_log_fragment.xml
index 7b6aa28..fb7ed2a 100644
--- a/res/layout/call_log_fragment.xml
+++ b/res/layout/call_log_fragment.xml
@@ -71,7 +71,6 @@
             android:background="@color/background_dialer_list_items"
             android:divider="@null"
             android:nestedScrollingEnabled="true"
-            android:clipChildren="false"
         />
         <TextView android:id="@android:id/empty"
             android:layout_width="match_parent"
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index 9182bd7..9899424 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -14,40 +14,37 @@
      limitations under the License.
 -->
 
-<view
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<view xmlns:android="http://schemas.android.com/apk/res/android"
     class="com.android.dialer.calllog.CallLogListItemView"
+    android:id="@+id/call_log_list_item"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:paddingBottom="@dimen/call_log_outer_margin"
-    android:id="@+id/call_log_list_item"
     android:orientation="vertical"
-    android:clipChildren="false"
->
+    android:background="@color/background_dialer_list_items" >
+
     <!-- Day group heading. Used to show a "today", "yesterday", "last week" or "other" heading
          above a group of call log entries. -->
     <TextView
         android:id="@+id/call_log_day_group_label"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/call_log_outer_margin"
+        android:layout_marginStart="@dimen/call_log_start_margin"
         android:layout_marginEnd="@dimen/call_log_outer_margin"
         android:textColor="?attr/call_log_secondary_text_color"
         android:textSize="@dimen/call_log_secondary_text_size"
         android:paddingTop="@dimen/call_log_day_group_padding"
         android:paddingBottom="0dp"
         />
+
     <!-- Linear layout to separate the primary area containing the contact badge and caller
          information and the secondary action (call details / play voicemail). -->
     <LinearLayout
         android:id="@+id/call_log_row"
-        android:background="@color/background_dialer_list_items"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:baselineAligned="false"
         android:orientation="vertical"
-        android:gravity="center_vertical"
-        >
+        android:gravity="center_vertical" >
 
         <!-- Primary area containing the contact badge and caller information -->
         <LinearLayout
@@ -55,15 +52,15 @@
             android:background="@drawable/call_log_background"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:paddingLeft="@dimen/call_log_outer_margin"
-            android:paddingRight="@dimen/call_log_outer_margin"
+            android:paddingStart="@dimen/call_log_start_margin"
+            android:paddingEnd="@dimen/call_log_outer_margin"
             android:paddingTop="@dimen/call_log_outer_margin"
+            android:paddingBottom="@dimen/call_log_outer_margin"
             android:orientation="horizontal"
             android:gravity="center_vertical"
             android:focusable="true"
             android:nextFocusRight="@+id/call_back_action"
-            android:nextFocusLeft="@+id/quick_contact_photo"
-            >
+            android:nextFocusLeft="@+id/quick_contact_photo" >
             <QuickContactBadge
                 android:id="@+id/quick_contact_photo"
                 android:layout_width="@dimen/call_log_list_contact_photo_size"
@@ -78,7 +75,7 @@
                 android:layout_weight="1"
                 android:orientation="vertical"
                 android:gravity="center_vertical"
-                android:layout_marginStart="@dimen/call_log_inner_margin"
+                android:layout_marginStart="@dimen/call_log_start_margin"
                 >
                 <TextView
                     android:id="@+id/name"
diff --git a/res/layout/call_log_list_item_actions.xml b/res/layout/call_log_list_item_actions.xml
index 9ee9a0f..3a93575 100644
--- a/res/layout/call_log_list_item_actions.xml
+++ b/res/layout/call_log_list_item_actions.xml
@@ -24,7 +24,7 @@
         android:layout_width="match_parent"
         android:layout_height="@dimen/call_log_action_height"
         android:orientation="horizontal"
-        android:paddingLeft="@dimen/call_log_actions_left_padding"
+        android:paddingStart="@dimen/call_log_actions_left_padding"
         android:visibility="visible"
         android:importantForAccessibility="1"
         >
@@ -35,8 +35,8 @@
             android:gravity="center"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
-            android:paddingLeft="@dimen/call_log_action_horizontal_padding"
-            android:paddingRight="@dimen/call_log_action_horizontal_padding"
+            android:paddingStart="@dimen/call_log_action_horizontal_padding"
+            android:paddingEnd="@dimen/call_log_action_horizontal_padding"
             android:text="@string/call_log_action_call_back"
             android:textColor="@color/call_log_action_text"
             android:textSize="@dimen/call_log_secondary_text_size"
@@ -51,8 +51,8 @@
             android:gravity="center"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
-            android:paddingLeft="@dimen/call_log_action_horizontal_padding"
-            android:paddingRight="@dimen/call_log_action_horizontal_padding"
+            android:paddingStart="@dimen/call_log_action_horizontal_padding"
+            android:paddingEnd="@dimen/call_log_action_horizontal_padding"
             android:text="@string/call_log_action_voicemail"
             android:textColor="@color/call_log_action_text"
             android:textSize="@dimen/call_log_secondary_text_size"
@@ -67,8 +67,8 @@
             android:gravity="center"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
-            android:paddingLeft="@dimen/call_log_action_horizontal_padding"
-            android:paddingRight="@dimen/call_log_action_horizontal_padding"
+            android:paddingStart="@dimen/call_log_action_horizontal_padding"
+            android:paddingEnd="@dimen/call_log_action_horizontal_padding"
             android:text="@string/call_log_action_details"
             android:textColor="?attr/call_log_secondary_text_color"
             android:textSize="@dimen/call_log_secondary_text_size"
diff --git a/res/layout/recents_list_footer.xml b/res/layout/recents_list_footer.xml
index 6156456..7670d81 100644
--- a/res/layout/recents_list_footer.xml
+++ b/res/layout/recents_list_footer.xml
@@ -30,4 +30,4 @@
     android:textColor="@color/view_full_call_history_color"
     android:textSize="14sp"
     android:text="@string/recents_footer_text"
-    android:background="?android:attr/selectableItemBackground" />
+    android:background="@drawable/recent_lists_footer_background" />
diff --git a/res/layout/speeddial_fragment.xml b/res/layout/speeddial_fragment.xml
index e8587fa..f025e61 100644
--- a/res/layout/speeddial_fragment.xml
+++ b/res/layout/speeddial_fragment.xml
@@ -40,7 +40,7 @@
             android:clipToPadding="false"
             android:fadingEdge="none"
             android:divider="@null"
-            android:paddingBottom="@dimen/floating_action_button_height"
+            android:paddingBottom="@dimen/floating_action_button_list_bottom_padding"
             android:nestedScrollingEnabled="true" />
     </FrameLayout>
 
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 1844c4c..78d91c2 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -30,27 +30,21 @@
     <dimen name="call_log_call_action_width">54dp</dimen>
     <dimen name="call_log_icon_margin">4dip</dimen>
     <dimen name="call_log_inner_margin">8dip</dimen>
-    <dimen name="call_log_outer_margin">8dip</dimen>
+    <dimen name="call_log_outer_margin">8dp</dimen>
+    <dimen name="call_log_start_margin">16dp</dimen>
     <dimen name="call_log_indent_margin">24dip</dimen>
     <dimen name="call_log_list_item_height">56dip</dimen>
     <dimen name="call_log_list_contact_photo_size">40dip</dimen>
     <dimen name="call_detail_contact_name_margin">24dip</dimen>
     <dimen name="call_detail_button_spacing">2dip</dimen>
-    <!-- Defines the vertical margin for the vertical separator between
-         the main area of a call log entry and the secondary action button. -->
-    <dimen name="call_log_list_item_vertical_divider_margin">17dp</dimen>
-
-    <!-- Defines the width of the vertical separator between
-         the main area of a call log entry and the secondary action button. -->
-    <dimen name="call_log_list_item_vertical_divider_width">1dp</dimen>
 
     <!-- Match call_button_height to Phone's dimens/in_call_end_button_height -->
     <dimen name="call_button_height">74dp</dimen>
 
     <!-- Right margin of the floating action button -->
-    <dimen name="floating_action_button_margin_right">10dp</dimen>
+    <dimen name="floating_action_button_margin_right">16dp</dimen>
     <!-- Bottom margin of the floating action button -->
-    <dimen name="floating_action_button_margin_bottom">10dp</dimen>
+    <dimen name="floating_action_button_margin_bottom">16dp</dimen>
 
     <!-- Dimensions for speed dial tiles -->
     <dimen name="contact_tile_divider_width">1dp</dimen>
@@ -69,6 +63,8 @@
     <!-- Dimensions for most recent call shortcut cards -->
     <dimen name="recent_call_log_item_translation_z">5dp</dimen>
     <dimen name="recent_call_log_item_padding">8dp</dimen>
+    <!-- The maximum amount to clip on the left and right of the recent call shortcut card -->
+    <dimen name="recent_call_log_item_horizontal_clip_limit">20dp</dimen>
 
     <!-- Size of the star icon on the favorites tile. -->
     <dimen name="favorites_star_icon_size">12dp</dimen>
@@ -123,15 +119,15 @@
          to the right of the contact badge.  Adjust when any of the following change:
          call_log_action_horizontal_padding
          call_log_list_contact_photo_size  -->
-    <dimen name="call_log_actions_left_padding">48dp</dimen>
+    <dimen name="call_log_actions_left_padding">64dp</dimen>
     <!-- Text size for primary call log text -->
     <dimen name="call_log_primary_text_size">16sp</dimen>
     <!-- Text size for secondary call log text -->
     <dimen name="call_log_secondary_text_size">14sp</dimen>
     <!-- Height of the call log actions section for each call log entry -->
     <dimen name="call_log_action_height">48dp</dimen>
-    <!-- Elevation of expanded call log items. -->
-    <dimen name="call_log_expanded_elevation">4dp</dimen>
+    <!-- Z Translation of expanded call log items. -->
+    <dimen name="call_log_expanded_translation_z">4dp</dimen>
     <!-- Padding above call log day group headers. -->
     <dimen name="call_log_day_group_padding">16dp</dimen>
 
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 66c4d03..9906513 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -22,7 +22,6 @@
 import android.content.res.Resources;
 import android.database.Cursor;
 import android.net.Uri;
-import android.os.AsyncTask;
 import android.os.Handler;
 import android.os.Message;
 import android.provider.CallLog.Calls;
@@ -35,7 +34,6 @@
 import android.view.ViewTreeObserver;
 import android.widget.ImageView;
 import android.widget.TextView;
-import android.widget.Toast;
 
 import com.android.common.widget.GroupingListAdapter;
 import com.android.contacts.common.ContactPhotoManager;
@@ -45,8 +43,6 @@
 import com.android.dialer.PhoneCallDetails;
 import com.android.dialer.PhoneCallDetailsHelper;
 import com.android.dialer.R;
-import com.android.dialer.util.AsyncTaskExecutor;
-import com.android.dialer.util.AsyncTaskExecutors;
 import com.android.dialer.util.ExpirableCache;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -126,10 +122,10 @@
     private static final int CONTACT_INFO_CACHE_SIZE = 100;
 
     /** Localized string representing the word "Today". */
-    private static final CharSequence TODAY_LABEL = DateUtils.getTodayString();
+    private final CharSequence mTodayLabel = DateUtils.getTodayString();
 
     /** Localized string representing the word "Yesterday". */
-    private static final CharSequence YESTERDAY_LABEL = DateUtils.getYesterdayString();
+    private final CharSequence mYesterdayLabel = DateUtils.getYesterdayString();
 
     /** Constant used to indicate no row is expanded. */
     private static final long NONE_EXPANDED = -1;
@@ -139,9 +135,6 @@
     private final CallFetcher mCallFetcher;
     private ViewTreeObserver mViewTreeObserver = null;
 
-    /** Aynchronous task executor, lazy instantiated as needed. */
-    private AsyncTaskExecutor mAsyncTaskExecutor;
-
     /**
      * A cache of the contact details for the phone numbers in the call log.
      * <p>
@@ -865,8 +858,8 @@
             views.actionsView.setAlpha(1.0f);
             views.callLogEntryView.setBackgroundColor(
                     callLogItem.getResources().getColor(R.color.background_dialer_light));
-            views.callLogEntryView.setElevation(
-                    callLogItem.getResources().getDimension(R.dimen.call_log_expanded_elevation));
+            views.callLogEntryView.setTranslationZ(callLogItem.getResources().getDimension(
+                    R.dimen.call_log_expanded_translation_z));
 
             // Attempt to give accessibility focus to one of the action buttons.
             // This ensures that a user realizes the expansion occurred.
@@ -1327,9 +1320,9 @@
      */
     private CharSequence getGroupDescription(int group) {
        if (group == CallLogGroupBuilder.DAY_GROUP_TODAY) {
-           return TODAY_LABEL;
+           return mTodayLabel;
        } else if (group == CallLogGroupBuilder.DAY_GROUP_YESTERDAY) {
-           return YESTERDAY_LABEL;
+           return mYesterdayLabel;
        } else if (group == CallLogGroupBuilder.DAY_GROUP_LAST_WEEK) {
            return mContext.getResources().getString(R.string.call_log_header_last_week);
        } else {
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index 232aa39..6cf6e45 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -26,6 +26,7 @@
 import android.content.Intent;
 import android.database.ContentObserver;
 import android.database.Cursor;
+import android.graphics.Outline;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
@@ -46,6 +47,7 @@
 import com.android.contacts.common.CallUtil;
 import com.android.contacts.common.GeoUtil;
 import com.android.contacts.common.util.PhoneNumberHelper;
+import com.android.contacts.common.util.ViewUtil;
 import com.android.dialer.R;
 import com.android.dialer.list.ListsFragment.HostInterface;
 import com.android.dialer.util.EmptyLoader;
@@ -94,7 +96,11 @@
     private boolean mCallLogFetched;
     private boolean mVoicemailStatusFetched;
 
-    private float mExpandedItemElevation;
+    private float mExpandedItemTranslationZ;
+    private int mFadeInDuration;
+    private int mFadeInStartDelay;
+    private int mFadeOutDuration;
+    private int mExpandCollapseDuration;
 
     private final Handler mHandler = new Handler();
 
@@ -195,7 +201,13 @@
         setHasOptionsMenu(true);
         updateCallList(mCallTypeFilter, mDateLimit);
 
-        mExpandedItemElevation = getResources().getDimension(R.dimen.call_log_expanded_elevation);
+        mExpandedItemTranslationZ =
+                getResources().getDimension(R.dimen.call_log_expanded_translation_z);
+        mFadeInDuration = getResources().getInteger(R.integer.call_log_actions_fade_in_duration);
+        mFadeInStartDelay = getResources().getInteger(R.integer.call_log_actions_fade_start);
+        mFadeOutDuration = getResources().getInteger(R.integer.call_log_actions_fade_out_duration);
+        mExpandCollapseDuration = getResources().getInteger(
+                R.integer.call_log_expand_collapse_duration);
     }
 
     /** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */
@@ -552,6 +564,8 @@
         final ListView listView = getListView();
         listView.removeFooterView(mFooterView);
         listView.addFooterView(mFooterView);
+
+        ViewUtil.addBottomPaddingToListViewForFab(listView, getResources());
     }
 
     @Override
@@ -578,27 +592,36 @@
                     viewHolder.actionsView.setVisibility(View.VISIBLE);
                 }
 
+                // If the day group header is shown, subtract the header from the outline of the
+                // view. The outline is used for generating the shadow of the view, but we only want
+                // a shadow on the call log list item and not the header. This is a slight hack, but
+                // the hierarchy of the call log list items makes it hard to achieve the desired
+                // shadow behavior otherwise.
+                if (viewHolder.dayGroupHeader.isShown()) {
+                    Outline outline = new Outline();
+                    outline.setRect(
+                            0 /* left */,
+                            viewHolder.dayGroupHeader.getHeight() /* top */,
+                            view.getWidth() /* right */,
+                            view.getHeight() /* bottom */);
+                    view.setOutline(outline);
+                }
+
                 // Set up the fade effect for the action buttons.
                 if (isExpand) {
-                    int fadeDuration = getResources().getInteger(
-                            R.integer.call_log_actions_fade_in_duration);
-                    int startDelay = getResources().getInteger(
-                            R.integer.call_log_actions_fade_start);
                     // Start the fade in after the expansion has partly completed, otherwise it
                     // will be mostly over before the expansion completes.
                     viewHolder.actionsView.setAlpha(0f);
                     viewHolder.actionsView.animate()
                             .alpha(1f)
-                            .setStartDelay(startDelay)
-                            .setDuration(fadeDuration)
+                            .setStartDelay(mFadeInStartDelay)
+                            .setDuration(mFadeInDuration)
                             .start();
                 } else {
-                    int fadeDuration = getResources().getInteger(
-                            R.integer.call_log_actions_fade_out_duration);
                     viewHolder.actionsView.setAlpha(1f);
                     viewHolder.actionsView.animate()
                             .alpha(0f)
-                            .setDuration(fadeDuration)
+                            .setDuration(mFadeOutDuration)
                             .start();
                 }
                 view.requestLayout();
@@ -613,10 +636,8 @@
                         Float value = (Float) animator.getAnimatedValue();
 
                         // For each value from 0 to 1, animate the various parts of the layout.
-                        view.getLayoutParams().height =
-                                (int) (value * distance + baseHeight);
-                        viewHolder.callLogEntryView
-                                .setElevation(mExpandedItemElevation * value);
+                        view.getLayoutParams().height = (int) (value * distance + baseHeight);
+                        view.setTranslationZ(mExpandedItemTranslationZ * value);
                         view.requestLayout();
                     }
                 });
@@ -632,17 +653,14 @@
                     }
 
                     @Override
-                    public void onAnimationCancel(Animator animation) {}
+                    public void onAnimationCancel(Animator animation) { }
                     @Override
                     public void onAnimationRepeat(Animator animation) { }
                     @Override
                     public void onAnimationStart(Animator animation) { }
                 });
 
-                final int expandCollapseDuration = getResources().getInteger(
-                        R.integer.call_log_expand_collapse_duration);
-
-                animator.setDuration(expandCollapseDuration);
+                animator.setDuration(mExpandCollapseDuration);
                 animator.start();
 
                 // Return false so this draw does not occur to prevent the final frame from
diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java
index d05f66d..816869f 100644
--- a/src/com/android/dialer/list/AllContactsFragment.java
+++ b/src/com/android/dialer/list/AllContactsFragment.java
@@ -23,13 +23,14 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
+import android.widget.ListView;
 import android.widget.QuickContactBadge;
 
 import com.android.contacts.common.list.ContactEntryListAdapter;
 import com.android.contacts.common.list.ContactEntryListFragment;
 import com.android.contacts.common.list.ContactListFilter;
-import com.android.contacts.common.list.ContactListItemView;
 import com.android.contacts.common.list.DefaultContactListAdapter;
+import com.android.contacts.common.util.ViewUtil;
 import com.android.dialer.R;
 
 /**
@@ -46,6 +47,12 @@
     }
 
     @Override
+    public void onViewCreated(View view, android.os.Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        ViewUtil.addBottomPaddingToListViewForFab(getListView(), getResources());
+    }
+
+    @Override
     protected ContactEntryListAdapter createListAdapter() {
         final DefaultContactListAdapter adapter = new DefaultContactListAdapter(getActivity()) {
             @Override
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java
index ac3818c..78570e1 100644
--- a/src/com/android/dialer/list/ListsFragment.java
+++ b/src/com/android/dialer/list/ListsFragment.java
@@ -126,12 +126,12 @@
     private PanelSlideListener mPanelSlideListener = new PanelSlideListener() {
         @Override
         public void onPanelSlide(View panel, float slideOffset) {
-            // For every 2 percent that the panel is slid upwards, clip 3 percent from each edge
+            // For every 1 percent that the panel is slid upwards, clip 2 percent from each edge
             // of the shortcut card, to achieve the animated effect of the shortcut card
             // rapidly shrinking and disappearing from view when the panel is slid upwards.
             // slideOffset is 1 when the shortcut card is fully exposed, and 0 when completely
             // hidden.
-            float ratioCardHidden = (1 - slideOffset) * 1.5f;
+            float ratioCardHidden = (1 - slideOffset) * 2f;
             if (mShortcutCardsListView.getCount() > 0) {
                 SwipeableShortcutCard v =
                         (SwipeableShortcutCard) mShortcutCardsListView.getChildAt(0);
diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java
index ab76fdc..f863d90 100644
--- a/src/com/android/dialer/list/SearchFragment.java
+++ b/src/com/android/dialer/list/SearchFragment.java
@@ -17,6 +17,7 @@
 
 import android.app.Activity;
 import android.content.Intent;
+import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.AbsListView;
@@ -27,6 +28,7 @@
 import com.android.contacts.common.list.ContactListItemView;
 import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
 import com.android.contacts.common.list.PhoneNumberPickerFragment;
+import com.android.contacts.common.util.ViewUtil;
 import com.android.dialer.DialtactsActivity;
 import com.android.dialer.R;
 import com.android.dialer.list.OnListFragmentScrolledListener;
@@ -96,6 +98,12 @@
     }
 
     @Override
+    public void onViewCreated(View view, Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        ViewUtil.addBottomPaddingToListViewForFab(getListView(), getResources());
+    }
+
+    @Override
     protected void setSearchMode(boolean flag) {
         super.setSearchMode(flag);
         // This hides the "All contacts with phone numbers" header in the search fragment
diff --git a/src/com/android/dialer/list/ShortcutCardsAdapter.java b/src/com/android/dialer/list/ShortcutCardsAdapter.java
index b4266d3..4df44f0 100644
--- a/src/com/android/dialer/list/ShortcutCardsAdapter.java
+++ b/src/com/android/dialer/list/ShortcutCardsAdapter.java
@@ -55,6 +55,7 @@
     private final ListsFragment mFragment;
 
     private final int mCallLogPadding;
+    private final int mCardMaxHorizontalClip;
 
     private final Context mContext;
 
@@ -101,6 +102,8 @@
         final Resources resources = context.getResources();
         mContext = context;
         mFragment = fragment;
+        mCardMaxHorizontalClip = resources.getDimensionPixelSize(
+                R.dimen.recent_call_log_item_horizontal_clip_limit);
         mCallLogPadding = resources.getDimensionPixelSize(R.dimen.recent_call_log_item_padding);
         mCallLogAdapter = callLogAdapter;
         mObserver = new CustomDataSetObserver();
@@ -301,8 +304,8 @@
             if (ratioHidden > 0.5f) {
                 mClipRect.set(0, 0 , 0, 0);
             } else {
-                int newLeft = (int) (ratioHidden * width);
-                int newRight = (width - newLeft);
+                int newLeft = (int) (ratioHidden * mCardMaxHorizontalClip);
+                int newRight = width - newLeft;
                 int newTop = (int) (ratioHidden * height);
                 int newBottom = (height - newTop);
                 mClipRect.set(newLeft, newTop, newRight, newBottom);
@@ -313,7 +316,7 @@
             final ViewGroup viewGroup = (ViewGroup) viewToClip;
             final int count = viewGroup.getChildCount();
             for (int i = 0; i < count; i++) {
-                viewGroup.getChildAt(i).setAlpha(Math.max(0, 1 - 4 * ratioHidden));
+                viewGroup.getChildAt(i).setAlpha(Math.max(0, 1 - 3 * ratioHidden));
             }
         }
     }