I can't seem to get the pressed state ripple to work on a Spinner. The individual drop down items have the ripple, but not the spinner itself. I thought maybe this was expected behavior, but this animation from the material design guidelines clearly shows the spinner with a pressed state ripple before the options drop dropdown appears.
https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B3321sZLoP_HTS1LdnhrTl9TRzg/components-buttons-otherbuttons-060203_MobileDropdowns_xhdpi_006.webm
I created a new Spinner
in an Activity
and as you described, the RippleDrawable
is not applied to the Spinner
using the v7 compatibility library or on Android 5.0+. This isn't surprising to me; Google often fails to implement its own design.
To have the affect, all I did was create a RippleDrawable
in res/values-v21/ and set that to be the background on the Spinner
using spinner.setBackgroundResource(R.drawable.spinner_background);
. I'm sure you can also set this in your theme.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With