fix appbar scroll behavior
This commit is contained in:
@ -35,33 +35,33 @@ public class Injection {
|
||||
}
|
||||
|
||||
public static OkHttpClient.Builder provideRetrofitBuilder() {
|
||||
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
|
||||
|
||||
@Override
|
||||
public void log(String message) {
|
||||
//分段打印retrofit日志
|
||||
if (message.startsWith("{") || message.startsWith("["))
|
||||
if (message.length() > 4000) {
|
||||
for (int i = 0; i < message.length(); i += 4000) {
|
||||
if (i + 4000 < message.length())
|
||||
Utils.log("OkHttp_Body::" + i, message.substring(i, i + 4000));
|
||||
else
|
||||
Utils.log("OkHttp_Body::" + i, message.substring(i, message.length()));
|
||||
}
|
||||
} else
|
||||
Utils.log("OkHttp_Body::", message);
|
||||
}
|
||||
});
|
||||
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
// HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
|
||||
//
|
||||
// @Override
|
||||
// public void log(String message) {
|
||||
// //分段打印retrofit日志
|
||||
// if (message.startsWith("{") || message.startsWith("["))
|
||||
// if (message.length() > 4000) {
|
||||
// for (int i = 0; i < message.length(); i += 4000) {
|
||||
// if (i + 4000 < message.length())
|
||||
// Utils.log("OkHttp_Body::" + i, message.substring(i, i + 4000));
|
||||
// else
|
||||
// Utils.log("OkHttp_Body::" + i, message.substring(i, message.length()));
|
||||
// }
|
||||
// } else
|
||||
// Utils.log("OkHttp_Body::", message);
|
||||
// }
|
||||
// });
|
||||
// loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
|
||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
|
||||
interceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
|
||||
builder.addNetworkInterceptor(interceptor);
|
||||
builder.addNetworkInterceptor(new StethoInterceptor());
|
||||
if (BuildConfig.DEBUG) {
|
||||
builder.addNetworkInterceptor(loggingInterceptor);
|
||||
}
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// builder.addNetworkInterceptor(loggingInterceptor);
|
||||
// }
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user