-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Allow fallback to take a full request rather than just drawables #451
Comments
I agree it's complex, here are some thoughts: It's similar to thumbnail, but there's a big difference: thumbnail races for I think Andre's use case is a really good example (little bit enhanced here): load(programme.url)
.thumbnail(0.2)
.fitCenter()
.fallback(
load(programme.series.url)
.thumbnail(0.4)
.transformation(...)
.fallback(
load(programme.channel.url)
.sizeMultiplier(0.5)
.centerCrop()
)
) with the only exception that he expects HTTP 404 so fallbacks should be errors?! |
+1 |
1 similar comment
+1 |
+1 |
1 similar comment
+1 |
+1 |
+1 |
+1 I'm showing pictures against a Stream description. I would like to show 1) a thumbnail if available 2) A game image if not 3) a default image if none is available |
+1 Use-Case: Fallback to different Images. Imagine a music-player that could download covers from last.fm or xyz.com or from the file or in the end generate a cover. |
+1 We have a lot of images we are loading in recycler views. An image can have more than one type, but depending on the resource/environment, not all types are available. So we first try to load type A, if it fails, we try to load type B, if that fails we try type C, so on and so forth. We currently do this by calling load() in a listener's onException() method with the next URI and return true. If we run out of URIs to try, we return false. Ideally, we would like to pass in a list of URIs to the load() method, and just have our listener deal with the final success/failure scenario after either one of the URIs succeeds, or all have failed. |
+1 |
@"+1"s (everyone): can you please edit your comments to include your use case, it may help the implementor to choose the right way of implementing serving all of these use cases. |
+1 - same use case as @pkuprys |
+1 I have a URL which may contain a specific image (if the vendor has a custom image) - however if it doesn't exist I need to hit another URL to get 'default' version of this |
+1 - much the same use case as @pkuprys On the server we resize our images into different resolutions for devices to fetch based on screen size. Not all images. However the resizing is not guaranteed for all images, so we would like to fallback to the original image in that case. |
@sjudd I'm not entirely sure if this is fixed. Didn't run it, but just looking at the code I can't see how I could do this:
|
I've added an I believe the above covers your first and third point. Your second point is covered either by the existing fallback drawable, or by a simple Does that make sense? |
Ok, thanks, makes sense. Just wanted to clarify it was intentional. |
No description provided.
The text was updated successfully, but these errors were encountered: