I would like to add a Material design ripple effect to the View
s shown by a ViewPager
. My team has been able to do that in other parts of our app by setting ?attr/selectableItemBackground
as the background of a View
. However, when I assign that as the background of the View
returned by my ViewPager
's adapter, the effect doesn't seem to work. Has anyone gotten that to work?
From experience, it seems that ViewPager
s consume events that prevent certain interactions with their children. For example, ViewPager
items don't get onClick()
events and you have to work around that in other ways. I wonder if there isn't a similar issue here, where the ViewPager
is consuming events that are needed for the ripple to work.