Introduction
By setting ClipToPadding = false , The view draws beyond its bounds into the padding area, overwrite this drawing with the parent’s padding.
By default Android sets this property to true
for any ViewGroup, which means they will be clipped to adjust to the padding of the ViewGroup.
Below images depicts better than any documentation.
In case of RecyclerView:
*image credits pulpfiction.
In case of Fab button:
clipToPadding = false The shadow is drawn evenly, even if it exceeds the view bounds.
Whereas clipToPadding = true The shadow is clipped when it crosses the view bounds.
*image credits Samuel Peter.
Overall setting this property to false
, in most cases leads to better UX.