Move Niddler instantiation in api module

This commit is contained in:
Shinokuni 2020-11-03 21:13:38 +01:00
parent cfa764e78b
commit f2daac5068
4 changed files with 19 additions and 19 deletions

View File

@ -76,4 +76,7 @@ dependencies {
api 'io.reactivex.rxjava2:rxandroid:2.1.1'
api 'org.jsoup:jsoup:1.13.1'
debugImplementation 'com.icapps.niddler:niddler:1.2.0'
releaseImplementation 'com.icapps.niddler:niddler-noop:1.2.0'
}

View File

@ -1,5 +1,8 @@
package com.readrops.api
import com.icapps.niddler.core.AndroidNiddler
import com.icapps.niddler.core.Niddler
import com.icapps.niddler.interceptor.okhttp.NiddlerOkHttpInterceptor
import com.readrops.api.localfeed.LocalRSSDataSource
import com.readrops.api.services.freshrss.FreshRSSDataSource
import com.readrops.api.services.freshrss.FreshRSSService
@ -33,6 +36,7 @@ val apiModule = module {
.callTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.HOURS)
.addInterceptor(get<AuthInterceptor>())
.addInterceptor(NiddlerOkHttpInterceptor(get(), "niddler"))
.build()
}
@ -99,7 +103,17 @@ val apiModule = module {
//endregion nextcloud news
single {
AuthInterceptor()
single { AuthInterceptor() }
single<Niddler> {
val niddler = AndroidNiddler.Builder()
.setNiddlerInformation(AndroidNiddler.fromApplication(get()))
.setPort(0)
.setMaxStackTraceSize(10)
.build()
niddler.attachToApplication(get())
niddler.apply { start() }
}
}

View File

@ -98,7 +98,4 @@ dependencies {
debugImplementation 'com.facebook.flipper:flipper:0.30.1'
debugImplementation 'com.facebook.soloader:soloader:0.9.0'
debugImplementation 'com.facebook.flipper:flipper-network-plugin:0.30.1'
debugImplementation 'com.icapps.niddler:niddler:1.2.0'
releaseImplementation 'com.icapps.niddler:niddler-noop:1.2.0'
}

View File

@ -16,7 +16,6 @@ import com.facebook.flipper.plugins.navigation.NavigationFlipperPlugin;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.soloader.SoLoader;
import com.icapps.niddler.core.AndroidNiddler;
public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provider {
@ -26,7 +25,6 @@ public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provi
SoLoader.init(this, false);
initFlipper();
//initNiddler();
}
private void initFlipper() {
@ -46,18 +44,6 @@ public class ReadropsDebugApp extends ReadropsApp implements Configuration.Provi
}
}
private void initNiddler() {
AndroidNiddler niddler = new AndroidNiddler.Builder()
.setNiddlerInformation(AndroidNiddler.fromApplication(this))
.setPort(0)
.setMaxStackTraceSize(10)
.build();
niddler.attachToApplication(this);
niddler.start();
}
@NonNull
@Override
public Configuration getWorkManagerConfiguration() {