Add stetho in debug to allow some inspection
This commit is contained in:
parent
24ffd96b6e
commit
b5f40f9732
|
@ -76,6 +76,7 @@ dependencies {
|
|||
|
||||
implementation 'com.jakewharton.threetenabp:threetenabp:1.1.1'
|
||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||
implementation 'com.facebook.stetho:stetho:1.5.0'
|
||||
|
||||
// rx
|
||||
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
|
||||
|
|
|
@ -19,6 +19,7 @@ package im.vector.riotredesign
|
|||
import android.app.Application
|
||||
import android.content.Context
|
||||
import androidx.multidex.MultiDex
|
||||
import com.facebook.stetho.Stetho
|
||||
import com.jakewharton.threetenabp.AndroidThreeTen
|
||||
import im.vector.matrix.android.BuildConfig
|
||||
import im.vector.riotredesign.core.di.AppModule
|
||||
|
@ -33,6 +34,7 @@ class Riot : Application() {
|
|||
super.onCreate()
|
||||
if (BuildConfig.DEBUG) {
|
||||
Timber.plant(Timber.DebugTree())
|
||||
Stetho.initializeWithDefaults(this)
|
||||
}
|
||||
AndroidThreeTen.init(this)
|
||||
startKoin(listOf(AppModule(this).definition), logger = EmptyLogger())
|
||||
|
|
|
@ -95,6 +95,7 @@ dependencies {
|
|||
|
||||
// Logging
|
||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
|
||||
|
||||
debugImplementation 'com.airbnb.okreplay:okreplay:1.4.0'
|
||||
releaseImplementation 'com.airbnb.okreplay:noop:1.4.0'
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package im.vector.matrix.android.internal.di
|
||||
|
||||
import com.facebook.stetho.okhttp3.StethoInterceptor
|
||||
import im.vector.matrix.android.internal.network.AccessTokenInterceptor
|
||||
import im.vector.matrix.android.internal.network.NetworkConnectivityChecker
|
||||
import im.vector.matrix.android.internal.network.UnitConverterFactory
|
||||
|
@ -47,11 +48,16 @@ class NetworkModule {
|
|||
OkReplayInterceptor()
|
||||
}
|
||||
|
||||
single {
|
||||
StethoInterceptor()
|
||||
}
|
||||
|
||||
single {
|
||||
OkHttpClient.Builder()
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.writeTimeout(30, TimeUnit.SECONDS)
|
||||
.addNetworkInterceptor(get<StethoInterceptor>())
|
||||
.addInterceptor(get<AccessTokenInterceptor>())
|
||||
.addInterceptor(get<HttpLoggingInterceptor>())
|
||||
.addInterceptor(get<OkReplayInterceptor>())
|
||||
|
|
Loading…
Reference in New Issue