Skip to content
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

Closed
wants to merge 12 commits into from
Closed

Adding InjectResource to the annotation processor #140

wants to merge 12 commits into from

Conversation

VigneshPeriasami
Copy link

Added Resource Binding module that supports the following data types String, Drawable & Animation.

To support resource injection
@SimonVT
Copy link
Contributor

SimonVT commented May 18, 2014

Formatting is messed up for pretty much every single change.

What's the point of the two extra inject methods?

@VigneshPeriasami
Copy link
Author

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.

@SimonVT
Copy link
Contributor

SimonVT commented May 18, 2014

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.

@VigneshPeriasami
Copy link
Author

Oh great I missed it, will clean up the code with those changes.

@VigneshPeriasami
Copy link
Author

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";

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kill empty line

vikki added 2 commits May 19, 2014 13:10
kill empty line done
dropped clean up on non-View resources
InjectResource cannot have @optional annotation check.
@VigneshPeriasami
Copy link
Author

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.

@VigneshPeriasami
Copy link
Author

Added separate annotation @InjectColor, @InjectDrawable, @InjectString and removed general approach.
Find one resource per ID is pending.

@jdreesen
Copy link

jdreesen commented Jun 7, 2014

Why was this closed?

@JakeWharton
Copy link
Owner

See #244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants