recycler-fast-scroll
recycler-fast-scroll copied to clipboard
RecyclerView inside SwipeRefreshLayout
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>
I am having the same problem..did you fix it???
I am having the same problem too
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>