mercredi 12 février 2020

Custom CheckBox with default style

I need to create a custom CheckBox with default material style.

My class is defined like so

class CustomCheckBox @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : CheckBox(context, attrs, defStyleAttr) {

}

If I look at the default CheckBox's properties they have the following attributes defined

background: @android:drawable/control_background_40pd_material
button: @android:drawable/btn_check_material_anim

but the derived widget does not have them.

How can I apply these to the derived class?




Aucun commentaire:

Enregistrer un commentaire