Use OkHttp with UIL
This commit is contained in:
parent
72a9940863
commit
a2373b817a
3 changed files with 40 additions and 1 deletions
25
app/src/main/java/org/schabi/newpipe/ImageDownloader.java
Normal file
25
app/src/main/java/org/schabi/newpipe/ImageDownloader.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package org.schabi.newpipe;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
|
||||
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class ImageDownloader extends BaseImageDownloader {
|
||||
public ImageDownloader(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ImageDownloader(Context context, int connectTimeout, int readTimeout) {
|
||||
super(context, connectTimeout, readTimeout);
|
||||
}
|
||||
|
||||
protected InputStream getStreamFromNetwork(String imageUri, Object extra) throws IOException {
|
||||
Downloader downloader = (Downloader) NewPipe.getDownloader();
|
||||
return downloader.stream(imageUri);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue