pascalchidi
06/09/2020, 7:47 PMOlenyov Kirill
06/09/2020, 8:37 PMzhuinden
06/09/2020, 8:38 PMpascalchidi
06/09/2020, 9:23 PMMark Murphy
06/09/2020, 9:28 PMits 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.NullPointerException
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.
pascalchidi
06/09/2020, 9:38 PMAnastasia Finogenova
06/10/2020, 2:15 AM