Created
November 16, 2018 09:00
-
-
Save benigumocom/ea5dd92cef66f6d30def910dfe02f174 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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