From 369851799cfc890ddbc8af777f7f662f6304dd65 Mon Sep 17 00:00:00 2001 From: Raj Yengisetty Date: Mon, 2 Mar 2015 14:52:47 -0800 Subject: App drawer smooth scrolling Also fixes searchbar visibility when dragging icons from app drawer Change-Id: I418dc3210a95cc57c81979452def8240c27d2214 --- res/layout/app_drawer_container.xml | 2 ++ res/layout/app_drawer_item.xml | 4 ---- res/layout/scrub_layout.xml | 2 +- res/values/dimens.xml | 1 + src/com/android/launcher3/AppDrawerListAdapter.java | 17 ++--------------- src/com/android/launcher3/AppDrawerScrubber.java | 4 ++-- src/com/android/launcher3/DragLayer.java | 5 +++-- 7 files changed, 11 insertions(+), 24 deletions(-) diff --git a/res/layout/app_drawer_container.xml b/res/layout/app_drawer_container.xml index 3706e448d..f5db08ce1 100644 --- a/res/layout/app_drawer_container.xml +++ b/res/layout/app_drawer_container.xml @@ -42,6 +42,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" + android:paddingBottom="@dimen/scrubber_height" android:overScrollMode="never"/> @@ -63,6 +64,7 @@ android:id="@+id/app_drawer_scrubber" android:layout_width="match_parent" android:layout_height="wrap_content" + android:clickable="true" android:layout_gravity="bottom"/> diff --git a/res/layout/app_drawer_item.xml b/res/layout/app_drawer_item.xml index e2d105f5a..08043eb1f 100644 --- a/res/layout/app_drawer_item.xml +++ b/res/layout/app_drawer_item.xml @@ -44,8 +44,4 @@ android:layout_height="wrap_content" android:orientation="horizontal" /> - diff --git a/res/layout/scrub_layout.xml b/res/layout/scrub_layout.xml index 4b10e45d7..90a9d094d 100644 --- a/res/layout/scrub_layout.xml +++ b/res/layout/scrub_layout.xml @@ -27,7 +27,7 @@ android:layout_width="match_parent" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" - android:layout_height="48dp"> + android:layout_height="@dimen/scrubber_height"> 50dp 30dp + 48dp 5px diff --git a/src/com/android/launcher3/AppDrawerListAdapter.java b/src/com/android/launcher3/AppDrawerListAdapter.java index 9c97642f6..52e35ff2c 100644 --- a/src/com/android/launcher3/AppDrawerListAdapter.java +++ b/src/com/android/launcher3/AppDrawerListAdapter.java @@ -38,7 +38,6 @@ import java.util.ListIterator; public class AppDrawerListAdapter extends RecyclerView.Adapter implements View.OnLongClickListener, DragSource, SectionIndexer { - private static final int SCRUBBER_MARGIN_FROM_BOTTOM_DP = 80; private static final char NUMERIC_OR_SPECIAL_CHAR = '#'; private static final String NUMERIC_OR_SPECIAL_HEADER = "#"; @@ -48,18 +47,16 @@ public class AppDrawerListAdapter extends RecyclerView.Adapter mSectionHeaders; - private LinearLayout.LayoutParams mIconParams, mSpacerParams; + private LinearLayout.LayoutParams mIconParams; private Rect mIconRect; public static class ViewHolder extends RecyclerView.ViewHolder { public AutoFitTextView mTextView; public ViewGroup mLayout; - public View mSpacer; public ViewHolder(View itemView) { super(itemView); mTextView = (AutoFitTextView) itemView.findViewById(R.id.drawer_item_title); mLayout = (ViewGroup) itemView.findViewById(R.id.drawer_item_flow); - mSpacer = itemView.findViewById(R.id.spacer); } } @@ -75,9 +72,6 @@ public class AppDrawerListAdapter extends RecyclerView.Adapter