0

When using CheckBox, some Drawable for this "check" icon is created - AnimatedStateListDrawable. Is there any way to create this drawable programmatically without CheckBox? The only thing I've found inside CompoundButton class is this resource - com.android.internal.R.styleable.CompoundButton_button.

Den
  • 1,136
  • 1
  • 10
  • 31

1 Answers1

0

Found the solution:

val attrs = intArrayOf(android.R.attr.listChoiceIndicatorMultiple)
val ta = getContext().theme.obtainStyledAttributes(attrs)
ta.getDrawable(0)

For RadioButton it's android.R.attr.listChoiceIndicatorSingle.

Den
  • 1,136
  • 1
  • 10
  • 31