9

I have implement RecyclerView fast scroll using following properties:

<android.support.v7.widget.RecyclerView
...
 app:fastScrollEnabled="true"
 app:fastScrollHorizontalThumbDrawable="@drawable/fast_scroll_thumb"
 app:fastScrollHorizontalTrackDrawable="@drawable/fast_scroll_track"
 app:fastScrollVerticalThumbDrawable="@drawable/fast_scroll_thumb"
 app:fastScrollVerticalTrackDrawable="@drawable/fast_scroll_track"/>

fast_scroll_thumb.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <shape android:shape="rectangle">
            <solid android:color="@color/lightBlue" />
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/lightBlue" />
        </shape>
    </item>
</selector>

fast_scroll_track.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/gray" />
</shape>

But, Fast scroll thumb size dependent on number of data. As a RecyclerView data increase thumb size decreased. Is there any way to fix thumb size at fixed height?

Mohamed Mohaideen AH
  • 2,527
  • 1
  • 16
  • 24
kinjal patel
  • 585
  • 2
  • 4
  • 12
  • I did some digging on this for a different question: https://stackoverflow.com/a/48157813/8298909 ... it seems like there isn't a good answer – Ben P. Oct 01 '18 at 20:47

0 Answers0