LibreTube/app/src/main/java/com/github/libretube/RetrofitInstance.kt

20 lines
573 B
Kotlin
Raw Normal View History

2022-02-01 21:22:06 +05:30
package com.github.libretube
2021-12-18 16:34:14 +05:30
2022-02-08 19:57:13 +05:30
import android.content.Context
import android.util.Log
import androidx.preference.PreferenceManager
import kotlinx.coroutines.withContext
2021-12-18 16:34:14 +05:30
import retrofit2.Retrofit
import retrofit2.converter.jackson.JacksonConverterFactory
2022-02-08 19:57:13 +05:30
import kotlin.coroutines.coroutineContext
2021-12-18 16:34:14 +05:30
object RetrofitInstance {
2022-02-08 19:57:13 +05:30
lateinit var url: String
2021-12-18 16:34:14 +05:30
val api: PipedApi by lazy {
Retrofit.Builder()
2022-02-08 19:57:13 +05:30
.baseUrl(url)
2021-12-18 16:34:14 +05:30
.addConverterFactory(JacksonConverterFactory.create())
.build()
.create(PipedApi::class.java)
}
}