-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Support R2 class for resource values #2022
Conversation
|
Hey Csaba, thank you for the PR. I got 2 questions.
|
|
Hey, I tried to explain it in the commit message, but maybe it was not clear, sorry.
|
|
Thank you for explaining it again. I did not look at the commit message, so i missed the explaination there.
Okay, ignore that... reading your explaination a second time revels Maybe it is enough to put this behind the library option? |
|
@dodgex i think we should put this behind a new flag. |
c4bc8ed to
75dcb3d
Compare
|
@dodgex updated. |
The R class contains non-constant fields in case of library projects, so we cannot use them in annotation values, nor for validaiton, since the values are not available at compile time. To work around this, there is a Gradle plugin to generate an R2 class, which contains constants fields. This commit adds a very simple integration to this plugin, by using the R2 class instead of R if the former is available.
|
looks fine. |
The final resource values will not be the same as the compile-time values, so we have to use the R class in the generated code, even if the user set to use the R2 class in annotation parameters. Follow-up fix for: androidannotations#2022
The final resource values will not be the same as the compile-time values, so we have to use the R class in the generated code, even if the user set to use the R2 class in annotation parameters. Follow-up fix for: androidannotations#2022
|
looks good |
|
I merged the doc. |
|
This just saved me a lot of time. And will be very useful for instant apps. |
This PR adds support to ButterKnife R2 generator plugin. Please note only the SNAPSHOT version of that plugin generates all types of resources. For rationale, see the commit message.