pascalchidi06/09/2020, 7:47 PM
Olenyov Kirill06/09/2020, 8:37 PM
zhuinden06/09/2020, 8:38 PM
pascalchidi06/09/2020, 9:23 PM
Mark Murphy06/09/2020, 9:28 PM
its just an alternative of having a collection of all widget in one placeIf by "alternative" you mean "alternative to Kotlin synthetic accessors", I'm in agreement with Gabor: use view binding. Quoting myself from a book:
The larger the project, though, the greater the risk is that you will use the wrong imports. Once you start getting dozens or hundreds of layout resources, making sure that you use the right imports starts to become a challenge. The compiler will be very happy to let you use any import you want. However, if you try referencing a widget from Layout X and you are really using Layout Y, it is likely that you will wind up crashing with asomewhere along the line.
For a minor amount of setup overhead (a few lines in a Gradle script and a couple of lines per activity, fragment, etc.), you get the code-generated guarantee that you are referencing widgets that exist.
pascalchidi06/09/2020, 9:38 PM
Anastasia Finogenova06/10/2020, 2:15 AM