lawloretienne / QuickReturn

Showcases QuickReturn UI Pattern as either a header, footer, or both header and footer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

does not work with RecyclerView padding

fahimk opened this issue · comments

commented

android:paddingTop="15dp"
android:paddingBottom="15dp"
android:clipToPadding="false"

causes the quick return view to constantly stutter when scrolling

commented

So I managed to figure out a workaround for this. What I have is a custom class that extends RecyclerView. In there I have this function

public int getVerticalOffset() {
    return super.computeVerticalScrollOffset();
}

Then in QuickReturnUtils.java I modify the getScrollY for RecyclerView:

public static int getScrollY(RecyclerView rv, int columnCount) {
    return ((ViewAutofitRecyclerView) rv).getVerticalOffset();
}

According to the documentation computeVerticalOffset() gives "The vertical offset of the scrollbar's thumb".