-
Notifications
You must be signed in to change notification settings - Fork 660
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
Deprecate Coil and ImageLoader extension functions. #322
Conversation
Is there a way to "block" the call until they call |
@Jawnnypoo Yep, ideally we'd want to force Verifying it's called at runtime can be done one of two ways:
I'm leaning towards the second since it's easier to go from 2 -> 1 (more restrictive) than it is to go from 1 -> 2 (less restrictive) if we decide we want to change. Let me know what you think! |
Ahhh yes, option 2 makes much more sense based on what is in place currently 👍 |
816d0af
to
87a7577
Compare
44220eb
to
8c65b1f
Compare
d47f330
to
dec5fc7
Compare
Did you make a decision on this? |
@gabrielittner Yep, though definitely still looking for feedback if you agree/disagree. Originally in this PR request creation was going to be coupled with the val disposable = imageLoader.load(context)
.data("https://www.example.com/image.jpg")
.target(imageView)
.execute() However, I ended up revising the PR based on feedback to keep the request separate from the val request = LoadRequest.Builder(context)
.data("https://www.example.com/image.jpg")
.target(imageView)
.build()
val disposable = imageLoader.execute(request) Since the |
* Deprecate remaining DSL methods (except ImageView.load). * Deprecate removed API. * Update documentation. * Tweaks. * Docs. * Fix tests. * Tweak. * Fix test. * Fix test. * Docs. * Docs. * Remove suppress. * Update docs. * Relax non-null GetRequest data. * Fix type inference. * Docs. * Infer request params after construction. * Re-add deprecated constructors. * Docs. * Update API. * Avoid generating protected getters and setters. * API tweaks. * launch -> execute. * Validate an explicit fetcher. * Documentation. * Documentation. * Documentation. * Update API. * Docs. * Docs. * Fix recursion. * Add CI timeout. * Docs. * Rename EventListener.Factory.NONE. * Re-add deprecated constructors. * Add other deprecated constructor. * Remove suppress. * Update API. * Set Transition.NONE. * Docs. * Update test.
Looking for feedback on this!
This PR deprecates the
ImageLoader.load(context, data)
,ImageLoader.get(data)
,Coil.load(context, data)
, andCoil.get(data)
functions in favour of a more standard builder syntax:NOTE: This does not deprecate
ImageView.load
.Why deprecate these functions? I covered a lot of my thoughts on builders here that I think apply here as well.
Upsides:
Downsides:
data(Any)
)Overall, I think this makes it clearer that requests are value objects that can be constructed now and executed later:
Open questions:
target
+launch
function similar to Glide and Picasso'sinto
?data
when constructing a request?