4.1.1
Added some shortcuts / convenience functions (and properties) for kotlin DSL. Instead of calling itemView.context
you now have direct access to the following fields and functions:
- context (backed property)
- getString(@StringRes resId: Int): String
- getString(@StringRes resId: Int, vararg formatArgs: Any)
- getColor(@ColorRes id: Int)
- getDrawable(@DrawableRes id: Int)
- getColorStateList(@ColorRes id: Int)
Overall this minor release just reduces a bit more typing for you as you now can do something like this:
fun catDelegate() = adatperDelegate<Cat, Animal>(R.layout.cat) {
...
bind {
icon.drawable = getDrawable(R.drawable.cat) // instead of itemView.context.getDrawable()
}
}