Practical lessons from using the Android Data Binding Library, covering three key areas: preferring built-in bindings over custom adapters (which lack optimization and are harder to test), making custom binding adapters efficient by avoiding unnecessary view updates using the double-parameter technique, and being careful when passing large ViewState objects as single binding variables (which prevents the library from selectively running only changed expressions). The post recommends abstracting string-formatting logic into testable 'text creator' classes and using explicit per-field variables when state changes infrequently.

8m read timeFrom chrisbanes.me
Post cover image
Table of contents
Use the standard bindings when possible #Make your custom binding adapters efficient #Be careful with what you’re providing as variables #So what can you do instead? #Small wins add up #
3 Impressions