dimsuz
11/08/2016, 9:38 AMclass DontPressWithParentRadioButton : AppCompatRadioButton {
constructor(context: Context) : this(context, null)
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
}
override fun setPressed(pressed: Boolean) {
if (pressed && parent is View && (parent as View).isPressed) {
return
}
super.setPressed(pressed)
}
}
and when I use it in my xml file it doesn't draw radiobutton drawable for some reason - only text. I didn't have a chance to dig into it yet.