Android – RecyclerView clipToPadding = false


The android material design documentation suggests adding an 8 dp padding at the top and bottom of a list, and I personally like the idea and want to implement it. I am using the new RecyclerView widget to accomplish the look of a simple list. The problem that I'm having is when I set the attributes: paddingTop and paddingBottom of my RecyclerView, the overscroll shadow which appears at the top and bottom of the list now has a padding too (and kind of looks bad and like an error). I've been reading that setting these attributes:

clipToPadding = false
scrollbarStyle = outsideOverlay

should do the trick for me, but it simply doesn't. The overscroll effect still begins with an 8 dp padding at the top and bottom of the screen and it really bugs me out. Am I doing something wrong here, or there is another solution for my problem? Any advice appreciated. Thx

Best Solution

Adding clipToPadding as false works on latest releases


I'm using recylerview version

  compile ''