One rapid question here. I’m trying to do syntheti...
# android
j
One rapid question here. I’m trying to do synthetic import for a layout included in a different gradle module (a dependency of the app module)
d
Personally I'd avoid synthetic imports all together. As far as I remember that anko has
findViewById<T>(int)
which returns either that element or null, if it's not available. Then again, that's coming from Kotlin 1.0.5EAP
j
Why would you use that when you can use the reference directly?
r
findViewById return correct type for new build tools afaik
d
Why wouldn't you? It saves you the headache when diagnosing
InvalidCastException
issues.
j
For the same reasons why you pick butterknife. You want to get rid of the view fetching boilerplate to avoid writing it all the time.
Using anko for that has no big difference with using the standard Android findViewById