Extend IconDownloader to handle asset:// protocol
This is currently needed for screenshot placeholders, but might be useful in the future as well. Note that the default BaseImageDownloaded supports this, as well as content:// and drawable:// protocols.
This commit is contained in:
parent
dcf41bcdf2
commit
3f04606fcc
@ -17,7 +17,11 @@ public class IconDownloader implements ImageDownloader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getStream(String imageUri, Object extra) throws IOException {
|
public InputStream getStream(String imageUri, Object extra) throws IOException {
|
||||||
return DownloaderFactory.create(context, imageUri).getInputStream();
|
switch (Scheme.ofUri(imageUri)) {
|
||||||
|
case ASSETS:
|
||||||
|
return context.getAssets().open(Scheme.ASSETS.crop(imageUri));
|
||||||
|
default:
|
||||||
|
return DownloaderFactory.create(context, imageUri).getInputStream();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user