recycler-fast-scroll icon indicating copy to clipboard operation
recycler-fast-scroll copied to clipboard

RecyclerView inside SwipeRefreshLayout

Open Nik-Sch opened this issue 6 years ago • 3 comments

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>

Nik-Sch avatar Mar 07 '18 17:03 Nik-Sch

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

PembaTamang avatar May 11 '18 05:05 PembaTamang

I am having the same problem too

ThiernoAmirouDiallo avatar May 27 '18 19:05 ThiernoAmirouDiallo

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>

niraj-promact avatar Dec 09 '19 05:12 niraj-promact