Layout_DSL icon indicating copy to clipboard operation
Layout_DSL copied to clipboard

很有想法~

Open Pluckypan opened this issue 5 years ago • 1 comments

很有想法~ 可以推官方实现静态代码的预览功能~ 这样就可以抛弃 xml 了

private val rootView by lazy {
    ConstraintLayout {
        layout_width = match_parent
        layout_height = match_parent

        ImageView {
            layout_id = "ivBack"
            layout_width = 40
            layout_height = 40
            margin_start = 20
            margin_top = 20
            src = R.drawable.ic_back_black
            start_toStartOf = parent_id
            top_toTopOf = parent_id
            onClick = { onBackClick() }
        }

        TextView {
            layout_width = wrap_content
            layout_height = wrap_content
            text = "commit"
            textSize = 30f
            textStyle = bold
            align_vertical_to = "ivBack"
            center_horizontal = true
        }
    }
}

Pluckypan avatar Jun 12 '20 12:06 Pluckypan

静态代码预览功能是啥?

wisdomtl avatar May 11 '21 03:05 wisdomtl