Add Stetho debug bridge

This commit is contained in:
Shinokuni 2019-08-18 13:07:59 +02:00
parent cc9a78ba43
commit d21a76c4e3
4 changed files with 10 additions and 6 deletions

View File

@ -56,7 +56,7 @@ dependencies {
implementation 'androidx.paging:paging-runtime:2.1.0'
implementation 'androidx.paging:paging-common:2.1.0'
implementation 'joda-time:joda-time:2.9.9'
implementation 'joda-time:joda-time:2.10.1'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
@ -66,4 +66,6 @@ dependencies {
implementation 'com.mikepenz:fastadapter:3.3.1'
implementation 'com.mikepenz:fastadapter-commons:3.3.0'
implementation 'com.mikepenz:materialdrawer:6.1.2'
implementation 'com.facebook.stetho:stetho:1.5.1'
}

View File

@ -2,6 +2,8 @@ package com.readrops.app.utils;
import android.app.Application;
import com.facebook.stetho.Stetho;
import io.reactivex.plugins.RxJavaPlugins;
public class ReadropsApp extends Application {
@ -11,5 +13,6 @@ public class ReadropsApp extends Application {
super.onCreate();
RxJavaPlugins.setErrorHandler(e -> { });
Stetho.initializeWithDefaults(this);
}
}

View File

@ -43,4 +43,5 @@ dependencies {
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
}

View File

@ -1,5 +1,6 @@
package com.readrops.readropslibrary.utils;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.readrops.readropslibrary.BuildConfig;
import com.readrops.readropslibrary.services.Credentials;
@ -10,7 +11,6 @@ import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
public class HttpManager {
@ -35,10 +35,8 @@ public class HttpManager {
httpBuilder.addInterceptor(new AuthInterceptor());
if (BuildConfig.DEBUG) {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
httpBuilder.addInterceptor(loggingInterceptor);
StethoInterceptor loggingInterceptor = new StethoInterceptor();
httpBuilder.addNetworkInterceptor(loggingInterceptor);
}
okHttpClient = httpBuilder.build();