Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to wrap FastScrollRecyclerView in a SwipeRefreshLayout #30

Closed
ShawnTheBeachy opened this issue May 10, 2018 · 3 comments
Closed

Comments

@ShawnTheBeachy
Copy link

In FastScroller.java, where it's checking the parent layout, SwipeRefreshLayout ought to be allowed so we can do pull to refresh.

@ShawnTheBeachy
Copy link
Author

Actually, I guess there's no reason to not just put a FrameLayout inside the SwipeRefreshLayout, then put the recyclerview inside that.

@randr0id
Copy link
Member

Also, SwipeRefreshLayout only supports one direct child and FastScrollRecyclerView requires support for sibling views (FastScroller and RecyclerView).

@ShawnTheBeachy
Copy link
Author

ShawnTheBeachy commented May 11, 2018

@randr0id Good point! Additionally, putting the FastScrollRecyclerView inside a SwipeRefreshLayout makes it that you are unable to drag the handle; it just tries to refresh. In case anyone happens across this wanting to do the same thing, here's what I ended up doing:

<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/swipeLayout"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_height="match_parent"
        android:layout_width="match_parent" />

</android.support.v4.widget.SwipeRefreshLayout>

<com.l4digital.fastscroll.FastScroller
    android:id="@+id/fastScroller"
    android:layout_gravity="end"
    android:layout_height="match_parent"
    android:layout_marginBottom="16dp"
    android:layout_marginTop="16dp"
    android:layout_width="wrap_content" />

I then wired up the scroller manually as detailed in #4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants