I have an SpannableString
text with links on com.google.android.material.checkbox.MaterialCheckBox
view.
I need to disable actual checkbox toggling while user clicks on link in CheckBox text.
I achieved that by caling view.cancelPendingInputEvents()
in ClickableSpan's onClick
.
However, the ripple effect on the checkbox is still present. I was able to disable it by calling this, also in ClickableSpan's onClick
:
var drawable = textView.background
if (drawable is RippleDrawable) {
drawable = drawable.findDrawableByLayerId(0)
textView.background = drawable
}
The problem is, how I should revert this? How to revert default MaterialCheckBox ripple effect after click is done?