0

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?

Baterka
  • 3,075
  • 5
  • 31
  • 60
  • Does this answer your question? [ListView item with checkbox - how to remove checkbox ripple effect?](https://stackoverflow.com/questions/35625620/listview-item-with-checkbox-how-to-remove-checkbox-ripple-effect) – Kishan Mevada Nov 15 '22 at 14:26

0 Answers0