提交 4db9ef95 编写于 作者: J jessyan

improve GlideModule

上级 339b7232
......@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -32,7 +32,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
*/
@Module
public class ClientModule {
private static final int TOME_OUT = 10;
private static final int TIME_OUT = 10;
public static final int HTTP_RESPONSE_DISK_CACHE_MAX_SIZE = 10 * 1024 * 1024;//缓存文件最大值为10Mb
private HttpUrl mApiUrl;
private GlobeHttpHandler mHandler;
......@@ -185,8 +185,8 @@ public class ClientModule {
OkHttpClient.Builder builder = okHttpClient
.connectTimeout(TOME_OUT, TimeUnit.SECONDS)
.readTimeout(TOME_OUT, TimeUnit.SECONDS)
.connectTimeout(TIME_OUT, TimeUnit.SECONDS)
.readTimeout(TIME_OUT, TimeUnit.SECONDS)
.cache(cache)//设置缓存
.addNetworkInterceptor(intercept);
if (mInterceptors != null && mInterceptors.length > 0) {//如果外部提供了interceptor的数组则遍历添加
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册