Simple Constructors for Inheritance

You can use @JvmOveloads annotation and common init {} block

class VideoView @JvmOverloads constructor(
        context: Context, 
        attrs: AttributeSet? = null, 
        defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr) {
    
    init { ... }

}
7 Likes