Tablespoon:使用注解在您的自定义视图中轻松绑定属性 源码
大汤匙 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
下载地址
用户评论