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

Support binding array resources (String, int, text and TypedArray). #301

Merged
merged 1 commit into from
Jul 7, 2015
Merged

Conversation

tomxor
Copy link
Contributor

@tomxor tomxor commented Jul 7, 2015

This replaces @BindStringArray with @BindArray in order to support multiple array types. The type of annotated element will dictate which method of the Resources class to invoke in order to fetch the array.

@tomxor
Copy link
Contributor Author

tomxor commented Jul 7, 2015

Fixes #300

String methodName = getArrayResourceMethodName(element);
if (methodName == null) {
error(element,
"@%s field type must be one of: " + "'String[], int[], CharSequence[], %s'. (%s.%s)",
Copy link
Owner

Choose a reason for hiding this comment

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

needless + between string contstants

@JakeWharton
Copy link
Owner

Looks great. A couple small nits.

@tomxor
Copy link
Contributor Author

tomxor commented Jul 7, 2015

👍 thanks!

JakeWharton added a commit that referenced this pull request Jul 7, 2015
Support binding array resources (String, int, text and TypedArray).
@JakeWharton JakeWharton merged commit d6a9a66 into JakeWharton:master Jul 7, 2015
@tomxor tomxor deleted the bind-arrays branch July 7, 2015 23:22
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.

2 participants