As in title. Is it reasonable to switch to ViewBinding? Personally I never had any problem with Kotlin Android Extensions (and I use them in large projects), but some people pointed out that:
- they imported incorrect layout extensions (never occured to me)
- ViewBinding is type safe (just like Kotlin Android Extensions)
- ViewBinding is null safe (just like Kotlin Android Extensions, just write
?.
after view id)
My personal cons of ViewBinding:
- needs rebuilding project to access newly added views (ugh)
- access through binding reference (ugh)
- overkill (generates additional class and requires to integrate view’s code with it instead of making it an independent component)
What are your thoughts?
EDIT:
Related StackOverflow Question