TVT-63: Add Support for OkHttpProfiler

This commit is contained in:
Owen LeJeune
2022-11-18 17:12:36 -05:00
parent 0e0ce33a47
commit 69c7e387b5
2 changed files with 4 additions and 0 deletions

View File

@@ -103,11 +103,13 @@ dependencies {
def retrofit = "2.9.0"
def stetho = "1.6.0"
def gson = "2.9.0"
def profiler = "1.0.8"
implementation "com.squareup.retrofit2:retrofit:$retrofit"
implementation "com.squareup.retrofit2:converter-gson:$retrofit"
implementation "com.google.code.gson:gson:$gson"
implementation "com.facebook.stetho:stetho:$stetho"
implementation "com.facebook.stetho:stetho-okhttp3:$stetho"
implementation "com.localebro:okhttpprofiler:$profiler"
// koin
def koin = "3.1.4"

View File

@@ -1,10 +1,12 @@
package com.owenlejeune.tvtime.api
import com.facebook.stetho.okhttp3.StethoInterceptor
import com.localebro.okhttpprofiler.OkHttpProfilerInterceptor
import okhttp3.OkHttpClient
class DebugHttpClient: HttpClient {
override val httpClient: OkHttpClient = OkHttpClient.Builder()
.addInterceptor(OkHttpProfilerInterceptor())
.addNetworkInterceptor(StethoInterceptor())
.build()
}