Paul Dhaliwal
09/24/2019, 6:54 PMcompanion object {
@BindingAdapter(“app:bgColor”)
@JvmStatic
fun setColor(view: ElevatedFrameLayoutWithBinding, color: String) {
view.backgroundPaint.color = Color.parseColor(color)
}
}
Edit: After further investigation when using the above code onDraw() for the custom view isn’t called, however if I add the attribute normally without Data Binding and the BindingAdapter onDraw() is called as normal.