= R.id.txtTitle textAppearance = R.style.TextAppearance_AppCompat_Large textColor = R.color.titleText } applyConstraintSet { title { connect( TOP to TOP of PARENT_ID margin dip(16), START to START of PARENT_ID margin dip(16) ) } } }
inline fun <T> T.also(block: (T) -> Unit): T { block(this) return this } // slightly simplified public inline fun <T> T.apply(block: T.() -> Unit): T { block() return this }
= R.id.txtTitle textAppearance = R.style.TextAppearance_AppCompat_Large textColor = R.color.titleText } applyConstraintSet { title { connect( TOP to TOP of PARENT_ID margin dip(16), START to START of PARENT_ID margin dip(16) ) } } }