Loading res/layout/all_apps.xml +4 −0 Original line number Diff line number Diff line Loading @@ -48,12 +48,16 @@ android:id="@+id/divider" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/all_apps_tabs_side_padding" android:layout_marginRight="@dimen/all_apps_tabs_side_padding" android:layout_alignBottom="@+id/tabs" /> <com.android.launcher3.views.SlidingTabStrip android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/all_apps_header_tab_height" android:layout_marginLeft="@dimen/all_apps_tabs_side_padding" android:layout_marginRight="@dimen/all_apps_tabs_side_padding" android:layout_below="@id/header_content" android:orientation="horizontal" > <Button Loading res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ <dimen name="all_apps_prediction_row_divider_height">17dp</dimen> <dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen> <dimen name="all_apps_work_profile_tab_footer_bottom_padding">20dp</dimen> <dimen name="all_apps_tabs_side_padding">12dp</dimen> <!-- Search bar in All Apps --> <dimen name="all_apps_header_max_elevation">3dp</dimen> Loading src/com/android/launcher3/BaseRecyclerView.java +4 −4 Original line number Diff line number Diff line Loading @@ -17,13 +17,11 @@ package com.android.launcher3; import android.content.Context; import android.graphics.Canvas; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.android.launcher3.views.RecyclerViewFastScroller; Loading Loading @@ -91,8 +89,10 @@ public abstract class BaseRecyclerView extends RecyclerView */ private boolean handleTouchEvent(MotionEvent ev) { // Move to mScrollbar's coordinate system. int left = getLeft() - mScrollbar.getLeft(); int top = getTop() - mScrollbar.getTop(); // We need to take parent into account (view pager's location) ViewGroup parent = (ViewGroup) getParent(); int left = parent.getLeft() + getLeft() - mScrollbar.getLeft(); int top = parent.getTop() + getTop() - mScrollbar.getTop() - getScrollBarTop(); ev.offsetLocation(left, top); try { return mScrollbar.handleTouchEvent(ev); Loading src/com/android/launcher3/allapps/AllAppsContainerView.java +0 −3 Original line number Diff line number Diff line Loading @@ -261,9 +261,6 @@ public class AllAppsContainerView extends RelativeLayout implements DragSource, if (mLauncher.getDragLayer().isEventOverView(mSearchContainer, ev)) { return true; } if (mUsingTabs && mLauncher.getDragLayer().isEventOverView(mHeader, ev)) { return true; } AllAppsRecyclerView rv = getActiveRecyclerView(); return rv == null || rv.shouldContainerScroll(ev, mLauncher.getDragLayer()); } Loading src/com/android/launcher3/allapps/FloatingHeaderView.java +41 −1 Original line number Diff line number Diff line Loading @@ -19,11 +19,13 @@ package com.android.launcher3.allapps; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Resources; import android.graphics.Point; import android.graphics.Rect; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; Loading @@ -37,6 +39,7 @@ public class FloatingHeaderView extends RelativeLayout implements private final Rect mClip = new Rect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE); private final ValueAnimator mAnimator = ValueAnimator.ofInt(0, 0); private final Point mTempOffset = new Point(); private final RecyclerView.OnScrollListener mOnScrollListener = new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { Loading Loading @@ -76,6 +79,7 @@ public class FloatingHeaderView extends RelativeLayout implements private View mDivider; private AllAppsRecyclerView mMainRV; private AllAppsRecyclerView mWorkRV; private ViewGroup mParent; private boolean mTopOnlyMode; private boolean mHeaderHidden; private int mMaxTranslation; Loading @@ -83,7 +87,8 @@ public class FloatingHeaderView extends RelativeLayout implements private int mTranslationY; private int mMainScrolledY; private int mWorkScrolledY; private boolean mMainRVActive; private boolean mMainRVActive = true; private boolean mForwardToRecyclerView; public FloatingHeaderView(@NonNull Context context) { this(context, null); Loading @@ -109,6 +114,7 @@ public class FloatingHeaderView extends RelativeLayout implements mMaxTranslation = predictionRowHeight; mMainRV = setupRV(mMainRV, personalRV); mWorkRV = setupRV(mWorkRV, workRV); mParent = (ViewGroup) getRV().getParent(); setMainActive(true); setupDivider(); } Loading Loading @@ -228,6 +234,40 @@ public class FloatingHeaderView extends RelativeLayout implements apply(); } private AllAppsRecyclerView getRV() { return mMainRVActive ? mMainRV : mWorkRV; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { calcOffset(mTempOffset); ev.offsetLocation(mTempOffset.x, mTempOffset.y); mForwardToRecyclerView = getRV().onInterceptTouchEvent(ev); ev.offsetLocation(-mTempOffset.x, -mTempOffset.y); return mForwardToRecyclerView || super.onInterceptTouchEvent(ev); } @Override public boolean onTouchEvent(MotionEvent event) { if (mForwardToRecyclerView) { // take this view's and parent view's (view pager) location into account calcOffset(mTempOffset); event.offsetLocation(mTempOffset.x, mTempOffset.y); try { return getRV().onTouchEvent(event); } finally { event.offsetLocation(-mTempOffset.x, -mTempOffset.y); } } else { return super.onTouchEvent(event); } } private void calcOffset(Point p) { p.x = getLeft() - getRV().getLeft() - mParent.getLeft(); p.y = getTop() - getRV().getTop() - mParent.getTop(); } } Loading
res/layout/all_apps.xml +4 −0 Original line number Diff line number Diff line Loading @@ -48,12 +48,16 @@ android:id="@+id/divider" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/all_apps_tabs_side_padding" android:layout_marginRight="@dimen/all_apps_tabs_side_padding" android:layout_alignBottom="@+id/tabs" /> <com.android.launcher3.views.SlidingTabStrip android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/all_apps_header_tab_height" android:layout_marginLeft="@dimen/all_apps_tabs_side_padding" android:layout_marginRight="@dimen/all_apps_tabs_side_padding" android:layout_below="@id/header_content" android:orientation="horizontal" > <Button Loading
res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ <dimen name="all_apps_prediction_row_divider_height">17dp</dimen> <dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen> <dimen name="all_apps_work_profile_tab_footer_bottom_padding">20dp</dimen> <dimen name="all_apps_tabs_side_padding">12dp</dimen> <!-- Search bar in All Apps --> <dimen name="all_apps_header_max_elevation">3dp</dimen> Loading
src/com/android/launcher3/BaseRecyclerView.java +4 −4 Original line number Diff line number Diff line Loading @@ -17,13 +17,11 @@ package com.android.launcher3; import android.content.Context; import android.graphics.Canvas; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.android.launcher3.views.RecyclerViewFastScroller; Loading Loading @@ -91,8 +89,10 @@ public abstract class BaseRecyclerView extends RecyclerView */ private boolean handleTouchEvent(MotionEvent ev) { // Move to mScrollbar's coordinate system. int left = getLeft() - mScrollbar.getLeft(); int top = getTop() - mScrollbar.getTop(); // We need to take parent into account (view pager's location) ViewGroup parent = (ViewGroup) getParent(); int left = parent.getLeft() + getLeft() - mScrollbar.getLeft(); int top = parent.getTop() + getTop() - mScrollbar.getTop() - getScrollBarTop(); ev.offsetLocation(left, top); try { return mScrollbar.handleTouchEvent(ev); Loading
src/com/android/launcher3/allapps/AllAppsContainerView.java +0 −3 Original line number Diff line number Diff line Loading @@ -261,9 +261,6 @@ public class AllAppsContainerView extends RelativeLayout implements DragSource, if (mLauncher.getDragLayer().isEventOverView(mSearchContainer, ev)) { return true; } if (mUsingTabs && mLauncher.getDragLayer().isEventOverView(mHeader, ev)) { return true; } AllAppsRecyclerView rv = getActiveRecyclerView(); return rv == null || rv.shouldContainerScroll(ev, mLauncher.getDragLayer()); } Loading
src/com/android/launcher3/allapps/FloatingHeaderView.java +41 −1 Original line number Diff line number Diff line Loading @@ -19,11 +19,13 @@ package com.android.launcher3.allapps; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Resources; import android.graphics.Point; import android.graphics.Rect; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; Loading @@ -37,6 +39,7 @@ public class FloatingHeaderView extends RelativeLayout implements private final Rect mClip = new Rect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE); private final ValueAnimator mAnimator = ValueAnimator.ofInt(0, 0); private final Point mTempOffset = new Point(); private final RecyclerView.OnScrollListener mOnScrollListener = new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { Loading Loading @@ -76,6 +79,7 @@ public class FloatingHeaderView extends RelativeLayout implements private View mDivider; private AllAppsRecyclerView mMainRV; private AllAppsRecyclerView mWorkRV; private ViewGroup mParent; private boolean mTopOnlyMode; private boolean mHeaderHidden; private int mMaxTranslation; Loading @@ -83,7 +87,8 @@ public class FloatingHeaderView extends RelativeLayout implements private int mTranslationY; private int mMainScrolledY; private int mWorkScrolledY; private boolean mMainRVActive; private boolean mMainRVActive = true; private boolean mForwardToRecyclerView; public FloatingHeaderView(@NonNull Context context) { this(context, null); Loading @@ -109,6 +114,7 @@ public class FloatingHeaderView extends RelativeLayout implements mMaxTranslation = predictionRowHeight; mMainRV = setupRV(mMainRV, personalRV); mWorkRV = setupRV(mWorkRV, workRV); mParent = (ViewGroup) getRV().getParent(); setMainActive(true); setupDivider(); } Loading Loading @@ -228,6 +234,40 @@ public class FloatingHeaderView extends RelativeLayout implements apply(); } private AllAppsRecyclerView getRV() { return mMainRVActive ? mMainRV : mWorkRV; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { calcOffset(mTempOffset); ev.offsetLocation(mTempOffset.x, mTempOffset.y); mForwardToRecyclerView = getRV().onInterceptTouchEvent(ev); ev.offsetLocation(-mTempOffset.x, -mTempOffset.y); return mForwardToRecyclerView || super.onInterceptTouchEvent(ev); } @Override public boolean onTouchEvent(MotionEvent event) { if (mForwardToRecyclerView) { // take this view's and parent view's (view pager) location into account calcOffset(mTempOffset); event.offsetLocation(mTempOffset.x, mTempOffset.y); try { return getRV().onTouchEvent(event); } finally { event.offsetLocation(-mTempOffset.x, -mTempOffset.y); } } else { return super.onTouchEvent(event); } } private void calcOffset(Point p) { p.x = getLeft() - getRV().getLeft() - mParent.getLeft(); p.y = getTop() - getRV().getTop() - mParent.getTop(); } }