Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recyclerview list end overlay color and alpha

How can I change the grey or white overlay that comes on recyclerview when we try to scroll even when we reached the end(top or bottom) of list. I am not able to find the property name to which I can use to do it.

like image 859
Manish Patiyal Avatar asked Dec 13 '25 09:12

Manish Patiyal


1 Answers

The RecyclerView take the shadow from the colorPrimary of your Theme.

You need to create new theme for RecyclerView then apply this Theme to your RecyclerView

In below example themes colorPrimary is colorGreen so it will take green color shadow.

SAMPLE CODE

<android.support.v7.widget.RecyclerView
     android:id="@+id/ha_citiesRC"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginTop="10dp"
     android:requiresFadingEdge="vertical"
     android:theme="@style/CustomTheme"
     android:nestedScrollingEnabled="false" />

theme

 <style name="CustomTheme" parent="Theme.AppCompat.Light.DarkActionBar">

   <item name="colorPrimary">@color/colorGreen</item>
   <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
   <item name="colorAccent">@color/colorAccent</item>

 </style>
like image 85
AskNilesh Avatar answered Dec 16 '25 22:12

AskNilesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!