Updated on 2026-08-14
This commit is contained in:
parent
2585f9e0e8
commit
eafd243752
4 changed files with 12 additions and 10 deletions
|
|
@ -32,11 +32,10 @@ dependencies {
|
|||
implementation(deps.moshi)
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.okHttp)
|
||||
implementation(deps.okHttp.logging)
|
||||
implementation(deps.okHttp.prettyLogging)
|
||||
implementation(deps.retrofit)
|
||||
implementation(deps.retrofit.moshi)
|
||||
implementation(deps.reactive.network)
|
||||
implementation(deps.prettyOkHttpLoggingInterceptor)
|
||||
|
||||
/** Time */
|
||||
implementation(deps.jodatime)
|
||||
|
|
|
|||
|
|
@ -26,8 +26,11 @@ fun createRetrofitInstance(
|
|||
|
||||
if (logEnabled) okHttpBuilder.addInterceptor(createNetworkLoggingInterceptor())
|
||||
|
||||
return Retrofit.Builder().baseUrl(baseUrl).addConverterFactory(MoshiConverter.networkMoshiConverter)
|
||||
.client(okHttpBuilder.build()).build()
|
||||
return Retrofit.Builder()
|
||||
.baseUrl(baseUrl)
|
||||
.addConverterFactory(MoshiConverter.networkMoshiConverter)
|
||||
.client(okHttpBuilder.build())
|
||||
.build()
|
||||
}
|
||||
|
||||
fun createNetworkLoggingInterceptor(): Interceptor {
|
||||
|
|
|
|||
|
|
@ -25,9 +25,10 @@ internal fun OkHttpClient.Builder.addHeaders(vararg requestHeaders: RequestHeade
|
|||
*
|
||||
* @param level logging level. By default, only the request body.
|
||||
*/
|
||||
internal fun OkHttpClient.Builder.allowLogging(): OkHttpClient.Builder =
|
||||
if (BuildConfig.DEBUG) {
|
||||
internal fun OkHttpClient.Builder.allowLogging(): OkHttpClient.Builder {
|
||||
return if (BuildConfig.DEBUG) {
|
||||
addInterceptor(interceptor = createNetworkLoggingInterceptor())
|
||||
} else {
|
||||
this
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ reactiveNetwork = "3.0.8"
|
|||
walletConnectCore = "1.15.0"
|
||||
walletConnectWeb3 = "1.8.0"
|
||||
prettyLogger = "2.2.0"
|
||||
prettyOkHttpLoggingInterceptor = "3.1.0"
|
||||
okHttp-prettyLogging = "3.1.0"
|
||||
# endregion Other libraries
|
||||
|
||||
# region Tangem
|
||||
|
|
@ -203,7 +203,7 @@ material = { module = "com.google.android.material:material", version.ref = "goo
|
|||
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
|
||||
moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
|
||||
okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
|
||||
okHttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
|
||||
okHttp-prettyLogging = { module = "com.github.ihsanbal:LoggingInterceptor", version.ref = "okHttp-prettyLogging" }
|
||||
otaliastudiosCameraView = { module = "com.otaliastudios:cameraview", version.ref = "otaliastudiosCameraView" }
|
||||
shopify-buy = { module = "com.shopify.mobilebuysdk:buy3", version.ref = "shopifyBuySdk" }
|
||||
spongecastle-core = { module = "com.madgag.spongycastle:core", version.ref = "spongycastleCryptoCore" }
|
||||
|
|
@ -225,5 +225,4 @@ reactive-network = { module = "com.github.pwittchen:reactivenetwork-rx2", versio
|
|||
walletConnectCore = { module = "com.walletconnect:android-core", version.ref = "walletConnectCore" }
|
||||
walletConnectWeb3 = { module = "com.walletconnect:web3wallet", version.ref = "walletConnectWeb3" }
|
||||
prettyLogger = { module = "com.orhanobut:logger", version.ref = "prettyLogger" }
|
||||
prettyOkHttpLoggingInterceptor = { module = "com.github.ihsanbal:LoggingInterceptor", version.ref = "prettyOkHttpLoggingInterceptor" }
|
||||
# endregion Other
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue