Skip to content

4.1.1

Compare
Choose a tag to compare
@sockeqwe sockeqwe released this 21 Jul 21:00
· 41 commits to master since this release

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()
   }
}