大汤匙
Tablespoon(以Dagger和Butterknife命名)可以帮助您使用注释轻松地在自定义视图中绑定属性,以生成样板代码。
class CustomView (...) : View(...) {
@ColorAttr( R .styleable. CustomView_bgColor )
var bgColor : Int = Color . RED
@DimensionAttr( R .styleable. CustomView_radius )
var radius : Float = 0f
var text : String by dynamicAttr( " " ) // Auto updates View when being set
init {
TableSpoon . init ( this , attrs, R .sty
评论0
最新资源