Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4aa48517 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Disabling fast scroller when searching apps." into ub-launcher3-burnaby-polish

parents 5c6bdbbc 646c236a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -267,6 +267,13 @@ public abstract class BaseRecyclerView extends RecyclerView
        mScrollbar.setThumbOffset(scrollBarX, scrollBarY);
    }

    /**
     * Returns whether fast scrolling is supported in the current state.
     */
    protected boolean supportsFastScrolling() {
        return true;
    }

    /**
     * Maps the touch (from 0..1) to the adapter position that should be visible.
     * <p>Override in each subclass of this base class.
+2 −1
Original line number Diff line number Diff line
@@ -189,7 +189,8 @@ public class BaseRecyclerViewFastScrollBar {
                // Check if we should start scrolling, but ignore this fastscroll gesture if we have
                // exceeded some fixed movement
                mIgnoreDragGesture |= Math.abs(y - downY) > config.getScaledPagingTouchSlop();
                if (!mIsDragging && !mIgnoreDragGesture && isNearThumb(downX, lastY) &&
                if (!mIsDragging && !mIgnoreDragGesture && mRv.supportsFastScrolling() &&
                        isNearThumb(downX, lastY) &&
                        Math.abs(y - downY) > config.getScaledTouchSlop()) {
                    mRv.getParent().requestDisallowInterceptTouchEvent(true);
                    mIsDragging = true;
+7 −0
Original line number Diff line number Diff line
@@ -431,6 +431,13 @@ public class AllAppsRecyclerView extends BaseRecyclerView
        }
    }

    @Override
    protected boolean supportsFastScrolling() {
        // Only allow fast scrolling when the user is not searching, since the results are not
        // grouped in a meaningful order
        return !mApps.hasFilter();
    }

    /**
     * Returns the scrollY for the given position in the adapter.
     */