When I create a custom FrameLayout
I need to implement those 3 constructors but as you see all of them just call super(...)
and init()
.
class VideoView : FrameLayout {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
init()
}
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int)
: super(context, attrs, defStyleAttr) {
init()
}
fun init(){ ... }
}
Is there any way to make it cooler?
Maybe an annotation like all constructors call init()
and it will generate all the constructors calling init
?