3

I need to show vertical fast scrollbar in recyclerview permanently visible on screen.

It appears faded up when I open the screen and when I scroll recycler view the scroll bar appears but again fades within seconds. How can I achieve the same.

I have already tried these properties:

android:fadeScrollbars="false" 
ScrollView.setScrollbarFadingEnabled(false);
android:scrollbarFadeDuration="0"
android:scrollbarAlwaysDrawVerticalTrack="true" 
android:scrollbarAlwaysDrawHorizontalTrack="true"

My Recycler view looks like this:

<androidx.recyclerview.widget.RecyclerView
            android:id="@+id/list"
            app:fastScrollEnabled="true"
            android:scrollbarAlwaysDrawVerticalTrack="true"
            android:layout_marginRight="@dimen/_15sdp"

 app:fastScrollHorizontalThumbDrawable="@drawable/thumb_drawable"

 app:fastScrollHorizontalTrackDrawable="@drawable/line_drawable"

 app:fastScrollVerticalThumbDrawable="@drawable/thumb_drawable"

 app:fastScrollVerticalTrackDrawable="@drawable/line_drawable"

 android:name="com.fca.ecocoaching.home.PreviousTripFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layoutManager="LinearLayoutManager"
            tools:context=".ui.previoustrip.PreviousTripFragment"
            tools:listitem="@layout/fragment_trip"/>
Swati Singh
  • 390
  • 2
  • 11
  • Possible duplicate of [How to always show scrollbar](https://stackoverflow.com/questions/5702502/how-to-always-show-scrollbar) – MadLeo May 25 '19 at 10:35
  • 1
    Mine is fastscrollbar of recyclerview. I have tried all the answers mentioned in the above link but none is working. Its not a normal scrollbar, its a fast scrollbar. I am not able to stop its fading. – Swati Singh May 26 '19 at 11:17

1 Answers1

0

you can use android:fadeScrollbars="false" in xml or ScrollView.setScrollbarFadingEnabled(false); in java code.

MANOJ G
  • 632
  • 7
  • 7