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

Commit f61e7bb4 authored by Andy Wickham's avatar Andy Wickham Committed by Android (Google) Code Review
Browse files

Merge "Only bind fast scrollbar when attached if not already bound." into tm-qpr-dev

parents 778f8c18 87a9bf7c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -57,8 +57,10 @@ public abstract class FastScrollRecyclerView extends RecyclerView {
    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (mScrollbar == null || !mScrollbar.hasRecyclerView()) {
            bindFastScrollbar();
        }
    }

    public void bindFastScrollbar() {
        ViewGroup parent = (ViewGroup) getParent().getParent();
+5 −0
Original line number Diff line number Diff line
@@ -174,6 +174,11 @@ public class RecyclerViewFastScroller extends View {
        ta.recycle();
    }

    /** @return whether there is a RecyclerView bound to this scroller. */
    public boolean hasRecyclerView() {
        return mRv != null;
    }

    public void setRecyclerView(FastScrollRecyclerView rv, TextView popupView) {
        if (mRv != null && mOnScrollListener != null) {
            mRv.removeOnScrollListener(mOnScrollListener);