r/androiddev • u/WrickyB • Feb 03 '20
Discussion Data binding
Just curious, how many of you have used the Architecture Components in production instead of third-party alternatives and vice versa, and why
Edit: Generalized to all components
2
Upvotes
2
u/dark_mode_everything Feb 04 '20
Hmm I usually use databinding but just to get the view handles since I very much dislike Kotlin synthetics. The extra but of work that the annotation processor does is ok for me since one, it's only when I change the xml and two, I run AS on a desktop so I really don't care, nor feel the extra work. As for why I dislike Kotlin synthetics is bcs
it holds a global list of references to all of the view's in your project
it lets you access (intentionally or unintentionally) views from other activities or fragments
your codebase becomes ugly with things like
somefeature_somescreen_somelabel.text = "hello world".you lose the nice syntax highlights you'd normally get for member variables
I would rather do it manually with findviewById than use synthetics.