Instantly share code, notes, and snippets.

Embed
What would you like to do?
@ModelView(defaultLayout = R2.layout.default_component_layout)
@Styleable("Component")
class Component @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) :
ConstraintLayout(context, attrs, defStyleAttr) {
init {
inflate(R.layout.component_inner_layout)
Paris.style(this).apply(attrs)
}
@Attr(R2.styleable.Component_title)
@TextProp
fun setTitle(text: CharSequence) {
title.text = text // kotlinx.android.syntethic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment