There are a couple ways this can be done, however this is what I've been doing in my app.
class TextView : ViewAbstractClass {
constructor(context: Context) : super(context)
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr) {
// custom init code for this constructor.
}
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
init {
// Common init code
}
}
Notice that you don't actually use () in the class signature, but instead provide all the constructors explicitly.
You can learn more about secondary constructors here:
https://kotlinlang.org/docs/reference/classes.html