Skip to content

Commit

Permalink
Rename flaker-retrofit* -> flaker-okhttp
Browse files Browse the repository at this point in the history
  • Loading branch information
RotBolt committed Aug 27, 2023
1 parent 1c7f252 commit b6bfe0d
Show file tree
Hide file tree
Showing 28 changed files with 20 additions and 21 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {
dependencies {

implementation(project(":flaker-android-ui"))
api(project(":flaker-retrofit-core"))
api(project(":flaker-okhttp-core"))
implementation(project(":flaker-domain"))
implementation(project(":flaker-data"))

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import io.rotlabs.di.FlakerDataContainer
import io.rotlabs.flakerandroidretrofit.ui.FlakerViewModel
import io.rotlabs.flakerdb.networkrequest.data.NetworkRequestRepo
import io.rotlabs.flakerprefs.PrefDataStore
import io.rotlabs.flakerretrofit.di.FlakerRetrofitCoreContainer
import io.rotlabs.flakerretrofit.di.FlakerOkHttpCoreContainer

object FlakerAndroidRetrofitContainer {
object FlakerAndroidOkhttpContainer {

private var networkRequestRepo: NetworkRequestRepo? = null

Expand All @@ -22,9 +22,9 @@ object FlakerAndroidRetrofitContainer {
private fun prefDataStore() = prefDataStore!!

fun install(appContext: Context) {
FlakerRetrofitCoreContainer.install(FlakerDataContainer(appContext))
networkRequestRepo = FlakerRetrofitCoreContainer.networkRequestRepo()
prefDataStore = FlakerRetrofitCoreContainer.prefDataStore()
FlakerOkHttpCoreContainer.install(FlakerDataContainer(appContext))
networkRequestRepo = FlakerOkHttpCoreContainer.networkRequestRepo()
prefDataStore = FlakerOkHttpCoreContainer.prefDataStore()
}

fun flakerViewModelFactory(): ViewModelProvider.Factory = viewModelFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import io.rotlabs.flakerandroidretrofit.di.FlakerAndroidRetrofitContainer
import io.rotlabs.flakerandroidretrofit.di.FlakerAndroidOkhttpContainer
import io.rotlabs.flakerandroidui.components.appbars.FlakerBar
import io.rotlabs.flakerandroidui.components.lists.NetworkRequestList
import io.rotlabs.flakerandroidui.screens.prefs.FlakerPrefsDialog
Expand All @@ -29,7 +29,7 @@ import io.rotlabs.flakerandroidui.theme.FlakerAndroidTheme
@OptIn(ExperimentalMaterial3Api::class)
class FlakerActivity : ComponentActivity() {

private val viewModel: FlakerViewModel by viewModels { FlakerAndroidRetrofitContainer.flakerViewModelFactory() }
private val viewModel: FlakerViewModel by viewModels { FlakerAndroidOkhttpContainer.flakerViewModelFactory() }

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
2 changes: 1 addition & 1 deletion flaker-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {
dependencies {

implementation(project(":flaker-android-ui"))
implementation(project(":flaker-retrofit-core"))
implementation(project(":flaker-okhttp-core"))
implementation(project(":flaker-ktor-core"))

implementation(libs.core.ktx)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.rotlabs.flakerretrofit
import io.rotlabs.flakedomain.networkrequest.NetworkRequest
import io.rotlabs.flakerdb.networkrequest.data.NetworkRequestRepo
import io.rotlabs.flakerprefs.PrefDataStore
import io.rotlabs.flakerretrofit.di.FlakerRetrofitCoreContainer
import io.rotlabs.flakerretrofit.di.FlakerOkHttpCoreContainer
import io.rotlabs.flakerretrofit.dto.FlakerFailResponse
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.first
Expand Down Expand Up @@ -93,8 +93,8 @@ class FlakerInterceptor private constructor(
}

fun build(): FlakerInterceptor {
val networkRequestRepo = FlakerRetrofitCoreContainer.networkRequestRepo()
val prefDataStore = FlakerRetrofitCoreContainer.prefDataStore()
val networkRequestRepo = FlakerOkHttpCoreContainer.networkRequestRepo()
val prefDataStore = FlakerOkHttpCoreContainer.prefDataStore()
return FlakerInterceptor(failResponse, prefDataStore, networkRequestRepo)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.rotlabs.di.FlakerDataContainer
import io.rotlabs.flakerdb.networkrequest.data.NetworkRequestRepo
import io.rotlabs.flakerprefs.PrefDataStore

object FlakerRetrofitCoreContainer {
object FlakerOkHttpCoreContainer {

private var networkRequestRepo: NetworkRequestRepo? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.rotlabs.flakerretrofit

import io.rotlabs.flakerprefs.RetentionPolicy
import io.rotlabs.flakerprefs.dto.FlakerPrefs
import io.rotlabs.flakerretrofit.di.FlakerRetrofitCoreContainer
import io.rotlabs.flakerretrofit.di.FlakerOkHttpCoreContainer
import io.rotlabs.flakerretrofit.dto.FlakerFailResponse
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
Expand Down Expand Up @@ -30,7 +30,7 @@ class FlakerInterceptorTest {

@Before
fun setup() {
FlakerRetrofitCoreContainer.install(testDataDependencyContainer)
FlakerOkHttpCoreContainer.install(testDataDependencyContainer)
}

@Test
Expand Down
3 changes: 1 addition & 2 deletions flakersampleapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,5 @@ dependencies {
androidTestImplementation(libs.ui.test.junit4)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)

implementation(project(":flaker-android-retrofit"))
implementation(project(":flaker-android-okhttp"))
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.rotlabs.flakersampleapp

import android.app.Application
import io.rotlabs.flakerandroidretrofit.di.FlakerAndroidRetrofitContainer
import io.rotlabs.flakerandroidretrofit.di.FlakerAndroidOkhttpContainer
import io.rotlabs.flakersampleapp.di.AppContainer

class MainApplication : Application() {
Expand All @@ -10,7 +10,7 @@ class MainApplication : Application() {

override fun onCreate() {
super.onCreate()
FlakerAndroidRetrofitContainer.install(this)
FlakerAndroidOkhttpContainer.install(this)
appContainer = AppContainer()
}
}
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ dependencyResolutionManagement {

rootProject.name = "Flaker"
include(":flaker-android-ui")
include(":flaker-retrofit-core")
include(":flaker-okhttp-core")
include(":flaker-ktor-core")
include(":flaker-android-retrofit")
include(":flaker-android-okhttp")
include(":flaker-android-ktor")
include(":flaker-android")
include(":flaker-data")
Expand Down

0 comments on commit b6bfe0d

Please sign in to comment.