Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d22f28a

Browse files
committedDec 18, 2016
demo(adapt-no-okhttp): adapt there is no okhttp dependency as default anymore in the library
Refs lingochamp#158
1 parent 1584f18 commit d22f28a

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed
 

‎demo/src/main/java/com/liulishuo/filedownloader/demo/DemoApplication.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
import android.util.Log;
66

77
import com.liulishuo.filedownloader.FileDownloader;
8-
import com.liulishuo.filedownloader.util.FileDownloadHelper;
98
import com.liulishuo.filedownloader.util.FileDownloadLog;
109
import com.liulishuo.filedownloader.util.FileDownloadUtils;
1110

12-
import java.net.Proxy;
13-
import java.util.concurrent.TimeUnit;
14-
1511
import cn.dreamtobe.threaddebugger.IThreadDebugger;
1612
import cn.dreamtobe.threaddebugger.ThreadDebugger;
1713
import cn.dreamtobe.threaddebugger.ThreadDebuggers;
18-
import okhttp3.OkHttpClient;
1914

2015
/**
2116
* Created by Jacksgong on 12/17/15.
@@ -38,20 +33,7 @@ public void onCreate() {
3833
* by below code, so please do not worry about performance.
3934
* @see FileDownloader#init(Context)
4035
*/
41-
FileDownloader.init(getApplicationContext(),
42-
new FileDownloadHelper.OkHttpClientCustomMaker() { // is not has to provide.
43-
@Override
44-
public OkHttpClient customMake() {
45-
// just for OkHttpClient customize.
46-
final OkHttpClient.Builder builder = new OkHttpClient.Builder();
47-
// you can set the connection timeout.
48-
builder.connectTimeout(15_000, TimeUnit.MILLISECONDS);
49-
// you can set the HTTP proxy.
50-
builder.proxy(Proxy.NO_PROXY);
51-
// etc.
52-
return builder.build();
53-
}
54-
});
36+
FileDownloader.init(getApplicationContext());
5537

5638
// below codes just for monitoring thread pools in the FileDownloader:
5739
IThreadDebugger debugger = ThreadDebugger.install(

0 commit comments

Comments
 (0)
Failed to load comments.