-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Add a shortcut to apply multiple transformations on a single request. #2138
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Signed the CLA. |
CLAs look good, thanks! |
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.
I would advise to revert the changes that are automatically made by the IDE (except the ill-indented test annotation fix). Please also check Travis for checkstyle failure and fix that.
Double-check that your formatter is coming from the checked out sources. Some people ignore .idea folder in the global config, it can confuse things really bad.
* @see #optionalTransform(Transformation) | ||
* @see #optionalTransform(Class, Transformation) | ||
*/ | ||
public RequestOptions multiTransform(@NonNull Transformation<Bitmap>... transformations) { |
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.
I think transforms
would be a better name (alphabetically closer to transform). Is there any particular reason why not just use an overload to the existing transform
method and introduce a new name?
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.
Well, it closer resembled the name of the class that actually does the transformation, but I have no strong obligations there, so I will rename it.
.fitCenter() | ||
.autoClone(); | ||
.fitCenter() | ||
.autoClone(); |
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.
Looks like you may have a different formatter that the project. Glide uses 2-space indents and continuation is usually double indent, so 2*2=4, 8 is weird in this code base.
@@ -804,7 +805,7 @@ public RequestOptions centerInside() { | |||
|
|||
/** | |||
* Applies {@link CircleCrop} to all default types, and ignores unknown types. | |||
* | |||
* <p> |
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.
Paragraph is already there in next line, these shouldn't be added.
Thanks for doing this! If it helps Glide uses the google style guide: https://google.github.io/styleguide/javaguide.html I believe you can apply the style guide in intellij/android studio using this: https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml. If I can remember exactly how I did it, I'll update our contributing page on the docs site and link that here. |
Added steps to import the style guide into Android Studio here (it should update shortly): http://bumptech.github.io/glide/dev/contributing.html |
fdb89e2
to
ded9ac6
Compare
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
Reformatted and cleaned. |
ded9ac6
to
7c61baf
Compare
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.
Also double check that the email address in your commit matches the email address you registered the CLA for, it looks like they don't match right now.
@@ -1,9 +1,12 @@ | |||
package com.bumptech.glide.request; | |||
|
|||
import static com.google.common.truth.Truth.assertThat; |
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.
You'll need to revert this import removal.
7c61baf
to
7743db7
Compare
CLAs look good, thanks! |
Sorry, was on vacation, that's why it took a bit longer. |
Great thanks for doing this, I appreciate it! |
Description
As per discussion here:
#2086
Motivation and Context
Makes the possibility to apply multiple transformations easier discoverable via API.
I'd like to have broaden the test context a bit more, but this would have meant to introduce
@VisibleForTesting
getters to internals in a couple of places which I neglected to do for now.