-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding InjectResource to the annotation processor #140
Conversation
To support resource injection
Formatting is messed up for pretty much every single change. What's the point of the two extra inject methods? |
two extra inject methods? I believe that you are asking from ButterKnife class, just to give an additional option to ignore resource context parameter if no resource injection is required. |
Yes, the inject methods in the ButterKnife class. The context parameter is pointless, both View and Dialog has getters for this. Also, I don't think you should keep the Context in a field either. Add a method to the enums, like findOptionalView. |
Oh great I missed it, will clean up the code with those changes. |
context parameter is removed from ButterKnife class and enum abstract method is added to get the context from activity / view / Dialog. Code is formatted as per checkstyle. |
public static final String VIEW_TYPE = "android.view.View"; | ||
public static final String STRING_TYPE = "java.lang.String"; | ||
public static final String DRAWABLE_TYPE = "android.graphics.drawable.Drawable"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kill empty line
kill empty line done dropped clean up on non-View resources
InjectResource cannot have @optional annotation check.
Removed findOptionalResource as it was not making any sense, And also writing separate annotations for each resource type sounds good to me too, will see what I can do. |
Added separate annotation @InjectColor, @InjectDrawable, @InjectString and removed general approach. |
Why was this closed? |
See #244 |
Added Resource Binding module that supports the following data types String, Drawable & Animation.