From e50c2c95e3ff46faa756e5e7f1036306d19a2a00 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Fri, 1 Sep 2023 14:01:25 -0400 Subject: [PATCH] Updates --- .../catchup/ui/debug/DebugSettingsScreen.kt | 2 +- .../catchup/circuit/FullScreenOverlay.kt | 25 ------------------- .../catchup/service/CircuitModule.kt | 2 +- .../catchup/service/ServiceScreen.kt | 2 +- .../io/sweers/catchup/home/DrawerScreen.kt | 2 +- .../io/sweers/catchup/home/HomeScreen.kt | 2 +- .../io/sweers/catchup/ui/about/AboutScreen.kt | 2 +- .../catchup/ui/about/ChangelogScreen.kt | 2 +- .../sweers/catchup/ui/about/LicensesScreen.kt | 2 +- .../catchup/ui/activity/ImageViewerScreen.kt | 16 ++++++------ .../catchup/ui/activity/MainActivity.kt | 1 - .../ui/activity/OrderServicesScreen.kt | 2 +- .../catchup/ui/activity/SettingsScreen.kt | 2 +- .../catchup/deeplink/DeepLinkHandler.kt | 2 +- .../catchup/deeplink/DeepLinkable.kt | 2 +- .../catchup/summarizer/SummarizerScreen.kt | 2 +- 16 files changed, 20 insertions(+), 48 deletions(-) delete mode 100644 app/src/main/kotlin/dev/zacsweers/catchup/circuit/FullScreenOverlay.kt diff --git a/app/src/debug/kotlin/io/sweers/catchup/ui/debug/DebugSettingsScreen.kt b/app/src/debug/kotlin/io/sweers/catchup/ui/debug/DebugSettingsScreen.kt index ce875f648..f9417efd4 100644 --- a/app/src/debug/kotlin/io/sweers/catchup/ui/debug/DebugSettingsScreen.kt +++ b/app/src/debug/kotlin/io/sweers/catchup/ui/debug/DebugSettingsScreen.kt @@ -63,8 +63,8 @@ import com.slack.circuit.overlay.LocalOverlayHost import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.slack.circuit.runtime.ui.Ui import com.slack.circuitx.android.IntentScreen import com.slack.circuitx.overlays.BottomSheetOverlay diff --git a/app/src/main/kotlin/dev/zacsweers/catchup/circuit/FullScreenOverlay.kt b/app/src/main/kotlin/dev/zacsweers/catchup/circuit/FullScreenOverlay.kt deleted file mode 100644 index 415416a77..000000000 --- a/app/src/main/kotlin/dev/zacsweers/catchup/circuit/FullScreenOverlay.kt +++ /dev/null @@ -1,25 +0,0 @@ -package dev.zacsweers.catchup.circuit - -import com.slack.circuit.overlay.OverlayNavigator -import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen -import dev.zacsweers.catchup.compose.ConditionalSystemUiColors - -private class DispatchingOverlayNavigator( - private val navigator: OverlayNavigator, - private val conditionalSystemUiColors: ConditionalSystemUiColors, -) : Navigator { - override fun goTo(screen: Screen) { - error("goTo() is not supported in full screen overlays!") - } - - override fun pop(): Screen? { - navigator.finish(Unit) - conditionalSystemUiColors.restore() - return null - } - - override fun resetRoot(newRoot: Screen): List { - error("resetRoot() is not supported in full screen overlays!") - } -} diff --git a/app/src/main/kotlin/dev/zacsweers/catchup/service/CircuitModule.kt b/app/src/main/kotlin/dev/zacsweers/catchup/service/CircuitModule.kt index 47a6b1e6f..dbbca8f70 100644 --- a/app/src/main/kotlin/dev/zacsweers/catchup/service/CircuitModule.kt +++ b/app/src/main/kotlin/dev/zacsweers/catchup/service/CircuitModule.kt @@ -7,8 +7,8 @@ import androidx.compose.ui.text.TextStyle import com.slack.circuit.foundation.Circuit import com.slack.circuit.foundation.LocalCircuit import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.slack.circuit.runtime.ui.Ui import com.squareup.anvil.annotations.ContributesTo import dagger.Module diff --git a/app/src/main/kotlin/dev/zacsweers/catchup/service/ServiceScreen.kt b/app/src/main/kotlin/dev/zacsweers/catchup/service/ServiceScreen.kt index 20ae39997..c2e3e4d15 100644 --- a/app/src/main/kotlin/dev/zacsweers/catchup/service/ServiceScreen.kt +++ b/app/src/main/kotlin/dev/zacsweers/catchup/service/ServiceScreen.kt @@ -50,8 +50,8 @@ import com.slack.circuit.overlay.LocalOverlayHost import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.slack.circuitx.android.IntentScreen import com.slack.circuitx.overlays.showFullScreenOverlay import dagger.assisted.Assisted diff --git a/app/src/main/kotlin/io/sweers/catchup/home/DrawerScreen.kt b/app/src/main/kotlin/io/sweers/catchup/home/DrawerScreen.kt index 94e7fc9bb..9fc2d288b 100644 --- a/app/src/main/kotlin/io/sweers/catchup/home/DrawerScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/home/DrawerScreen.kt @@ -1,6 +1,6 @@ package io.sweers.catchup.home -import com.slack.circuit.runtime.Screen +import com.slack.circuit.runtime.screen.Screen import com.squareup.anvil.annotations.ContributesTo import dagger.BindsOptionalOf import dagger.Module diff --git a/app/src/main/kotlin/io/sweers/catchup/home/HomeScreen.kt b/app/src/main/kotlin/io/sweers/catchup/home/HomeScreen.kt index bc4299b6d..0f5ed7fc3 100644 --- a/app/src/main/kotlin/io/sweers/catchup/home/HomeScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/home/HomeScreen.kt @@ -69,8 +69,8 @@ import com.slack.circuit.overlay.LocalOverlayHost import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.slack.circuitx.overlays.BottomSheetOverlay import com.squareup.anvil.annotations.ContributesMultibinding import dagger.assisted.Assisted diff --git a/app/src/main/kotlin/io/sweers/catchup/ui/about/AboutScreen.kt b/app/src/main/kotlin/io/sweers/catchup/ui/about/AboutScreen.kt index 7e97af97a..c240549b2 100644 --- a/app/src/main/kotlin/io/sweers/catchup/ui/about/AboutScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/ui/about/AboutScreen.kt @@ -23,8 +23,8 @@ import androidx.compose.ui.res.stringResource import com.slack.circuit.codegen.annotations.CircuitInject import com.slack.circuit.foundation.CircuitContent import com.slack.circuit.runtime.CircuitUiState -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.squareup.anvil.annotations.ContributesMultibinding import dagger.assisted.Assisted import dagger.assisted.AssistedFactory diff --git a/app/src/main/kotlin/io/sweers/catchup/ui/about/ChangelogScreen.kt b/app/src/main/kotlin/io/sweers/catchup/ui/about/ChangelogScreen.kt index c481be5bc..b3b9ff4d8 100644 --- a/app/src/main/kotlin/io/sweers/catchup/ui/about/ChangelogScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/ui/about/ChangelogScreen.kt @@ -25,8 +25,8 @@ import com.apollographql.apollo3.exception.ApolloException import com.slack.circuit.codegen.annotations.CircuitInject import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.squareup.anvil.annotations.ContributesBinding import dev.zacsweers.catchup.compose.LocalDynamicTheme import dev.zacsweers.catchup.di.AppScope diff --git a/app/src/main/kotlin/io/sweers/catchup/ui/about/LicensesScreen.kt b/app/src/main/kotlin/io/sweers/catchup/ui/about/LicensesScreen.kt index 6fe71ebb1..8b072858a 100644 --- a/app/src/main/kotlin/io/sweers/catchup/ui/about/LicensesScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/ui/about/LicensesScreen.kt @@ -40,8 +40,8 @@ import com.apollographql.apollo3.exception.ApolloException import com.slack.circuit.codegen.annotations.CircuitInject import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.squareup.anvil.annotations.ContributesBinding import com.squareup.anvil.annotations.ContributesTo import com.squareup.moshi.JsonClass diff --git a/app/src/main/kotlin/io/sweers/catchup/ui/activity/ImageViewerScreen.kt b/app/src/main/kotlin/io/sweers/catchup/ui/activity/ImageViewerScreen.kt index 7de33b3de..99052a039 100644 --- a/app/src/main/kotlin/io/sweers/catchup/ui/activity/ImageViewerScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/ui/activity/ImageViewerScreen.kt @@ -33,17 +33,17 @@ import androidx.core.view.WindowInsetsControllerCompat import coil.request.ImageRequest import com.google.accompanist.systemuicontroller.rememberSystemUiController import com.slack.circuit.backstack.NavDecoration -import com.slack.circuit.backstack.SaveableBackStack import com.slack.circuit.codegen.annotations.CircuitInject import com.slack.circuit.foundation.NavigatorDefaults +import com.slack.circuit.foundation.RecordContentProvider import com.slack.circuit.foundation.screen import com.slack.circuit.overlay.LocalOverlayHost import com.slack.circuit.overlay.OverlayHost import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.slack.circuitx.overlays.BottomSheetOverlay import dagger.assisted.Assisted import dagger.assisted.AssistedFactory @@ -57,6 +57,7 @@ import io.sweers.catchup.base.ui.NavButtonType import io.sweers.catchup.data.LinkManager import io.sweers.catchup.service.api.UrlMeta import io.sweers.catchup.ui.activity.FlickToDismissState.FlickGestureState.Dismissed +import kotlinx.collections.immutable.ImmutableList import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import kotlinx.parcelize.Parcelize @@ -267,21 +268,18 @@ private fun launchShareSheet( class ImageViewerAwareNavDecoration : NavDecoration { @Composable override fun DecoratedContent( - arg: T, + args: ImmutableList, backStackDepth: Int, modifier: Modifier, content: @Composable (T) -> Unit ) { + val arg = args.first() val decoration = - if ( - arg is Pair<*, *> && - arg.first is SaveableBackStack.Record && - (arg.first as SaveableBackStack.Record).screen is ImageViewerScreen - ) { + if (arg is RecordContentProvider && arg.record.screen is ImageViewerScreen) { NavigatorDefaults.EmptyDecoration } else { NavigatorDefaults.DefaultDecoration } - decoration.DecoratedContent(arg, backStackDepth, modifier, content) + decoration.DecoratedContent(args, backStackDepth, modifier, content) } } diff --git a/app/src/main/kotlin/io/sweers/catchup/ui/activity/MainActivity.kt b/app/src/main/kotlin/io/sweers/catchup/ui/activity/MainActivity.kt index fd3abc45c..b403a1b74 100644 --- a/app/src/main/kotlin/io/sweers/catchup/ui/activity/MainActivity.kt +++ b/app/src/main/kotlin/io/sweers/catchup/ui/activity/MainActivity.kt @@ -39,7 +39,6 @@ import com.slack.circuit.backstack.rememberSaveableBackStack import com.slack.circuit.foundation.Circuit import com.slack.circuit.foundation.CircuitCompositionLocals import com.slack.circuit.foundation.NavigableCircuitContent -import com.slack.circuit.foundation.push import com.slack.circuit.foundation.rememberCircuitNavigator import com.slack.circuit.overlay.ContentWithOverlays import com.slack.circuitx.android.rememberAndroidScreenAwareNavigator diff --git a/app/src/main/kotlin/io/sweers/catchup/ui/activity/OrderServicesScreen.kt b/app/src/main/kotlin/io/sweers/catchup/ui/activity/OrderServicesScreen.kt index 049d69fbc..b2da14067 100644 --- a/app/src/main/kotlin/io/sweers/catchup/ui/activity/OrderServicesScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/ui/activity/OrderServicesScreen.kt @@ -74,8 +74,8 @@ import com.slack.circuit.overlay.LocalOverlayHost import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject diff --git a/app/src/main/kotlin/io/sweers/catchup/ui/activity/SettingsScreen.kt b/app/src/main/kotlin/io/sweers/catchup/ui/activity/SettingsScreen.kt index 9111a6716..db5ea0230 100644 --- a/app/src/main/kotlin/io/sweers/catchup/ui/activity/SettingsScreen.kt +++ b/app/src/main/kotlin/io/sweers/catchup/ui/activity/SettingsScreen.kt @@ -46,8 +46,8 @@ import com.jakewharton.byteunits.BinaryByteUnit import com.slack.circuit.codegen.annotations.CircuitInject import com.slack.circuit.runtime.CircuitUiState import com.slack.circuit.runtime.Navigator -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import com.slack.circuit.runtime.ui.Ui import com.squareup.anvil.annotations.ContributesMultibinding import dagger.assisted.Assisted diff --git a/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkHandler.kt b/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkHandler.kt index afa0d6a41..9542e6854 100644 --- a/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkHandler.kt +++ b/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkHandler.kt @@ -2,7 +2,7 @@ package dev.zacsweers.catchup.deeplink import android.content.Intent import android.net.Uri -import com.slack.circuit.runtime.Screen +import com.slack.circuit.runtime.screen.Screen import com.squareup.anvil.annotations.ContributesBinding import dev.zacsweers.catchup.di.AppScope import dev.zacsweers.catchup.di.SingleIn diff --git a/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkable.kt b/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkable.kt index 902220a10..e87a443a4 100644 --- a/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkable.kt +++ b/libraries/deeplinking/src/main/kotlin/dev/zacsweers/catchup/deeplink/DeepLinkable.kt @@ -1,6 +1,6 @@ package dev.zacsweers.catchup.deeplink -import com.slack.circuit.runtime.Screen +import com.slack.circuit.runtime.screen.Screen import com.squareup.anvil.annotations.ContributesMultibinding import dagger.multibindings.StringKey import kotlinx.collections.immutable.ImmutableMap diff --git a/libraries/summarizer/src/main/kotlin/dev/zacsweers/catchup/summarizer/SummarizerScreen.kt b/libraries/summarizer/src/main/kotlin/dev/zacsweers/catchup/summarizer/SummarizerScreen.kt index c41fea718..dd826f61a 100644 --- a/libraries/summarizer/src/main/kotlin/dev/zacsweers/catchup/summarizer/SummarizerScreen.kt +++ b/libraries/summarizer/src/main/kotlin/dev/zacsweers/catchup/summarizer/SummarizerScreen.kt @@ -27,8 +27,8 @@ import androidx.compose.ui.unit.dp import com.google.accompanist.systemuicontroller.rememberSystemUiController import com.slack.circuit.codegen.annotations.CircuitInject import com.slack.circuit.runtime.CircuitUiState -import com.slack.circuit.runtime.Screen import com.slack.circuit.runtime.presenter.Presenter +import com.slack.circuit.runtime.screen.Screen import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject