Use placeholderRes/errorRes if url is null
See original GitHub issueIt would be cool if passing null url would use placeholder drawable or error drawable if set. Right now it defeats the purpose of fluent api when you have to do something like:
if (imageUrl != null) { it.load(imageUrl) { placeholder(placeholderRes) } } else { it.setImageResource(placeholderRes) }
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Using placeholder in Coil when the url is null - Stack Overflow
I get some data from database and push it to reciclerview. I use Coil to show images. But there are some urls that...
Read more >Placeholders - Glide v4 - GitHub Pages
If the request fails and an error Drawable is not set, the placeholder will continue to be displayed. Similarly if the requested url/model...
Read more ><input type="url"> - HTML: HyperText Markup Language | MDN
A placeholder is a value that demonstrates the form the value should take by presenting an example of a valid value, which is...
Read more >Broken Image for plugin Placeholder | Confluence Server and ...
Confluence generates a lot of Broken Image for plugin Placeholder error. ... IllegalArgumentException: input == null! at java.desktop/javax.imageio.
Read more >NullReferenceException for placeholders in Experience Editor
So, as per the error info you've shared, in your case the Null ... Inner Exception: Object reference not set to an instance...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mlilienberg Great point. I think it makes sense to use the same API as Glide. i.e.:
Similar to
placeholder
anderror
, you should be able to set the defaultfallback
on yourImageLoader
.This is now supported in master. To get the fix asap you can depend on
0.9.0-SNAPSHOT
.NOTE: There might be minor behaviour changes to the feature before
0.9.0
stable.