Open Shunajlov opened 7 years ago
i have same issue , is there any way?
Looks like this repo isn't maintained anymore So I've wrote kotlin extension for this
val RippleBackground.paint: Paint? get() =
try {
val field = RippleBackground::class.java.getDeclaredField("paint")
field.isAccessible = true
field.get(this) as? Paint
} catch (e: Exception) {
null
}
Use it like this ripple.paint?.color = resources.getColor(R.color.very_red)
And don't forget to add proguard rule, just to be safe
-keepclassmembers class com.skyfishjy.library.RippleBackground {
private android.graphics.Paint paint;
}
Yes there is a complex method.... Just copy RippleBackground class and few changes in code to change rb_color attribute from java code..
Is there a way to chande rb_color attribute not from xml?