Skip to content

Commit

Permalink
fixing errors resulted by screen model module changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DevSrSouza committed Nov 28, 2023
1 parent bc8d1d0 commit 1449d98
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cafe.adriel.voyager.sample.liveDataIntegration

import cafe.adriel.voyager.core.model.coroutineScope
import cafe.adriel.voyager.core.model.screenModelScope
import cafe.adriel.voyager.livedata.LiveScreenModel
import cafe.adriel.voyager.sample.sampleItems
import kotlinx.coroutines.delay
Expand All @@ -16,7 +16,7 @@ class LiveDataScreenModel : LiveScreenModel<LiveDataScreenModel.State>(State.Loa
private val items = sampleItems

fun getItems() {
coroutineScope.launch {
screenModelScope.launch {
delay(1_000)
mutableState.postValue(State.Result(items))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cafe.adriel.voyager.sample.screenModel

import cafe.adriel.voyager.core.model.StateScreenModel
import cafe.adriel.voyager.core.model.coroutineScope
import cafe.adriel.voyager.core.model.screenModelScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

Expand All @@ -15,7 +15,7 @@ class DetailsScreenModel(
}

fun getItem(index: Int) {
coroutineScope.launch {
screenModelScope.launch {
delay(1_000)
mutableState.value = State.Result("Item #$index")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ public class SnapshotStateStack<Item>(
stateStack.lastOrNull()
}

public override val lastOrNull: Item? by derivedStateOf {
lastItemOrNull
}

public override val size: Int by derivedStateOf {
stateStack.size
}
Expand Down
1 change: 1 addition & 0 deletions voyager-hilt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kapt {
}

dependencies {
api(projects.voyagerScreenmodel)
api(projects.voyagerNavigator)

implementation(libs.compose.runtime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import cafe.adriel.voyager.core.annotation.ExperimentalVoyagerApi
import cafe.adriel.voyager.core.model.ScreenModel
import cafe.adriel.voyager.core.model.rememberNavigatorScreenModel
import cafe.adriel.voyager.core.model.rememberScreenModel
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.hilt.internal.componentActivity
import cafe.adriel.voyager.navigator.Navigator
import cafe.adriel.voyager.navigator.screenModel.rememberNavigatorScreenModel
import dagger.hilt.android.EntryPointAccessors

/**
Expand Down
1 change: 1 addition & 0 deletions voyager-kodein/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ kotlin {
val commonMain by getting {
dependencies {
api(projects.voyagerCore)
api(projects.voyagerScreenmodel)
api(projects.voyagerNavigator)
compileOnly(compose.runtime)
compileOnly(compose.runtimeSaveable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cafe.adriel.voyager.kodein
import androidx.compose.runtime.Composable
import cafe.adriel.voyager.core.annotation.ExperimentalVoyagerApi
import cafe.adriel.voyager.core.model.ScreenModel
import cafe.adriel.voyager.core.model.rememberNavigatorScreenModel
import cafe.adriel.voyager.core.model.rememberScreenModel
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.navigator.Navigator
import cafe.adriel.voyager.navigator.screenModel.rememberNavigatorScreenModel
import org.kodein.di.compose.localDI
import org.kodein.di.direct
import org.kodein.di.provider
Expand Down
1 change: 1 addition & 0 deletions voyager-koin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kotlin {
val commonMain by getting {
dependencies {
api(projects.voyagerCore)
api(projects.voyagerScreenmodel)
api(projects.voyagerNavigator)

compileOnly(compose.runtime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cafe.adriel.voyager.koin
import androidx.compose.runtime.Composable
import cafe.adriel.voyager.core.annotation.ExperimentalVoyagerApi
import cafe.adriel.voyager.core.model.ScreenModel
import cafe.adriel.voyager.core.model.rememberNavigatorScreenModel
import cafe.adriel.voyager.core.model.rememberScreenModel
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.navigator.Navigator
import cafe.adriel.voyager.navigator.screenModel.rememberNavigatorScreenModel
import org.koin.compose.getKoin
import org.koin.core.parameter.ParametersDefinition
import org.koin.core.qualifier.Qualifier
Expand Down
1 change: 1 addition & 0 deletions voyager-livedata/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ android {

dependencies {
api(projects.voyagerCore)
api(projects.voyagerScreenmodel)

implementation(libs.compose.runtimeLiveData)

Expand Down
1 change: 1 addition & 0 deletions voyager-rxjava/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kotlin {
val jvmMain by getting {
dependencies {
api(projects.voyagerCore)
api(projects.voyagerScreenmodel)
compileOnly(libs.rxjava)
}
}
Expand Down

0 comments on commit 1449d98

Please sign in to comment.