TIL: Data binding

Learning, discovering, and implementing data binding in PhotoPress today.

It’s new, refreshing, slightly intriguing*, and almost delightful.

*Like everything Android, it has some less-documented bits. Two examples:

  1. The binding adapter methods have to be @JvmStatic, just plain old Kotlin companion object static won’t do.
  2. The methods and variables used have to be Public. Private won’t work (obviously), while internal may work, but will show up as viewmodel.publishThat$debug() instead of just viewmodel.publishThat().