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

Add a shortcut to apply multiple transformations on a single request. #2138

Merged
merged 1 commit into from
Aug 4, 2017

Conversation

realdadfish
Copy link
Contributor

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.

@googlebot
Copy link

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. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@realdadfish
Copy link
Contributor Author

Signed the CLA.

@googlebot
Copy link

CLAs look good, thanks!

Copy link
Collaborator

@TWiStErRob TWiStErRob left a 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) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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();
Copy link
Collaborator

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>
Copy link
Collaborator

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.

@sjudd
Copy link
Collaborator

sjudd commented Jul 14, 2017

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.

@sjudd
Copy link
Collaborator

sjudd commented Jul 14, 2017

Added steps to import the style guide into Android Studio here (it should update shortly): http://bumptech.github.io/glide/dev/contributing.html

@realdadfish realdadfish force-pushed the multi-transform-shortcut branch from fdb89e2 to ded9ac6 Compare July 17, 2017 11:21
@googlebot
Copy link

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.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@realdadfish
Copy link
Contributor Author

Reformatted and cleaned.

@realdadfish realdadfish force-pushed the multi-transform-shortcut branch from ded9ac6 to 7c61baf Compare July 19, 2017 22:51
Copy link
Collaborator

@sjudd sjudd left a 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;
Copy link
Collaborator

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.

@realdadfish realdadfish force-pushed the multi-transform-shortcut branch from 7c61baf to 7743db7 Compare August 3, 2017 16:31
@googlebot
Copy link

CLAs look good, thanks!

@realdadfish
Copy link
Contributor Author

Sorry, was on vacation, that's why it took a bit longer.

@sjudd
Copy link
Collaborator

sjudd commented Aug 4, 2017

Great thanks for doing this, I appreciate it!

@sjudd sjudd merged commit 00886e7 into bumptech:master Aug 4, 2017
@realdadfish realdadfish deleted the multi-transform-shortcut branch August 8, 2017 12:04
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