How to change rippleColor progamatically
burhankhanzada opened this issue · 4 comments
burhankhanzada commented
I have frame layout which i using as card view i want to know how to change ripple color to primary color programmatically
ZieIony commented
ripple = RippleDrawable.create(ColorStateList.valueOf(color), [other params])
frameLayout.setRippleDrawable(ripple);
burhankhanzada commented
what arguments should i provide to view and radius for over ripple effect
ZieIony commented
View
should always be the owner of this ripple - frameLayout
in your case. Radius can be -1
to be computed automatically from its bounds. To get 'over' ripple you need to pass RippleDrawable.Style.Over
as style. So:
ripple = RippleDrawable.create(ColorStateList.valueOf(color), RippleDrawable.Style.Over, frameLayout, true, -1)
frameLayout.setRippleDrawable(ripple);
burhankhanzada commented
thanks its working