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 API to re-use request builders #186

Merged
merged 4 commits into from
Oct 14, 2014
Merged

Conversation

sjudd
Copy link
Collaborator

@sjudd sjudd commented Oct 12, 2014

Fixes #182, and is substantial progress toward #185.

The basic idea is that after these changes you can now call load() on requests builders at any point:

requestBuilder = Glide.with(fragment)
    .from(String.class)
    // apply options here
    ;

requestBuilder.load(url).into(view1)
requestBuilder.load(url2).into(view2)

@sjudd
Copy link
Collaborator Author

sjudd commented Oct 13, 2014

I pushed the change to Cloneable, it's definitely cleaner than manually copying the instance variables for this limited use case. Thanks for looking!

@TWiStErRob
Copy link
Collaborator

This modification is a huge step, because now you can pass down a GenericRequestBuilder to Adapters instead of passing down the Fragment to create it. The "how" of the loading is not known to the adapter.

Does trying to be backwards compatible making it harder to make such a change?

@sjudd
Copy link
Collaborator Author

sjudd commented Oct 13, 2014

Aside from our discussion in the SVG app, being backwards compatible wasn't really an issue here. I have to retain the .load() APIs, but those are convenient anyway if you want to do a one-off load and otherwise nothing much was affected other than the Animations.

It may even be possible to add an API like the one we're discussing for the SVG sample without breaking anything.

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.

Allow setting options before setting models
2 participants