Skip to content
New issue

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

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

Already on GitHub? # to your account

RecyclerView inside SwipeRefreshLayout #73

Open
Nik-Sch opened this issue Mar 7, 2018 · 3 comments
Open

RecyclerView inside SwipeRefreshLayout #73

Nik-Sch opened this issue Mar 7, 2018 · 3 comments

Comments

@Nik-Sch
Copy link

Nik-Sch commented Mar 7, 2018

I don't really know if this is the same problem as #28 or just related.
However, when having the RecyclerView inside a SwipeRefreshLayout the FastScroller it doesn't work as intended. Its scrollbar jumps when the RecyclerView is moved normally and cannot be dragged.

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

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <android.support.v7.widget.RecyclerView
                xmlns:app="http://schemas.android.com/apk/res-auto"
                xmlns:tools="http://schemas.android.com/tools"
                android:id="@+id/list"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layoutManager="LinearLayoutManager">

            <com.futuremind.recyclerviewfastscroll.FastScroller
                android:id="@+id/fastscroll"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_alignParentEnd="true"
                android:orientation="vertical" />
        </RelativeLayout>
    </android.support.v4.widget.SwipeRefreshLayout>
@PembaTamang
Copy link

I am having the same problem..did you fix it???

@ThiernoAmirouDiallo
Copy link

I am having the same problem too

@niraj-promact
Copy link

I was facing the same issue. It is not necessary to add FastScroller in the same parent as RecyclerView.
I had managed to do it using this code and it works perfectly.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
        android:id="@+id/swipeRefreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rvItems"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:listitem="@layout/list_item_dummy" />
    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

    <com.futuremind.recyclerviewfastscroll.FastScroller
        android:id="@+id/fastScroller"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="end"
        android:orientation="vertical" />

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/tvHeaderStrip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:gravity="end"
        android:padding="5dp"
        android:textColor="@android:color/black" />
</FrameLayout>

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

No branches or pull requests

4 participants