Skip to content

Commit

Permalink
Merge pull request #3367 from CruGlobal/renovate/circuit
Browse files Browse the repository at this point in the history
GT-2288 Update circuit to v0.19.1
  • Loading branch information
frett authored Feb 13, 2024
2 parents 642fae7 + 80a8f14 commit 15518d1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeleteAccountActivity : BaseActivity() {
setContent {
CircuitCompositionLocals(circuit) {
GodToolsTheme {
val backStack = rememberSaveableBackStack { push(DeleteAccountScreen) }
val backStack = rememberSaveableBackStack(DeleteAccountScreen)
val navigator = rememberCircuitNavigator(backStack)
NavigableCircuitContent(navigator, backStack)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.slack.circuit.foundation.CircuitContent
import com.slack.circuit.runtime.Navigator
import com.slack.circuit.runtime.screen.Screen
import com.slack.circuit.foundation.NavEvent
import java.util.Locale
import kotlinx.coroutines.launch
import org.ccci.gto.android.common.androidx.compose.material3.ui.navigationdrawer.toggle
Expand Down Expand Up @@ -169,26 +168,21 @@ internal fun DashboardLayout(onEvent: (DashboardEvent) -> Unit, viewModel: Dashb
)

Page.ALL_TOOLS -> {
val navigator = remember(onEvent) {
object : Navigator {
override fun goTo(screen: Screen) {
when (screen) {
CircuitContent(
screen = ToolsScreen,
onNavEvent = {
when (it) {
is NavEvent.GoTo -> when (val screen = it.screen) {
is ToolDetailsScreen -> onEvent(
DashboardEvent.OpenToolDetails(
screen.initialTool,
screen.secondLanguage,
)
)
}
else -> Unit
}

override fun pop() = TODO("Not yet implemented")
override fun resetRoot(newRoot: Screen) = TODO("Not yet implemented")
}
}
CircuitContent(
screen = ToolsScreen,
navigator = navigator,
},
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AppLanguageActivity : BaseActivity() {
setContent {
CircuitCompositionLocals(circuit) {
GodToolsTheme {
val backStack = rememberSaveableBackStack { push(AppLanguageScreen) }
val backStack = rememberSaveableBackStack(AppLanguageScreen)
val navigator = rememberCircuitNavigator(backStack)
NavigableCircuitContent(navigator, backStack)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DeleteAccountPresenterTest {
private val accountManager: GodToolsAccountManager = mockk {
coEvery { deleteAccount() } coAnswers { deleteAccountResponse.awaitItem() }
}
private val navigator = FakeNavigator()
private val navigator = FakeNavigator(DeleteAccountScreen)

private val presenter = DeleteAccountPresenter(navigator, accountManager)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ToolsPresenterTest {
every { getLanguagesFlow() } returns languagesFlow
every { getLanguagesFlowForToolCategory(Tool.CATEGORY_GOSPEL) } returns gospelLanguagesFlow
}
private val navigator = FakeNavigator()
private val navigator = FakeNavigator(ToolsScreen)
private val settings: Settings = mockk {
every { appLanguage } returns this@ToolsPresenterTest.appLanguage.value
every { appLanguageFlow } returns this@ToolsPresenterTest.appLanguage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.robolectric.annotation.Config
class AppLanguagePresenterTest {
private val appLanguage = MutableStateFlow(Locale.ENGLISH)

private val navigator = FakeNavigator()
private val navigator = FakeNavigator(AppLanguageScreen)
private val settings: Settings = mockk {
every { appLanguage } returns this@AppLanguagePresenterTest.appLanguage.value
every { appLanguage = any() } answers { this@AppLanguagePresenterTest.appLanguage.value = firstArg() }
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ androidx-lifecycle = "2.7.0"
androidx-room = "2.6.1"
androidx-viewpager2 = "1.0.0"
androidx-work = "2.9.0"
circuit = "0.18.2"
circuit = "0.19.1"
dagger = "2.50"
eventbus = "3.3.1"
facebook = "16.3.0"
Expand Down

0 comments on commit 15518d1

Please sign in to comment.