From 32287007ffef2718d52413e27961b1691f8da902 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 4 Dec 2023 17:12:28 +0000 Subject: [PATCH 01/25] Rename android namespace com.bumble.appyx.demos.appyxnavigation.common -> com.bumble.appyx.navigation.demo --- demos/appyx-navigation/common/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/appyx-navigation/common/build.gradle.kts b/demos/appyx-navigation/common/build.gradle.kts index 0c958cdc9..d4624f33b 100644 --- a/demos/appyx-navigation/common/build.gradle.kts +++ b/demos/appyx-navigation/common/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } appyx { - androidNamespace.set("com.bumble.appyx.demos.appyxnavigation.common") + androidNamespace.set("com.bumble.appyx.navigation.demo") } kotlin { From 34ddc5d8ab6a3437cc1fa9288fea7963d9689876 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 4 Dec 2023 17:13:20 +0000 Subject: [PATCH 02/25] Update outdated naming reference --- .../appyx/interactions/core/model/BaseAppyxComponent.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt index bbe26a781..4edc7420e 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt @@ -139,7 +139,7 @@ open class BaseAppyxComponent( override fun onAddedToComposition(scope: CoroutineScope) { animationScope = scope - createAnimatedInputSource(scope) + createAnimatedProgressController(scope) createdDebugInputSource() } @@ -149,7 +149,7 @@ open class BaseAppyxComponent( animationScope?.cancel() } - private fun createAnimatedInputSource(scope: CoroutineScope) { + private fun createAnimatedProgressController(scope: CoroutineScope) { animated = AnimatedProgressController( model = model, coroutineScope = scope, From ac7e3b29f4a5be85d8b93c25273f73b96b1b9713 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 4 Dec 2023 17:23:00 +0000 Subject: [PATCH 03/25] Rename references of targetUiState.toMutableState to targetUiState.toMutableUiState --- .../components/spotlight/ui/fader/TargetUiState.kt | 2 +- .../experimental/cards/ui/CardsVisualisation.kt | 2 +- .../appyx/components/modal/ui/ModalVisualisation.kt | 2 +- .../appyx/components/modal/ui/TargetUiState.kt | 2 +- .../promoter/ui/PromoterVisualisation.kt | 2 +- .../puzzle15/ui/Puzzle15Visualisation.kt | 2 +- .../ui/rotation/TestDriveRotationVisualisation.kt | 2 +- .../ui/simple/TestDriveSimpleVisualisation.kt | 2 +- .../components/backstack/ui/fader/BackStackFader.kt | 2 +- .../backstack/ui/parallax/BackStackParallax.kt | 2 +- .../backstack/ui/slider/BackStackSlider.kt | 2 +- .../components/backstack/ui/stack3d/BackStack3D.kt | 2 +- .../components/spotlight/ui/fader/SpotlightFader.kt | 2 +- .../components/spotlight/ui/fader/TargetUiState.kt | 2 +- .../spotlight/ui/slider/SpotlightSlider.kt | 2 +- .../components/spotlight/ui/slider/TargetUiState.kt | 2 +- .../ui/sliderrotation/SpotlightSliderRotation.kt | 2 +- .../spotlight/ui/sliderrotation/TargetUiState.kt | 2 +- .../spotlight/ui/sliderscale/SpotlightSliderScale.kt | 2 +- .../spotlight/ui/sliderscale/TargetUiState.kt | 2 +- .../spotlight/ui/stack3d/SpotlightStack3D.kt | 2 +- .../components/spotlight/ui/stack3d/TargetUiState.kt | 2 +- .../benchmark/app/mosaic/MosaicVisualisation.kt | 2 +- .../appyx/benchmark/app/mosaic/MutableUiState.kt | 2 +- .../appyx/interactions/widgets/ui/TargetUiState.kt | 2 +- .../appyx/interactions/widgets/ui/WidgetsStack3D.kt | 2 +- .../default/SpotlightHeroDefaultVisualisation.kt | 2 +- .../visualisation/default/TargetUiState.kt | 2 +- .../dragprediction/DragPredictionVisualisation.kt | 2 +- .../incompletedrag/IncompleteDragVisualisation.kt | 2 +- .../appyx/demos/sample1/Sample1Visualisation.kt | 2 +- .../appyx/demos/sample2/Sample2Visualisation.kt | 2 +- .../appyx/demos/sample3/Sample3Visualisation.kt | 2 +- .../interactions/ksp/MutableUiStateProcessor.kt | 12 ++++++------ 34 files changed, 39 insertions(+), 39 deletions(-) diff --git a/appyx-components/composables/tabbednavigation/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt b/appyx-components/composables/tabbednavigation/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt index d23dd5103..ea916cd0b 100644 --- a/appyx-components/composables/tabbednavigation/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt +++ b/appyx-components/composables/tabbednavigation/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt @@ -12,7 +12,7 @@ class TargetUiState( alpha = base.alpha, ) - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, ): MutableUiState = MutableUiState( diff --git a/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt b/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt index 41b2971c3..9fa507f42 100644 --- a/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt +++ b/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt @@ -98,7 +98,7 @@ class CardsVisualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( diff --git a/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt b/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt index b8aa331bd..4ba0587ac 100644 --- a/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt +++ b/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt @@ -65,7 +65,7 @@ class ModalVisualisation( override fun mutableUiStateFor( uiContext: UiContext, targetUiState: TargetUiState - ): MutableUiState = targetUiState.toMutableState(uiContext) + ): MutableUiState = targetUiState.toMutableUiState(uiContext) class Gestures( transitionBounds: TransitionBounds, diff --git a/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/TargetUiState.kt b/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/TargetUiState.kt index 8eb48df61..d24137bf8 100644 --- a/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/TargetUiState.kt +++ b/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/TargetUiState.kt @@ -13,7 +13,7 @@ class TargetUiState( val corner: RoundedCorners.Target, ) { - fun toMutableState( + fun toMutableUiState( uiContext: UiContext ): MutableUiState = MutableUiState( diff --git a/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt b/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt index a57f582df..24ff5d434 100644 --- a/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt +++ b/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt @@ -52,7 +52,7 @@ class PromoterVisualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) override fun updateBounds(transitionBounds: TransitionBounds) { super.updateBounds(transitionBounds) diff --git a/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt b/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt index 5db9d1fdd..7ce7ed7c1 100644 --- a/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt +++ b/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt @@ -50,7 +50,7 @@ class Puzzle15Visualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( bounds: TransitionBounds, diff --git a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt index bda5c9c86..ad8010992 100644 --- a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt +++ b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt @@ -74,6 +74,6 @@ class TestDriveRotationVisualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) } diff --git a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt index 3d619438a..96a24f5a4 100644 --- a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt +++ b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt @@ -81,7 +81,7 @@ class TestDriveSimpleVisualisation( } override fun mutableUiStateFor(uiContext: UiContext, targetUiState: TargetUiState): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( private val transitionBounds: TransitionBounds diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt index a0f751c48..56329a46a 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt @@ -32,5 +32,5 @@ class BackStackFader( } override fun mutableUiStateFor(uiContext: UiContext, targetUiState: TargetUiState): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) } diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt index cbb5e3a36..7ab0aa36e 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt @@ -76,7 +76,7 @@ class BackStackParallax( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( private val transitionBounds: TransitionBounds, diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt index 1c8d139f9..d0952a1b4 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt @@ -47,5 +47,5 @@ class BackStackSlider( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) } diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt index 87022f52d..3ea0d9f6e 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt @@ -80,7 +80,7 @@ class BackStack3D( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( transitionBounds: TransitionBounds, diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt index 3de5a14cc..3c28f4d3e 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt @@ -53,6 +53,6 @@ class SpotlightFader( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) } diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt index 938d9e1cd..e09c25039 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.kt @@ -12,7 +12,7 @@ class TargetUiState( alpha = base.alpha, ) - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, ): MutableUiState = MutableUiState( diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt index 5109c0e6b..bc261fadb 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt @@ -84,7 +84,7 @@ class SpotlightSlider( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext, scrollX.renderValueFlow) + targetUiState.toMutableUiState(uiContext, scrollX.renderValueFlow) class Gestures( diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/TargetUiState.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/TargetUiState.kt index dce849fb6..76453b69c 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/TargetUiState.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/TargetUiState.kt @@ -45,7 +45,7 @@ class TargetUiState( * * TODO support RTL and Orientation.Vertical */ - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, scrollX: StateFlow ): MutableUiState = diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt index a0347fdf9..3e45368dd 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt @@ -78,6 +78,6 @@ class SpotlightSliderRotation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext, scrollX.renderValueFlow) + targetUiState.toMutableUiState(uiContext, scrollX.renderValueFlow) } diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/TargetUiState.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/TargetUiState.kt index e9d359530..9c8a2bf37 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/TargetUiState.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/TargetUiState.kt @@ -48,7 +48,7 @@ class TargetUiState( * * TODO support RTL and Orientation.Vertical */ - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, scrollX: StateFlow ): MutableUiState { diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt index 0e4ddd87a..7d1e2e656 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt @@ -68,6 +68,6 @@ class SpotlightSliderScale( } override fun mutableUiStateFor(uiContext: UiContext, targetUiState: TargetUiState): MutableUiState = - targetUiState.toMutableState(uiContext, scrollX.renderValueFlow) + targetUiState.toMutableUiState(uiContext, scrollX.renderValueFlow) } diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/TargetUiState.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/TargetUiState.kt index fdcee33bc..4c044e4e1 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/TargetUiState.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/TargetUiState.kt @@ -40,7 +40,7 @@ class TargetUiState( * * TODO support RTL and Orientation.Vertical */ - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, scrollX: StateFlow ): MutableUiState = MutableUiState( diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt index fa7f648b4..8af1eab15 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt @@ -93,7 +93,7 @@ class SpotlightStack3D( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState( + targetUiState.toMutableUiState( uiContext = uiContext, scrollX = scrollY.renderValueFlow.mapState(uiContext.coroutineScope) { it - targetUiState.positionInList }, itemHeight = height, diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/TargetUiState.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/TargetUiState.kt index 7e5b6f145..9b6be3a6c 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/TargetUiState.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/TargetUiState.kt @@ -37,7 +37,7 @@ class TargetUiState( zIndex = base.zIndex, ) - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, scrollX: StateFlow, itemHeight: Dp, diff --git a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt index d43af0406..c62984ca7 100644 --- a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt +++ b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt @@ -37,7 +37,7 @@ class MosaicVisualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) override fun State.toUiTargets(): List> = pieces.mapIndexed { idx, piece -> diff --git a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MutableUiState.kt b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MutableUiState.kt index 05b8d7cc2..abe0812c6 100644 --- a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MutableUiState.kt +++ b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MutableUiState.kt @@ -112,7 +112,7 @@ class MutableUiState( } } -fun TargetUiState.toMutableState(uiContext: UiContext): MutableUiState = MutableUiState( +fun TargetUiState.toMutableUiState(uiContext: UiContext): MutableUiState = MutableUiState( uiContext = uiContext, position = PositionAlignment(uiContext.coroutineScope, position), positionOffset = PositionOffset(uiContext.coroutineScope, positionOffset), diff --git a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/TargetUiState.kt b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/TargetUiState.kt index 17ee04a99..9d262827a 100644 --- a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/TargetUiState.kt +++ b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/TargetUiState.kt @@ -37,7 +37,7 @@ class TargetUiState( zIndex = base.zIndex, ) - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, scrollX: StateFlow, itemWidth: Dp, diff --git a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt index 113322892..d0c765885 100644 --- a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt +++ b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt @@ -44,7 +44,7 @@ class WidgetsStack3D( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState( + targetUiState.toMutableUiState( uiContext = uiContext, scrollX = scrollY.renderValueFlow.mapState(uiContext.coroutineScope) { it - targetUiState.positionInList }, itemWidth = transitionBounds.widthDp, diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt index 599dd2bb6..907fa0332 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt @@ -112,6 +112,6 @@ class SpotlightHeroDefaultVisualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext, scrollX.renderValueFlow) + targetUiState.toMutableUiState(uiContext, scrollX.renderValueFlow) } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/TargetUiState.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/TargetUiState.kt index 4d3d89a3d..f13f6527a 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/TargetUiState.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/TargetUiState.kt @@ -67,7 +67,7 @@ class TargetUiState( * * TODO support RTL and Orientation.Vertical */ - fun toMutableState( + fun toMutableUiState( uiContext: UiContext, scrollX: StateFlow ): MutableUiState { diff --git a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt index 6c7cf693b..646e8445b 100644 --- a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt +++ b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt @@ -87,7 +87,7 @@ class DragPredictionVisualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) @Suppress("UnusedPrivateMember") diff --git a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt index d2749c5a2..cc409efa8 100644 --- a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt +++ b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt @@ -96,7 +96,7 @@ class IncompleteDragVisualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( diff --git a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt index 7dd0e02b8..15b974115 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt @@ -91,7 +91,7 @@ class Sample1Visualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( private val transitionBounds: TransitionBounds, diff --git a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt index dbff301f8..222dada60 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt @@ -96,7 +96,7 @@ class Sample2Visualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( diff --git a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt index e7f0895aa..2e8d6bd45 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt @@ -91,7 +91,7 @@ class Sample3Visualisation( uiContext: UiContext, targetUiState: TargetUiState ): MutableUiState = - targetUiState.toMutableState(uiContext) + targetUiState.toMutableUiState(uiContext) class Gestures( private val transitionBounds: TransitionBounds, diff --git a/ksp/mutable-ui-processor/src/commonMain/kotlin/com/bumble/appyx/interactions/ksp/MutableUiStateProcessor.kt b/ksp/mutable-ui-processor/src/commonMain/kotlin/com/bumble/appyx/interactions/ksp/MutableUiStateProcessor.kt index 002e264eb..0d3cdcf87 100644 --- a/ksp/mutable-ui-processor/src/commonMain/kotlin/com/bumble/appyx/interactions/ksp/MutableUiStateProcessor.kt +++ b/ksp/mutable-ui-processor/src/commonMain/kotlin/com/bumble/appyx/interactions/ksp/MutableUiStateProcessor.kt @@ -104,7 +104,7 @@ class MutableUiStateProcessor( .addImport(IMPORT_COROUTINES, IMPORT_ASYNC, IMPORT_AWAIT_ALL, IMPORT_LAUNCH) .addImport(IMPORT_COMPOSE_ANIMATION_CORE, IMPORT_SPRING_SPEC, IMPORT_SPRING) .addType(generateMutableUiStateType(classTypeName, animationMode, params)) - .addFunction(generateToMutableStateFunction(classDeclaration, classTypeName, params)) + .addFunction(generateToMutableUiStateFunction(classDeclaration, classTypeName, params)) .build() private fun Resolver.generateMutableUiStateType( @@ -258,15 +258,15 @@ class MutableUiStateProcessor( build() } - private fun Resolver.generateToMutableStateFunction(classDeclaration: KSClassDeclaration, classTypeName: TypeName, params: List) = - FunSpec.builder(FUNCTION_TO_MUTABLE_STATE) + private fun Resolver.generateToMutableUiStateFunction(classDeclaration: KSClassDeclaration, classTypeName: TypeName, params: List) = + FunSpec.builder(FUNCTION_TO_MUTABLE_UI_STATE) .receiver(classTypeName) .returns(ClassName(classDeclaration.packageName.asString(), MUTABLE_UI_STATE)) .addParameter(PARAM_UI_CONTEXT, getTypeName(UiContext::class)) - .addCode(generateToMutableStateCode(params)) + .addCode(generateToMutableUiStateCode(params)) .build() - private fun generateToMutableStateCode(params: List) = + private fun generateToMutableUiStateCode(params: List) = with(CodeBlock.builder()) { add("return $MUTABLE_UI_STATE(\n") indent() @@ -312,7 +312,7 @@ class MutableUiStateProcessor( const val FUNCTION_ANIMATE_TO = "animateTo" const val FUNCTION_SNAP_TO = "snapTo" const val FUNCTION_LERP_TO = "lerpTo" - const val FUNCTION_TO_MUTABLE_STATE = "toMutableState" + const val FUNCTION_TO_MUTABLE_UI_STATE = "toMutableUiState" } } From ef3c12517bf46cf2d71846e05cd5900f64929ffc Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 4 Dec 2023 17:47:26 +0000 Subject: [PATCH 04/25] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d8752e27..a9a3da1b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [#630](https://github.com/bumble-tech/appyx/pull/630) – Pass initial state into Spotlights visualisations - [#643](https://github.com/bumble-tech/appyx/pull/643) – Unify AppyxComponent composable between appyx-navigation and appyx-interactions modules +- Rename KSP generated method: targetUiState.toMutableState -> toMutableUiState ### Fixed From 6debad22bfd2418f51825935a08f063cbf65d5b4 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 4 Dec 2023 17:53:53 +0000 Subject: [PATCH 05/25] Swap order of TargetUiState, MutableUiState in generics --- .../components/experimental/cards/ui/CardsVisualisation.kt | 2 +- .../com/bumble/appyx/components/modal/ui/ModalVisualisation.kt | 2 +- .../experimental/promoter/ui/PromoterVisualisation.kt | 2 +- .../experimental/puzzle15/ui/Puzzle15Visualisation.kt | 2 +- .../testdrive/ui/rotation/TestDriveRotationVisualisation.kt | 2 +- .../testdrive/ui/simple/TestDriveSimpleVisualisation.kt | 2 +- .../appyx/components/backstack/ui/fader/BackStackFader.kt | 2 +- .../appyx/components/backstack/ui/parallax/BackStackParallax.kt | 2 +- .../appyx/components/backstack/ui/slider/BackStackSlider.kt | 2 +- .../bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt | 2 +- .../appyx/components/spotlight/ui/fader/SpotlightFader.kt | 2 +- .../appyx/components/spotlight/ui/slider/SpotlightSlider.kt | 2 +- .../spotlight/ui/sliderrotation/SpotlightSliderRotation.kt | 2 +- .../components/spotlight/ui/sliderscale/SpotlightSliderScale.kt | 2 +- .../appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt | 2 +- .../com/bumble/appyx/transitionmodel/BaseVisualisation.kt | 2 +- .../bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt | 2 +- .../com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt | 2 +- .../visualisation/default/SpotlightHeroDefaultVisualisation.kt | 2 +- .../appyx/demos/dragprediction/DragPredictionVisualisation.kt | 2 +- .../appyx/demos/incompletedrag/IncompleteDragVisualisation.kt | 2 +- .../com/bumble/appyx/demos/sample1/Sample1Visualisation.kt | 2 +- .../com/bumble/appyx/demos/sample2/Sample2Visualisation.kt | 2 +- .../com/bumble/appyx/demos/sample3/Sample3Visualisation.kt | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt b/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt index 9fa507f42..5ef4f4ee9 100644 --- a/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt +++ b/appyx-components/experimental/cards/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/cards/ui/CardsVisualisation.kt @@ -27,7 +27,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class CardsVisualisation( uiContext: UiContext, defaultAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = defaultAnimationSpec, ) { diff --git a/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt b/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt index 4ba0587ac..62e67e0bd 100644 --- a/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt +++ b/appyx-components/experimental/modal/common/src/commonMain/kotlin/com/bumble/appyx/components/modal/ui/ModalVisualisation.kt @@ -23,7 +23,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation @Suppress("MagicNumber") class ModalVisualisation( uiContext: UiContext, -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext ) { diff --git a/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt b/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt index 24ff5d434..73569f73d 100644 --- a/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt +++ b/appyx-components/experimental/promoter/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/promoter/ui/PromoterVisualisation.kt @@ -24,7 +24,7 @@ import kotlin.math.min class PromoterVisualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { diff --git a/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt b/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt index 7ce7ed7c1..26d369359 100644 --- a/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt +++ b/appyx-components/experimental/puzzle15/common/src/commonMain/kotlin/com/bumble/appyx/components/experimental/puzzle15/ui/Puzzle15Visualisation.kt @@ -22,7 +22,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class Puzzle15Visualisation( uiContext: UiContext, defaultAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation( +) : BaseVisualisation( uiContext = uiContext, defaultAnimationSpec = defaultAnimationSpec ) { diff --git a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt index ad8010992..6ebe91405 100644 --- a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt +++ b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/rotation/TestDriveRotationVisualisation.kt @@ -23,7 +23,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class TestDriveRotationVisualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { diff --git a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt index 96a24f5a4..9925988f3 100644 --- a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt +++ b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/ui/simple/TestDriveSimpleVisualisation.kt @@ -37,7 +37,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class TestDriveSimpleVisualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt index 56329a46a..875e6f4cc 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/fader/BackStackFader.kt @@ -11,7 +11,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class BackStackFader( uiContext: UiContext, defaultAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = defaultAnimationSpec, ) { diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt index 7ab0aa36e..4e99bf880 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/parallax/BackStackParallax.kt @@ -23,7 +23,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class BackStackParallax( uiContext: UiContext, defaultAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = defaultAnimationSpec, ) { diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt index d0952a1b4..07e8c779a 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/slider/BackStackSlider.kt @@ -10,7 +10,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class BackStackSlider( uiContext: UiContext, -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, ) { diff --git a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt index 3ea0d9f6e..3cee6c182 100644 --- a/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt +++ b/appyx-components/stable/backstack/common/src/commonMain/kotlin/com/bumble/appyx/components/backstack/ui/stack3d/BackStack3D.kt @@ -28,7 +28,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class BackStack3D( uiContext: UiContext, private val itemsInStack: Int = 3, -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, ) { diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt index 3c28f4d3e..be342ced1 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/SpotlightFader.kt @@ -15,7 +15,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class SpotlightFader( uiContext: UiContext, defaultAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = defaultAnimationSpec ) { diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt index bc261fadb..b1e3261fc 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/slider/SpotlightSlider.kt @@ -32,7 +32,7 @@ class SpotlightSlider( initialState: State, @Suppress("UnusedPrivateMember") private val orientation: Orientation = Orientation.Horizontal, // TODO support RTL -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext ) { private val scrollX = GenericFloatProperty( diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt index 3e45368dd..7128ad8e9 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderrotation/SpotlightSliderRotation.kt @@ -23,7 +23,7 @@ class SpotlightSliderRotation( initialState: State, @Suppress("UnusedPrivateMember") private val orientation: Orientation = Orientation.Horizontal, // TODO support RTL -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext ) { private val scrollX = GenericFloatProperty( diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt index 7d1e2e656..7c2482eae 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/sliderscale/SpotlightSliderScale.kt @@ -21,7 +21,7 @@ class SpotlightSliderScale( initialState: State, @Suppress("UnusedPrivateMember") private val orientation: Orientation = Orientation.Horizontal, // TODO support RTL -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext ) { @Suppress("MaxLineLength") diff --git a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt index 8af1eab15..453704d06 100644 --- a/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt +++ b/appyx-components/stable/spotlight/common/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/stack3d/SpotlightStack3D.kt @@ -26,7 +26,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class SpotlightStack3D( uiContext: UiContext, initialState: State, -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, ) { private var width: Dp = 0.dp diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/transitionmodel/BaseVisualisation.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/transitionmodel/BaseVisualisation.kt index 338425cfd..8883f82fd 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/transitionmodel/BaseVisualisation.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/transitionmodel/BaseVisualisation.kt @@ -31,7 +31,7 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch @Suppress("TooManyFunctions") -abstract class BaseVisualisation( +abstract class BaseVisualisation( private val uiContext: UiContext, protected val defaultAnimationSpec: SpringSpec = DefaultAnimationSpec, ) : Visualisation where MutableUiState : BaseMutableUiState { diff --git a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt index c62984ca7..12c7f162b 100644 --- a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt +++ b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/mosaic/MosaicVisualisation.kt @@ -29,7 +29,7 @@ import kotlin.random.Random class MosaicVisualisation( uiContext: UiContext, defaultAnimationSpec: SpringSpec -) : BaseVisualisation( +) : BaseVisualisation( uiContext = uiContext, defaultAnimationSpec = defaultAnimationSpec ) { diff --git a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt index d0c765885..aa5cb877d 100644 --- a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt +++ b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/ui/WidgetsStack3D.kt @@ -15,7 +15,7 @@ import com.bumble.appyx.transitionmodel.BaseVisualisation class WidgetsStack3D( uiContext: UiContext, -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, ) { private val scrollY = GenericFloatProperty(uiContext.coroutineScope, GenericFloatProperty.Target(0f)) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt index 907fa0332..ae168a063 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt @@ -25,7 +25,7 @@ class SpotlightHeroDefaultVisualisation( uiContext: UiContext, initialState: State ) : SpotlightHeroVisualisation, - BaseVisualisation, MutableUiState, TargetUiState>( + BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext ) { private val scrollX = GenericFloatProperty( diff --git a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt index 646e8445b..5adbe2577 100644 --- a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt +++ b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPredictionVisualisation.kt @@ -35,7 +35,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class DragPredictionVisualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { diff --git a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt index cc409efa8..2fa70ecb2 100644 --- a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt +++ b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDragVisualisation.kt @@ -40,7 +40,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class IncompleteDragVisualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { diff --git a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt index 15b974115..bffca138e 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1Visualisation.kt @@ -39,7 +39,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class Sample1Visualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { diff --git a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt index 222dada60..b5fe65ae3 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2Visualisation.kt @@ -40,7 +40,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class Sample2Visualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { diff --git a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt index 2e8d6bd45..14c177296 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3Visualisation.kt @@ -39,7 +39,7 @@ import com.bumble.appyx.utils.multiplatform.AppyxLogger class Sample3Visualisation( uiContext: UiContext, uiAnimationSpec: SpringSpec = DefaultAnimationSpec -) : BaseVisualisation, MutableUiState, TargetUiState>( +) : BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext, defaultAnimationSpec = uiAnimationSpec, ) { From e73fcbcb1634afb0a775aa727d676a8d0b629308 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 4 Dec 2023 17:54:15 +0000 Subject: [PATCH 06/25] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a3da1b6..cd5630699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [#630](https://github.com/bumble-tech/appyx/pull/630) – Pass initial state into Spotlights visualisations - [#643](https://github.com/bumble-tech/appyx/pull/643) – Unify AppyxComponent composable between appyx-navigation and appyx-interactions modules - Rename KSP generated method: targetUiState.toMutableState -> toMutableUiState +- Swap order of TargetUiState, MutableUiState in generics ### Fixed From 37f4bb8a9e3e985020f88934add72b61abca5fe7 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 8 Jan 2024 16:38:48 +0000 Subject: [PATCH 07/25] Update CHANGELOG.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd5630699..61e1851fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ - [#630](https://github.com/bumble-tech/appyx/pull/630) – Pass initial state into Spotlights visualisations - [#643](https://github.com/bumble-tech/appyx/pull/643) – Unify AppyxComponent composable between appyx-navigation and appyx-interactions modules -- Rename KSP generated method: targetUiState.toMutableState -> toMutableUiState -- Swap order of TargetUiState, MutableUiState in generics +- [#642](https://github.com/bumble-tech/appyx/pull/642) – Renamings + - Rename KSP generated method: `targetUiState.toMutableState()` -> `.toMutableUiState()` + - Swap order of `TargetUiState`, `MutableUiState` in generics ### Fixed From d789e9f8a11c69a840fd5ea26d30601f7d601fb5 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 8 Jan 2024 16:45:53 +0000 Subject: [PATCH 08/25] Rename interactions/AppyxComponent -> AppyxInteractionsComponent --- .../components/experimental/cards/android/DatingCards.kt | 4 ++-- .../experimental/promoter/android/PromoterExperiment.kt | 4 ++-- .../components/internal/testdrive/TestDriveExperiment.kt | 4 ++-- .../core/{AppyxComponent.kt => AppyxInteractionsComponent.kt} | 2 +- .../com/bumble/appyx/navigation/composable/AppyxComponent.kt | 3 ++- .../com/bumble/appyx/interactions/sample/ModalExperiment.kt | 4 ++-- .../kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt | 4 ++-- .../appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt | 4 ++-- .../kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt | 4 ++-- .../com/bumble/appyx/demos/dragprediction/DragPrediction.kt | 4 ++-- .../com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt | 4 ++-- .../jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt | 4 ++-- .../jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt | 4 ++-- .../jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt | 4 ++-- 14 files changed, 27 insertions(+), 26 deletions(-) rename appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/{AppyxComponent.kt => AppyxInteractionsComponent.kt} (99%) diff --git a/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt b/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt index 5872fba4b..b608bf804 100644 --- a/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt +++ b/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.unit.dp import com.bumble.appyx.components.experimental.cards.Cards import com.bumble.appyx.components.experimental.cards.CardsModel import com.bumble.appyx.components.experimental.cards.ui.CardsVisualisation -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.gesture.GestureValidator.Companion.permissiveValidator import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.theme.appyx_dark @@ -38,7 +38,7 @@ fun DatingCards(modifier: Modifier = Modifier) { AppyxComponentSetup(cards) - AppyxComponent( + AppyxInteractionsComponent( modifier = modifier .fillMaxSize() .background(appyx_dark) diff --git a/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt b/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt index 0604fac04..03630d04f 100644 --- a/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt +++ b/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt @@ -25,7 +25,7 @@ import com.bumble.appyx.components.experimental.promoter.Promoter import com.bumble.appyx.components.experimental.promoter.PromoterModel import com.bumble.appyx.components.experimental.promoter.operation.addFirst import com.bumble.appyx.components.experimental.promoter.ui.PromoterVisualisation -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -74,7 +74,7 @@ fun PromoterExperiment(modifier: Modifier = Modifier) { val screenWidthPx = (LocalConfiguration.current.screenWidthDp * density.density).roundToInt() val screenHeightPx = (LocalConfiguration.current.screenHeightDp * density.density).roundToInt() - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = promoter, modifier = Modifier .weight(0.9f) diff --git a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt index b70c4c139..ba54cc5ea 100644 --- a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt +++ b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt @@ -29,7 +29,7 @@ import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.components.internal.testdrive.ui.rotation.TestDriveRotationVisualisation import com.bumble.appyx.components.internal.testdrive.ui.rotation.TestDriveRotationVisualisation.Companion.toTargetUiState import com.bumble.appyx.components.internal.testdrive.ui.simple.TestDriveSimpleVisualisation -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.gesture.GestureValidator import com.bumble.appyx.interactions.core.gesture.GestureValidator.Companion.defaultValidator import com.bumble.appyx.interactions.core.model.transition.Keyframes @@ -134,7 +134,7 @@ fun TestDriveUi( vertical = 12.dp ) ) { - AppyxComponent( + AppyxInteractionsComponent( screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, appyxComponent = testDrive, diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsComponent.kt similarity index 99% rename from appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxComponent.kt rename to appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsComponent.kt index 51c1fc66d..92951c8ed 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsComponent.kt @@ -50,7 +50,7 @@ private val defaultExtraTouch = 48f.dp @Suppress("LongMethod") @Composable -fun AppyxComponent( +fun AppyxInteractionsComponent( appyxComponent: BaseAppyxComponent, screenWidthPx: Int, screenHeightPx: Int, diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxComponent.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxComponent.kt index eb08e4d3a..5eb506392 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxComponent.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxComponent.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.gesture.GestureValidator import com.bumble.appyx.interactions.core.model.BaseAppyxComponent import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -31,7 +32,7 @@ fun ParentNode.Ap val screenWidthPx = (LocalScreenSize.current.widthDp * density.density).value.roundToInt() val screenHeightPx = (LocalScreenSize.current.heightDp * density.density).value.roundToInt() - com.bumble.appyx.interactions.core.AppyxComponent( + AppyxInteractionsComponent( appyxComponent, screenWidthPx, screenHeightPx, diff --git a/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt b/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt index a9e64dded..3c0b87301 100644 --- a/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt +++ b/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt @@ -20,7 +20,7 @@ import com.bumble.appyx.components.modal.ModalModel import com.bumble.appyx.components.modal.operation.add import com.bumble.appyx.components.modal.operation.show import com.bumble.appyx.components.modal.ui.ModalVisualisation -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.ui.context.UiContext import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -84,7 +84,7 @@ fun ModalUi( modifier: Modifier = Modifier, color: Color = Color.Unspecified ) { - AppyxComponent( + AppyxInteractionsComponent( screenWidthPx = (LocalConfiguration.current.screenWidthDp * LocalDensity.current.density).roundToInt(), screenHeightPx = (LocalConfiguration.current.screenHeightDp * LocalDensity.current.density).roundToInt(), clipToBounds = false, diff --git a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt index 1276eb800..0fc7d2734 100644 --- a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt +++ b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt @@ -19,7 +19,7 @@ import com.bumble.appyx.components.spotlight.operation.next import com.bumble.appyx.components.spotlight.operation.previous import com.bumble.appyx.components.spotlight.ui.slider.SpotlightSlider import com.bumble.appyx.interactions.Events -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -94,7 +94,7 @@ private fun WidgetsUi( screenHeightPx: Int, modifier: Modifier = Modifier, ) { - AppyxComponent( + AppyxInteractionsComponent( clipToBounds = false, appyxComponent = spotlight, modifier = modifier diff --git a/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt b/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt index 01a32637f..df791af83 100644 --- a/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt +++ b/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.BaseAppyxComponent import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -56,7 +56,7 @@ internal fun AppyxSample( modifier = modifier, horizontalAlignment = CenterHorizontally, ) { - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = appyxComponent, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt b/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt index de9eeb0f4..f64a40c58 100644 --- a/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt +++ b/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt @@ -25,7 +25,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.bumble.appyx.demos.common.InteractionTarget.Element -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.BaseAppyxComponent import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -85,7 +85,7 @@ fun AppyxWebSample( } ) ) { - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = appyxComponent, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt index 128e5d703..42df136d7 100644 --- a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt +++ b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt @@ -45,7 +45,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.demos.dragprediction.DragPredictionVisualisation.Companion.toTargetUiState import com.bumble.appyx.demos.dragprediction.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.transition.Keyframes import com.bumble.appyx.interactions.core.model.transition.Update import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig @@ -191,7 +191,7 @@ fun ModelUi( model: TestDriveModel, modifier: Modifier = Modifier.fillMaxSize() ) { - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt index b781b8fb4..fef9e829d 100644 --- a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt +++ b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.incompletedrag.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -141,7 +141,7 @@ fun ModelUi( } ) - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt index 9120adcb7..8792056c8 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.sample1.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -139,7 +139,7 @@ fun ModelUi( } ) - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt index 192d88768..8ed3ad3e4 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.sample2.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -139,7 +139,7 @@ fun ModelUi( } ) - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt index a5c19ab59..df61b43f6 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt @@ -45,7 +45,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.sample3.InteractionTarget.Child1 import com.bumble.appyx.demos.sample3.Sample3Visualisation.Companion.toTargetUiState -import com.bumble.appyx.interactions.core.AppyxComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsComponent import com.bumble.appyx.interactions.core.model.transition.Keyframes import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME @@ -195,7 +195,7 @@ fun ModelUi( model: TestDriveModel, modifier: Modifier = Modifier.fillMaxSize() ) { - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, From 037440ffa43b66abb3df155e343679472ec06f40 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 8 Jan 2024 16:58:54 +0000 Subject: [PATCH 09/25] Rename navigation/AppyxComponent -> AppyxNavigationComponent --- .../{AppyxComponent.kt => AppyxNavigationComponent.kt} | 2 +- .../kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt | 4 ++-- .../com/bumble/appyx/navigation/node/cakes/CakeListNode.kt | 4 ++-- .../com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt | 4 ++-- .../bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt | 4 ++-- .../com/bumble/appyx/navigation/node/profile/ProfileNode.kt | 4 ++-- .../kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt | 4 ++-- .../navigtion/compose/ComposeNavigationContainerNode.kt | 4 ++-- .../appyx/navigation/node/datingcards/DatingCardsNode.kt | 4 ++-- .../appyx/navigation/node/backstack/BackStackExamplesNode.kt | 4 ++-- .../bumble/appyx/navigation/node/backstack/BackStackNode.kt | 4 ++-- .../navigation/node/backstack/debug/BackstackDebugNode.kt | 4 ++-- .../bumble/appyx/navigation/node/container/ContainerNode.kt | 4 ++-- .../bumble/appyx/navigation/node/modal/ModalExamplesNode.kt | 4 ++-- .../com/bumble/appyx/navigation/node/promoter/PromoterNode.kt | 4 ++-- .../bumble/appyx/navigation/node/spotlight/SpotlightNode.kt | 4 ++-- .../node/spotlight/SpotlightObserveTransitionsExampleNode.kt | 4 ++-- .../navigation/node/spotlight/debug/SpotlightDebugNode.kt | 4 ++-- .../com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt | 4 ++-- 19 files changed, 37 insertions(+), 37 deletions(-) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/{AppyxComponent.kt => AppyxNavigationComponent.kt} (97%) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxComponent.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt similarity index 97% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxComponent.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt index 5eb506392..5a00c8b7d 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxComponent.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt @@ -17,7 +17,7 @@ import kotlin.math.roundToInt internal val defaultExtraTouch = 48.dp @Composable -fun ParentNode.AppyxComponent( +fun ParentNode.AppyxNavigationComponent( appyxComponent: BaseAppyxComponent, modifier: Modifier = Modifier, clipToBounds: Boolean = false, diff --git a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt index 0031b43c6..f9814b386 100644 --- a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt +++ b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt @@ -35,7 +35,7 @@ import com.bumble.appyx.benchmark.app.mosaic.operation.flip import com.bumble.appyx.benchmark.app.mosaic.operation.scatter import com.bumble.appyx.benchmark.app.ui.FlashCard import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -104,7 +104,7 @@ class MosaicNode( .background(Color.Black) .padding(24.dp), ) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = mosaic, modifier = Modifier .align(Alignment.Center) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt index 27fa2bc53..a6b379f11 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import com.bumble.appyx.interactions.core.ui.math.lerpFloat -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -98,7 +98,7 @@ class CakeListNode( Box( modifier = modifier.fillMaxSize() ) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = spotlight, modifier = Modifier .align(Alignment.Center) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt index 114781ab8..df94d7253 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt @@ -9,7 +9,7 @@ import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.ui.parallax.BackStackParallax import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.interactions.core.ui.gesture.GestureFactory -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -90,7 +90,7 @@ class CheckoutNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt index c596e9ba6..d5c64f43e 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt @@ -24,7 +24,7 @@ import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.ui.parallax.BackStackParallax import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.interactions.core.ui.gesture.GestureFactory -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -84,7 +84,7 @@ class LoggedOutNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt index 28075561f..552799d21 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt @@ -15,7 +15,7 @@ import androidx.compose.ui.unit.dp import com.bumble.appyx.components.backstack.BackStack import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -71,7 +71,7 @@ class ProfileNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt index 4b0134fca..b82ef2328 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt @@ -7,7 +7,7 @@ import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.operation.replace import com.bumble.appyx.components.backstack.ui.fader.BackStackFader import com.bumble.appyx.interactions.core.plugin.Plugin -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -69,7 +69,7 @@ class RootNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt index 6d1d251a0..7aac34a2a 100644 --- a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt +++ b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.Modifier import com.bumble.appyx.components.backstack.BackStack import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -55,7 +55,7 @@ internal class ComposeNavigationContainerNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( modifier = modifier.fillMaxWidth(), appyxComponent = backStack ) diff --git a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt index 1959f9b91..d5f3882e3 100644 --- a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt +++ b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.unit.dp import com.bumble.appyx.components.experimental.cards.Cards import com.bumble.appyx.components.experimental.cards.CardsModel import com.bumble.appyx.components.experimental.cards.ui.CardsVisualisation -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -49,7 +49,7 @@ class DatingCardsNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( modifier = modifier .fillMaxSize() .background(appyx_dark) diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt index a583908c7..aa447317c 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt @@ -21,7 +21,7 @@ import com.bumble.appyx.components.backstack.ui.parallax.BackStackParallax import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.components.backstack.ui.stack3d.BackStack3D import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -129,7 +129,7 @@ class BackStackExamplesNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = Modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt index d360e4433..c2c79be89 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt @@ -33,7 +33,7 @@ import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.gestureModifier import com.bumble.appyx.navigation.ColorSaver import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -108,7 +108,7 @@ class BackStackNode( .fillMaxWidth() .background(appyx_dark) ) { - AppyxComponent( + AppyxNavigationComponent( clipToBounds = true, appyxComponent = backStack, modifier = Modifier diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt index 6e72359a8..93581247c 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt @@ -25,7 +25,7 @@ import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.operation.replace import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.composable.KnobControl import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node @@ -99,7 +99,7 @@ class BackstackDebugNode( KnobControl(onValueChange = { backStack.setNormalisedProgress(it) }) - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = Modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt index 90566f18f..431b44c92 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt @@ -15,7 +15,7 @@ import com.bumble.appyx.components.backstack.BackStack import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -140,7 +140,7 @@ class ContainerNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt index 8170d6d11..68c5cc188 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt @@ -23,7 +23,7 @@ import com.bumble.appyx.components.modal.operation.revert import com.bumble.appyx.components.modal.operation.show import com.bumble.appyx.components.modal.ui.ModalVisualisation import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -82,7 +82,7 @@ class ModalExamplesNode( .background(appyx_dark), verticalArrangement = Arrangement.Bottom ) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = modal, modifier = Modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt index acdcbbfe2..2678938f4 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt @@ -33,7 +33,7 @@ import com.bumble.appyx.components.experimental.promoter.ui.PromoterVisualisatio import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -103,7 +103,7 @@ class PromoterNode( modifier = modifier .fillMaxSize() ) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = promoter, modifier = Modifier .weight(0.9f) diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt index 11d6ae290..5c3b84972 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt @@ -34,7 +34,7 @@ import com.bumble.appyx.components.spotlight.operation.previous import com.bumble.appyx.components.spotlight.operation.updateElements import com.bumble.appyx.components.spotlight.ui.slider.SpotlightSlider import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -100,7 +100,7 @@ class SpotlightNode( .fillMaxSize() .background(appyx_dark) ) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = spotlight, modifier = Modifier .padding( diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt index d8862e710..4968d1ce9 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt @@ -33,7 +33,7 @@ import com.bumble.appyx.interactions.core.ui.property.impl.RotationY import com.bumble.appyx.interactions.core.ui.property.impl.position.PositionAlignment import com.bumble.appyx.interactions.core.ui.property.motionPropertyRenderValue import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -119,7 +119,7 @@ class SpotlightObserveTransitionsExampleNode( .fillMaxSize() .background(appyx_dark) ) { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = spotlight, modifier = Modifier .padding( diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt index 8f3e91614..2a277c63a 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt @@ -25,7 +25,7 @@ import com.bumble.appyx.components.spotlight.operation.next import com.bumble.appyx.components.spotlight.operation.previous import com.bumble.appyx.components.spotlight.ui.slider.SpotlightSlider import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.composable.KnobControl import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node @@ -99,7 +99,7 @@ class SpotlightDebugNode( KnobControl(onValueChange = { spotlight.setNormalisedProgress(it) }) - AppyxComponent( + AppyxNavigationComponent( appyxComponent = spotlight, modifier = Modifier.padding( horizontal = 64.dp, diff --git a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt index e48cb9e6c..888107c4f 100644 --- a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt +++ b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.navigation.Appyx import com.bumble.appyx.navigation.children.ChildAware import com.bumble.appyx.navigation.children.ChildAwareImpl import com.bumble.appyx.navigation.children.ChildEntry -import com.bumble.appyx.navigation.composable.AppyxComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.integration.LocalScreenSize import com.bumble.appyx.navigation.integration.ScreenSize import com.bumble.appyx.navigation.integration.ScreenSize.WindowSizeClass.COMPACT @@ -138,7 +138,7 @@ open class AppyxMaterial3NavNode( @Composable fun CurrentNavItem() { - AppyxComponent( + AppyxNavigationComponent( appyxComponent = spotlight ) } From 83f0b780186fb993c99769c9e7a82177e3010c8b Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 8 Jan 2024 18:33:09 +0000 Subject: [PATCH 10/25] Update documentation --- documentation/2.x/migrationguide.md | 6 +-- documentation/interactions/gestures.md | 34 ++++++++--------- documentation/interactions/usage.md | 49 ++++++++++++++++++++++++- documentation/navigation/quick-start.md | 5 +-- 4 files changed, 66 insertions(+), 28 deletions(-) diff --git a/documentation/2.x/migrationguide.md b/documentation/2.x/migrationguide.md index 2d863325d..b7f5e4834 100644 --- a/documentation/2.x/migrationguide.md +++ b/documentation/2.x/migrationguide.md @@ -39,7 +39,7 @@ Check also [Multiplatform](../navigation/multiplatform.md) documentation and the ## Rough equivalents - 1.x → 2.x -- `NavModel` → `AppyxComponent` +- `NavModel` → `AppyxNavigationComponent` - `TransitionHandler` → `Visualisation` @@ -115,7 +115,7 @@ Artifacts have a `utils-` prefix: +import com.bumble.appyx.components.backstack.BackStackModel +import com.bumble.appyx.components.backstack.operation.push +import com.bumble.appyx.components.backstack.ui.fader.BackStackFader -+import com.bumble.appyx.navigation.composable.AppyxComponent ++import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.modality.BuildContext +import com.bumble.appyx.navigation.node.Node +import com.bumble.appyx.navigation.node.ParentNode @@ -155,7 +155,7 @@ class RootNode( - Children( - navModel = backStack, - transitionHandler = rememberBackstackFader(transitionSpec = { spring() }), -+ AppyxComponent( ++ AppyxNavigationComponent( + appyxComponent = backStack, modifier = Modifier.fillMaxSize() ) diff --git a/documentation/interactions/gestures.md b/documentation/interactions/gestures.md index 06fac0c19..7e701d77e 100644 --- a/documentation/interactions/gestures.md +++ b/documentation/interactions/gestures.md @@ -329,25 +329,21 @@ Here's an example that uses a `completionThreshold` value of `0.15f` (15%). Noti You can connect your gesture detection to your [AppyxComponent](appyxcomponent.md) in client code such as: ```kotlin -@Composable -fun SomeComposable() { - val appyxComponent = remember { - SomeAppyxComponent( - // Required - model = SomeTransitionModel(/*...*/), - visualisation = { SomeVisualisation(/*...*/) } , - - // Optional - animationSpec = spring(stiffness = Spring.StiffnessLow), - gestureFactory = { SomeVisualisation.Gestures(/*...*/) }, - gestureSettleConfig = GestureSettleConfig( - completionThreshold = 0.5f, - completeGestureSpec = spring(), - revertGestureSpec = spring(), - ), - ) - } -} +val appyxComponent = + SomeAppyxComponent( + // Required + model = SomeTransitionModel(/*...*/), + visualisation = { SomeVisualisation(/*...*/) } , + + // Optional + animationSpec = spring(stiffness = Spring.StiffnessLow), + gestureFactory = { SomeVisualisation.Gestures(/*...*/) }, + gestureSettleConfig = GestureSettleConfig( + completionThreshold = 0.5f, + completeGestureSpec = spring(), + revertGestureSpec = spring(), + ), + ) ``` Note that as stated above, gestures are usually come hand in hand with a specific visual representation, but you're not strictly limited to using the same ones. For example, you could use a combination of `SpotlightFader` + `SpotlightSlider.Gestures` to have cross-fading visuals controlled by swiping gestures. diff --git a/documentation/interactions/usage.md b/documentation/interactions/usage.md index ac7e6dcb1..0b29c4f07 100644 --- a/documentation/interactions/usage.md +++ b/documentation/interactions/usage.md @@ -66,13 +66,22 @@ fun SomeComposable() { ## Rendering the AppyxComponent -You can render your component with the `AppyxComponent` composable. Make sure to apply `elementUiModel.modifier` if you override the optional `element` rendering. +### In the scope of Appyx Interactions + +You can render your component with the `AppyxInteractionsComponent` composable. + +Make sure to: + +- Apply `elementUiModel.modifier` if you override the optional `element` rendering. +- Provide `screenWidthPx` and `screenWidthPx` ```kotlin @Composable fun SomeComposable() { - AppyxComponent( + AppyxInteractionsComponent( appyxComponent = yourComponent, + screenWidthPx = TODO(), + screenHeightPx = TODO(), clipToBounds = false, modifier = Modifier, element = { elementUiModel -> @@ -85,6 +94,42 @@ fun SomeComposable() { } ``` +### In the scope of Appyx Navigation + +Appyx Navigation extends on the functionality of `AppyxInteractionsComponent` and adds `AppyxNavigationComponent` as a wrapper around it. + +For client code usage they're almost identical. However, you should always use the latter when using Appyx Navigation as it makes sure the related child `Nodes` are lifecycled properly. + +Also note: + +- This composable is only accessible inside of a `ParentNode`. +- You should use it inside the `View` composable. +- You don't need to specify screen dimensions. + + +```kotlin +class YourNode( + /*...*/ +) : ParentNode { + + @Composable + override fun View(modifier: Modifier) { + AppyxNavigationComponent( + appyxComponent = yourComponent, + modifier = modifier + ) + } +} +``` + +### When to use which? + +You should use `AppyxInteractionsComponent` if you're adding standalone Appyx components to your project without using navigation. + +You should always use `AppyxNavigationComponent` if you're using Appyx Navigation. + + + ## Interacting with the AppyxComponent How you use your model will depend on the specific component. However, typically, you will have a high level API to trigger changes, such as: diff --git a/documentation/navigation/quick-start.md b/documentation/navigation/quick-start.md index b0064a8b7..be9ca568d 100644 --- a/documentation/navigation/quick-start.md +++ b/documentation/navigation/quick-start.md @@ -140,16 +140,13 @@ backStack.pop() // will remove the currently active child an Since we passed the back stack to the `ParentNode`, all such changes will be immediately reflected. We only need to add it to the composition: ```kotlin -// Pay attention to the import: -import com.bumble.appyx.navigation.composable.AppyxComponent - @Composable override fun View(modifier: Modifier) { Column( modifier = modifier ) { // Let's include the elements of our component into the composition - AppyxComponent( + AppyxNavigationComponent( appyxComponent = backStack, modifier = Modifier.weight(0.9f) ) From dc6379c2eee43864389d3194e8f23a7288aef60f Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 8 Jan 2024 19:05:36 +0000 Subject: [PATCH 11/25] Update CHANGELOG.md with explicit migration guide --- CHANGELOG.md | 28 ++++++----- documentation/releases/2.0.0-alpha10.md | 67 +++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 documentation/releases/2.0.0-alpha10.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e1851fe..cb08e9c3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,15 @@ ## Pending changes +### Detailed migration guide + +[2.0.0-alpha10 – Migration guide](2.0.0-alpha10.md) + ### API breaking changes -- [#630](https://github.com/bumble-tech/appyx/pull/630) – Pass initial state into Spotlights visualisations -- [#643](https://github.com/bumble-tech/appyx/pull/643) – Unify AppyxComponent composable between appyx-navigation and appyx-interactions modules +- [#630](https://github.com/bumble-tech/appyx/pull/630) – Pass initial state into `Spotlight` visualisations +- [#643](https://github.com/bumble-tech/appyx/pull/643) – Unify `AppyxComponent` composable between `appyx-navigation` and `appyx-interactions` modules - [#642](https://github.com/bumble-tech/appyx/pull/642) – Renamings - - Rename KSP generated method: `targetUiState.toMutableState()` -> `.toMutableUiState()` - - Swap order of `TargetUiState`, `MutableUiState` in generics ### Fixed @@ -20,8 +22,8 @@ ### API breaking changes -- [#618](https://github.com/bumble-tech/appyx/pull/618) – Do not create PermanentAppyxComponent inside ParentNode. Provide it via constructor to ParentNode -- [#612](https://github.com/bumble-tech/appyx/pull/612) – Rename MotionController to Visualisation +- [#618](https://github.com/bumble-tech/appyx/pull/618) – Do not create `PermanentAppyxComponent` inside `ParentNode`. Provide it via constructor to ParentNode +- [#612](https://github.com/bumble-tech/appyx/pull/612) – Rename `MotionController` to `Visualisation` - [#617](https://github.com/bumble-tech/appyx/pull/617) – Unify inside & outside position alignment ### Changed @@ -41,7 +43,7 @@ ### Fixed -- [#608](https://github.com/bumble-tech/appyx/pull/608) – Setting default value to NodeCustomisationDirectory in IosNodeHost +- [#608](https://github.com/bumble-tech/appyx/pull/608) – Setting default value to `NodeCustomisationDirectory` in `IosNodeHost`
4 Oct 2023
@@ -52,7 +54,7 @@ ### Added - [#601](https://github.com/bumble-tech/appyx/pull/601) – iOS support and target apps -- [#599](https://github.com/bumble-tech/appyx/pull/599) Added isContinuous flag to GestureFactory +- [#599](https://github.com/bumble-tech/appyx/pull/599) Added isContinuous flag to `GestureFactory`
4 Oct 2023
@@ -82,8 +84,8 @@ - [#587](https://github.com/bumble-tech/appyx/pull/587) – Fix `DraggableChildren` and rename it to `AppyxComponent` - [#588](https://github.com/bumble-tech/appyx/pull/588) – Set bounds on all new motion controllers - [#589](https://github.com/bumble-tech/appyx/pull/589) – Fix visibility resolution for elements that do not match parent's size -- [#591](https://github.com/bumble-tech/appyx/pull/591) – Flush output cache when onCreate is called in NodeConnector -- [#592](https://github.com/bumble-tech/appyx/pull/592) – Fix Backstack3D Motion Controller +- [#591](https://github.com/bumble-tech/appyx/pull/591) – Flush output cache when `onCreate` is called in `NodeConnector` +- [#592](https://github.com/bumble-tech/appyx/pull/592) – Fix `Backstack3D` `MotionController`
13 Sep 2023
@@ -103,8 +105,8 @@ ### API breaking changes -- [#562](https://github.com/bumble-tech/appyx/issues/562) – Implement custom alignment to remove screen size knowledge when offsetting element in MotionController -- [#562](https://github.com/bumble-tech/appyx/pull/565) – Remove UiContext parameter from MotionProperty and provide BoxScope via composition local +- [#562](https://github.com/bumble-tech/appyx/issues/562) – Implement custom alignment to remove screen size knowledge when offsetting element in `MotionController` +- [#562](https://github.com/bumble-tech/appyx/pull/565) – Remove `UiContext` parameter from `MotionProperty` and provide `BoxScope` via composition local ### Added @@ -124,7 +126,7 @@ ### Added - [#539](https://github.com/bumble-tech/appyx/pull/539) – Position alignment -- [#538](https://github.com/bumble-tech/appyx/pull/538) – Availability to observe MotionProperties from children UI +- [#538](https://github.com/bumble-tech/appyx/pull/538) – Availability to observe `MotionProperties` from children UI ### Fixed diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md new file mode 100644 index 000000000..35ffa56e1 --- /dev/null +++ b/documentation/releases/2.0.0-alpha10.md @@ -0,0 +1,67 @@ +# 2.0.0-alpha10 – Migration guide + +## KSP generated method name change + +```diff +-targetUiState.toMutableState() ++targetUiState.toMutableUiState() +``` + + +## Swap order of `TargetUiState`, `MutableUiState` in generics + +```diff +class SomeVisualisation( + /*...*/ +-) : BaseVisualisation, TargetUiState, MutableUiState>( ++) : BaseVisualisation, MutableUiState, TargetUiState>( +``` + + +## Rename ambiguous `AppyxComponent` composables + +When used in the scope of Appyx Navigation: + +```diff +-import com.bumble.appyx.navigation.composable.AppyxComponent ++import com.bumble.appyx.navigation.composable.AppyxNavigationComponent + +class YourNode( + /*...*/ +) : ParentNode { + + @Composable + override fun View(modifier: Modifier) { +- AppyxComponent( ++ AppyxNavigationComponent( + appyxComponent = yourComponent, + modifier = modifier + ) + } +} +``` + +When used in the scope of Appyx Interactions: + +```diff +-import com.bumble.appyx.interactions.core.AppyxComponent ++import com.bumble.appyx.interactions.core.AppyxInteractionsComponent + +@Composable +fun SomeComposable() { +- AppyxComponent( ++ AppyxInteractionsComponent( + appyxComponent = yourComponent, + screenWidthPx = TODO(), + screenHeightPx = TODO(), + clipToBounds = false, + modifier = Modifier, + element = { elementUiModel -> + YourElementComposable( + elementUiModel = elementUiModel, + modifier = elementUiModel.modifier + ) + } + ) +} +``` From e3a407401c344dd116e8fee15c4e47e30287dc3c Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Mon, 8 Jan 2024 19:47:59 +0000 Subject: [PATCH 12/25] Rename Resolver.resolve(navTarget) to ChildNodeBuilder.buildChildNode(reference) --- CHANGELOG.md | 6 +- .../navigation/node/PermanentChildTest.kt | 6 +- .../children/ChildNodeCreationManager.kt | 6 +- .../{Resolver.kt => ChildNodeBuilder.kt} | 5 +- .../appyx/navigation/node/ParentNode.kt | 4 +- .../appyx/benchmark/app/node/MosaicNode.kt | 2 +- .../navigation/node/cakes/CakeListNode.kt | 8 +-- .../navigation/node/checkout/CheckoutNode.kt | 4 +- .../node/loggedout/LoggedOutNode.kt | 4 +- .../navigation/node/profile/ProfileNode.kt | 4 +- .../appyx/navigation/node/root/RootNode.kt | 6 +- .../compose/ComposeNavigationContainerNode.kt | 4 +- .../node/datingcards/DatingCardsNode.kt | 4 +- .../node/backstack/BackStackExamplesNode.kt | 4 +- .../node/backstack/BackStackNode.kt | 8 +-- .../backstack/debug/BackstackDebugNode.kt | 6 +- .../node/container/ContainerNode.kt | 4 +- .../node/modal/ModalExamplesNode.kt | 4 +- .../node/permanentchild/PermanentChildNode.kt | 4 +- .../navigation/node/promoter/PromoterNode.kt | 6 +- .../node/spotlight/SpotlightNode.kt | 6 +- .../SpotlightObserveTransitionsExampleNode.kt | 6 +- .../spotlight/debug/SpotlightDebugNode.kt | 6 +- documentation/2.x/migrationguide.md | 4 +- documentation/navigation/quick-start.md | 12 ++-- documentation/releases/2.0.0-alpha10.md | 61 +++++++++++++------ .../utils/material3/AppyxMaterial3NavNode.kt | 4 +- .../utils/testing/ui/utils/DummyParentNode.kt | 2 +- 28 files changed, 114 insertions(+), 86 deletions(-) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/{Resolver.kt => ChildNodeBuilder.kt} (54%) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb08e9c3f..c6451796c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ ## Pending changes -### Detailed migration guide +{== -[2.0.0-alpha10 – Migration guide](2.0.0-alpha10.md) +Please refer to [2.0.0-alpha10 – Migration guide](2.0.0-alpha10.md) + +==} ### API breaking changes diff --git a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt index 1d07e78f1..d52990afe 100644 --- a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt +++ b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt @@ -90,13 +90,13 @@ class PermanentChildTest { var renderPermanentChild by mutableStateOf(true) - override fun resolve( - interactionTarget: InteractionTarget, + override fun buildChildNode( + reference: InteractionTarget, buildContext: BuildContext ): Node = node(buildContext) { modifier -> BasicText( - text = interactionTarget.toString(), + text = reference.toString(), modifier = modifier.testTag(InteractionTarget::class.java.name), ) } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt index e46aae2a7..2576a4803 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt @@ -181,7 +181,7 @@ internal class ChildNodeCreationManager( ChildEntry.Initialized( key = key, node = parentNode - .resolve(key.interactionTarget, childBuildContext(savedState)) + .buildChildNode(key.interactionTarget, childBuildContext(savedState)) .build() ) } @@ -192,8 +192,8 @@ internal class ChildNodeCreationManager( is ChildEntry.Suspended -> ChildEntry.Initialized( key = key, - node = parentNode.resolve( - interactionTarget = key.interactionTarget, + node = parentNode.buildChildNode( + reference = key.interactionTarget, buildContext = childBuildContext(savedState), ).build() ) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/Resolver.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt similarity index 54% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/Resolver.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt index 3318baad4..9dc04374c 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/Resolver.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt @@ -3,6 +3,7 @@ package com.bumble.appyx.navigation.navigation import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node -interface Resolver { - fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node +interface ChildNodeBuilder { + + fun buildChildNode(reference: T, buildContext: BuildContext): Node } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt index b1d9d88ed..72d039f8a 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt @@ -20,7 +20,7 @@ import com.bumble.appyx.navigation.children.nodeOrNull import com.bumble.appyx.navigation.lifecycle.ChildNodeLifecycleManager import com.bumble.appyx.navigation.lifecycle.Lifecycle import com.bumble.appyx.navigation.modality.BuildContext -import com.bumble.appyx.navigation.navigation.Resolver +import com.bumble.appyx.navigation.navigation.ChildNodeBuilder import com.bumble.appyx.navigation.platform.PlatformBackHandler import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch @@ -43,7 +43,7 @@ abstract class ParentNode( view = view, buildContext = buildContext, plugins = plugins + appyxComponent + childAware -), Resolver { +), ChildNodeBuilder { private val childNodeCreationManager = ChildNodeCreationManager( savedStateMap = buildContext.savedStateMap, diff --git a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt index f9814b386..b383f331f 100644 --- a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt +++ b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt @@ -70,7 +70,7 @@ class MosaicNode( appyxComponent = mosaic ) { - override fun resolve(mosaicPiece: MosaicPiece, buildContext: BuildContext): Node = + override fun buildChildNode(mosaicPiece: MosaicPiece, buildContext: BuildContext): Node = node(buildContext) { modifier -> Box( modifier = modifier diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt index a6b379f11..aa02bee91 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt @@ -75,13 +75,13 @@ class CakeListNode( ) : NavTarget() } - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { - is NavTarget.Backdrop -> CakeBackdropNode(buildContext, navTarget.cake) { + override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + when (reference) { + is NavTarget.Backdrop -> CakeBackdropNode(buildContext, reference.cake) { toggleHeroMode() } - is NavTarget.CakeImage -> CakeImageNode(buildContext, navTarget.cake) { + is NavTarget.CakeImage -> CakeImageNode(buildContext, reference.cake) { toggleHeroMode() } } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt index df94d7253..985e365ea 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt @@ -64,8 +64,8 @@ class CheckoutNode( object Success : NavTarget() } - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { + override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + when (reference) { is NavTarget.CartItems -> CartItemsNode(buildContext, cart) { backStack.push(NavTarget.Address) } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt index d5c64f43e..82732a116 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt @@ -71,8 +71,8 @@ class LoggedOutNode( object Login : NavTarget() } - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { + override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + when (reference) { is NavTarget.Splash -> node(buildContext) { modifier -> SplashScreen(modifier) } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt index 552799d21..3833fbba6 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt @@ -44,8 +44,8 @@ class ProfileNode( object ProfileChild : NavTarget() } - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { + override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + when (reference) { is NavTarget.ProfileChild -> node(buildContext) { modifier -> Column( modifier = modifier.fillMaxSize(), diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt index b82ef2328..2f1b41320 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt @@ -54,15 +54,15 @@ class RootNode( ) : NavTarget() } - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { + override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + when (reference) { is NavTarget.LoggedOut -> LoggedOutNode( buildContext = buildContext, onLogin = { user -> onLogin(user) } ) is NavTarget.Main -> MainNode( buildContext = buildContext, - user = navTarget.user, + user = reference.user, onLogout = { backStack.replace(NavTarget.LoggedOut) } ) } diff --git a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt index 7aac34a2a..645564e87 100644 --- a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt +++ b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt @@ -38,8 +38,8 @@ internal class ComposeNavigationContainerNode( object Main : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Main -> node(buildContext) { Column( modifier = Modifier.fillMaxWidth(), diff --git a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt index d5f3882e3..fdf9b5b1d 100644 --- a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt +++ b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt @@ -44,8 +44,8 @@ class DatingCardsNode( class ProfileCard(val profile: Profile) : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - ProfileCardNode(buildContext, (interactionTarget as InteractionTarget.ProfileCard).profile) + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + ProfileCardNode(buildContext, (reference as InteractionTarget.ProfileCard).profile) @Composable override fun View(modifier: Modifier) { diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt index aa447317c..481c460a4 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt @@ -66,8 +66,8 @@ class BackStackExamplesNode( object BackStack3D : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.BackStackPicker -> node(buildContext) { BackStackPicker(it) } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt index c2c79be89..39465d5dd 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt @@ -71,8 +71,8 @@ class BackStackNode( class Child(val index: Int) : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = rememberSaveable(saver = ColorSaver) { colors.shuffled().random() } @@ -89,10 +89,10 @@ class BackStackNode( ) .background(backgroundColor) .padding(24.dp) - .gestureModifier(backStack, interactionTarget.index.toString()) + .gestureModifier(backStack, reference.index.toString()) ) { Text( - text = interactionTarget.index.toString(), + text = reference.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt index 93581247c..9fc6a65b8 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt @@ -66,8 +66,8 @@ class BackstackDebugNode( class Child(val index: Int) : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } @@ -79,7 +79,7 @@ class BackstackDebugNode( .padding(24.dp) ) { Text( - text = interactionTarget.index.toString(), + text = reference.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt index 431b44c92..f651b8d76 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt @@ -76,8 +76,8 @@ class ContainerNode( } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Selector -> node(buildContext) { modifier -> Selector(modifier) } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt index 68c5cc188..6d6ba4c55 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt @@ -55,8 +55,8 @@ class ModalExamplesNode( object Child : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt index c680b5c24..f3fa956da 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt @@ -49,8 +49,8 @@ class PermanentChildNode( object Child2 : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Child1 -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt index 2678938f4..8bc6821b8 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt @@ -73,8 +73,8 @@ class PromoterNode( class Child(val index: Int) : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } @@ -86,7 +86,7 @@ class PromoterNode( .padding(24.dp) ) { Text( - text = interactionTarget.index.toString(), + text = reference.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt index 5c3b84972..3e05036ff 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt @@ -67,8 +67,8 @@ class SpotlightNode( class Child(val index: Int) : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Child -> node(buildContext) { modifier -> val backgroundColorIdx = rememberSaveable { colors.shuffled().indices.random() } val backgroundColor = colors[backgroundColorIdx] @@ -84,7 +84,7 @@ class SpotlightNode( ) { Text( - text = "${interactionTarget.index} – Clicked: $clicked", + text = "${reference.index} – Clicked: $clicked", fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt index 4968d1ce9..a8b90432c 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt @@ -66,8 +66,8 @@ class SpotlightObserveTransitionsExampleNode( class Child(val index: Int) : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Child -> node(buildContext) { modifier -> val backgroundColor = remember { colors.shuffled().random() } Box( @@ -78,7 +78,7 @@ class SpotlightObserveTransitionsExampleNode( .padding(24.dp) ) { Text( - text = interactionTarget.index.toString(), + text = reference.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt index 2a277c63a..58fd492c4 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt @@ -67,8 +67,8 @@ class SpotlightDebugNode( class Child(val index: Int) : InteractionTarget() } - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node = - when (interactionTarget) { + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = + when (reference) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( @@ -79,7 +79,7 @@ class SpotlightDebugNode( .padding(24.dp) ) { Text( - text = interactionTarget.index.toString(), + text = reference.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/documentation/2.x/migrationguide.md b/documentation/2.x/migrationguide.md index b7f5e4834..9df774a5c 100644 --- a/documentation/2.x/migrationguide.md +++ b/documentation/2.x/migrationguide.md @@ -144,8 +144,8 @@ class RootNode( - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { -+ override fun resolve(interactionTarget: NavTarget, buildContext: BuildContext): Node = -+ when (interactionTarget) { ++ override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = ++ when (reference) { is Child1 -> Child1Node(buildContext) { backStack.push(Child2) } is Child2 -> Child2Node(buildContext) } diff --git a/documentation/navigation/quick-start.md b/documentation/navigation/quick-start.md index be9ca568d..c3af6570c 100644 --- a/documentation/navigation/quick-start.md +++ b/documentation/navigation/quick-start.md @@ -96,11 +96,11 @@ class RootNode( ) { ``` -`ParentNode` expects us to implement the abstract method `resolve`. This is how we relate navigation targets to actual children. Let's use these helper methods to define some placeholders for the time being – we'll soon make them more appealing: +`ParentNode` expects us to implement the abstract method `buildChildNode`. This is how we relate navigation targets to actual children. Let's use these helper methods to define some placeholders for the time being – we'll soon make them more appealing: ```kotlin -override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { +override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + when (reference) { NavTarget.Child1 -> node(buildContext) { Text(text = "Placeholder for child 1") } NavTarget.Child2 -> node(buildContext) { Text(text = "Placeholder for child 2") } NavTarget.Child3 -> node(buildContext) { Text(text = "Placeholder for child 3") } @@ -228,11 +228,11 @@ class SomeChildNode( } ``` -Now we can update the `resolve` method in `RootNode` so that the target `Child3` refers to this node. It should work out of the box: +Now we can update the `buildChildNode` method in `RootNode` so that the target `Child3` refers to this node. It should work out of the box: ```kotlin -override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { +override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + when (reference) { NavTarget.Child1 -> node(buildContext) { Text(text = "Placeholder for child 1") } NavTarget.Child2 -> node(buildContext) { Text(text = "Placeholder for child 2") } NavTarget.Child3 -> SomeChildNode(buildContext) diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 35ffa56e1..79e186168 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -1,22 +1,8 @@ -# 2.0.0-alpha10 – Migration guide - -## KSP generated method name change - -```diff --targetUiState.toMutableState() -+targetUiState.toMutableUiState() -``` - - -## Swap order of `TargetUiState`, `MutableUiState` in generics - -```diff -class SomeVisualisation( - /*...*/ --) : BaseVisualisation, TargetUiState, MutableUiState>( -+) : BaseVisualisation, MutableUiState, TargetUiState>( -``` +--- +title: 2.0.0-alpha10 – Migration guide +--- +# 2.0.0-alpha10 – Migration guide ## Rename ambiguous `AppyxComponent` composables @@ -65,3 +51,42 @@ fun SomeComposable() { ) } ``` + +## Rename `resolve` method & parameter name + +```diff +class YourNode( + /*...*/ +) : ParentNode { + /*...*/ +) { + sealed class NavTarget : Parcelable { + /*...*/ + } + +- override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = ++ override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + +- when (navTarget) { ++ when (reference) { + TODO() + } +``` + + +## Swap the order of `TargetUiState`, `MutableUiState` + +```diff +class SomeVisualisation( + /*...*/ +-) : BaseVisualisation, TargetUiState, MutableUiState>( ++) : BaseVisualisation, MutableUiState, TargetUiState>( +``` + + +## KSP generated method name change + +```diff +-targetUiState.toMutableState() ++targetUiState.toMutableUiState() +``` diff --git a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt index 888107c4f..c036f5993 100644 --- a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt +++ b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt @@ -82,9 +82,9 @@ open class AppyxMaterial3NavNode( plugins = plugins ) { - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = + override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = navTargetResolver - .invoke(navTarget) + .invoke(reference) .node .invoke(buildContext) diff --git a/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt b/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt index 44e871822..1711991f1 100644 --- a/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt +++ b/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt @@ -9,5 +9,5 @@ class DummyParentNode : ParentNode( appyxComponent = EmptyAppyxComponent(), buildContext = BuildContext.root(savedStateMap = null) ) { - override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext) = node(buildContext) { } + override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext) = node(buildContext) { } } From c287d35674b5ad782791035b45dfc3035186a8d1 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 14:02:51 +0000 Subject: [PATCH 13/25] Make ChildNodeBuilder a fun interface --- .../com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt index 9dc04374c..0eb246d20 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt @@ -3,7 +3,7 @@ package com.bumble.appyx.navigation.navigation import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node -interface ChildNodeBuilder { +fun interface ChildNodeBuilder { fun buildChildNode(reference: T, buildContext: BuildContext): Node } From 416afd012420caee43810a2ed631426835acc457 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 12:48:58 +0000 Subject: [PATCH 14/25] Rename InteractionTarget to ChildReference in navigation generics --- .../navigation/node/PermanentChildTest.kt | 24 ++++++------ .../navigation/children/ChildEntryMap.kt | 2 +- .../children/ChildNodeCreationManager.kt | 38 +++++++++---------- .../composable/AppyxNavigationComponent.kt | 6 +-- .../appyx/navigation/composable/Child.kt | 10 ++--- .../navigation/composable/PermanentChild.kt | 10 ++--- .../lifecycle/ChildNodeLifecycleManager.kt | 6 +-- .../navigation/navigation/ChildNodeBuilder.kt | 4 +- .../appyx/navigation/node/EmptyNodeViews.kt | 4 +- .../appyx/navigation/node/ParentNode.kt | 16 ++++---- .../appyx/navigation/node/ParentNodeView.kt | 6 +-- .../node/permanentchild/PermanentChildNode.kt | 4 +- 12 files changed, 65 insertions(+), 65 deletions(-) diff --git a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt index d52990afe..1ec0b9603 100644 --- a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt +++ b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt @@ -13,7 +13,7 @@ import com.bumble.appyx.navigation.AppyxTestScenario import com.bumble.appyx.navigation.children.nodeOrNull import com.bumble.appyx.navigation.composable.PermanentChild import com.bumble.appyx.navigation.modality.BuildContext -import com.bumble.appyx.navigation.node.PermanentChildTest.TestParentNode.InteractionTarget +import com.bumble.appyx.navigation.node.PermanentChildTest.TestParentNode.ChildReference import com.bumble.appyx.utils.multiplatform.Parcelable import com.bumble.appyx.utils.multiplatform.Parcelize import org.junit.Assert.assertEquals @@ -36,14 +36,14 @@ class PermanentChildTest { createPermanentAppyxComponentWithInteractionKey() rule.start() - rule.onNode(hasTestTag(InteractionTarget::class.java.name)).assertExists() + rule.onNode(hasTestTag(ChildReference::class.java.name)).assertExists() } @Test fun `WHEN_permanent_model_does_not_contain_relevant_nav_key_THEN_permanent_child_is_not_rendered`() { rule.start() - rule.onNode(hasTestTag(InteractionTarget::class.java.name)) + rule.onNode(hasTestTag(ChildReference::class.java.name)) .assertDoesNotExist() } @@ -54,12 +54,12 @@ class PermanentChildTest { rule.node.renderPermanentChild = false val childNodes = rule.node.children.value.values.map { it.nodeOrNull } - rule.onNode(hasTestTag(InteractionTarget::class.java.name)) + rule.onNode(hasTestTag(ChildReference::class.java.name)) .assertDoesNotExist() rule.node.renderPermanentChild = true - rule.onNode(hasTestTag(InteractionTarget::class.java.name)).assertExists() + rule.onNode(hasTestTag(ChildReference::class.java.name)).assertExists() assertEquals(childNodes, rule.node.children.value.values.map { it.nodeOrNull }) } @@ -69,7 +69,7 @@ class PermanentChildTest { buildContext = it, permanentAppyxComponent = PermanentAppyxComponent( savedStateMap = null, - listOf(InteractionTarget) + listOf(ChildReference) ) ) } @@ -78,33 +78,33 @@ class PermanentChildTest { class TestParentNode( buildContext: BuildContext, - private val permanentAppyxComponent: PermanentAppyxComponent = + private val permanentAppyxComponent: PermanentAppyxComponent = PermanentAppyxComponent(savedStateMap = buildContext.savedStateMap) - ) : ParentNode( + ) : ParentNode( buildContext = buildContext, appyxComponent = permanentAppyxComponent ) { @Parcelize - object InteractionTarget : Parcelable + object ChildReference : Parcelable var renderPermanentChild by mutableStateOf(true) override fun buildChildNode( - reference: InteractionTarget, + reference: ChildReference, buildContext: BuildContext ): Node = node(buildContext) { modifier -> BasicText( text = reference.toString(), - modifier = modifier.testTag(InteractionTarget::class.java.name), + modifier = modifier.testTag(ChildReference::class.java.name), ) } @Composable override fun View(modifier: Modifier) { if (renderPermanentChild) { - PermanentChild(permanentAppyxComponent, InteractionTarget) + PermanentChild(permanentAppyxComponent, ChildReference) } } } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt index 72cf04fa9..2bdce7dd3 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt @@ -2,4 +2,4 @@ package com.bumble.appyx.navigation.children import com.bumble.appyx.interactions.core.Element -typealias ChildEntryMap = Map, ChildEntry> +typealias ChildEntryMap = Map, ChildEntry> diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt index 2576a4803..8fd7e6084 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt @@ -20,17 +20,17 @@ import kotlinx.coroutines.launch * * Lifecycle of these nodes is managed in [com.bumble.appyx.core.lifecycle.ChildNodeLifecycleManager]. */ -internal class ChildNodeCreationManager( +internal class ChildNodeCreationManager( private var savedStateMap: SavedStateMap?, private val customisations: NodeCustomisationDirectory, private val keepMode: ChildEntry.KeepMode, ) { - private lateinit var parentNode: ParentNode + private lateinit var parentNode: ParentNode private val _children = - MutableStateFlow, ChildEntry>>(emptyMap()) - val children: StateFlow> = _children.asStateFlow() + MutableStateFlow, ChildEntry>>(emptyMap()) + val children: StateFlow> = _children.asStateFlow() - fun launch(parentNode: ParentNode) { + fun launch(parentNode: ParentNode) { this.parentNode = parentNode savedStateMap.restoreChildren()?.also { restoredMap -> _children.update { restoredMap } @@ -39,12 +39,12 @@ internal class ChildNodeCreationManager( syncAppyxComponentWithChildren(parentNode) } - private fun syncAppyxComponentWithChildren(parentNode: ParentNode) { + private fun syncAppyxComponentWithChildren(parentNode: ParentNode) { parentNode.lifecycle.coroutineScope.launch { parentNode.appyxComponent.elements.collect { state -> - val appyxComponentKeepKeys: Set> - val appyxComponentSuspendKeys: Set> - val appyxComponentKeys: Set> + val appyxComponentKeepKeys: Set> + val appyxComponentSuspendKeys: Set> + val appyxComponentKeys: Set> when (keepMode) { ChildEntry.KeepMode.KEEP -> { appyxComponentKeepKeys = @@ -71,9 +71,9 @@ internal class ChildNodeCreationManager( } private fun updateChildren( - appyxComponentElements: Set>, - appyxComponentKeepElements: Set>, - appyxComponentSuspendElements: Set>, + appyxComponentElements: Set>, + appyxComponentKeepElements: Set>, + appyxComponentSuspendElements: Set>, ) { _children.update { map -> val localElements = map.keys @@ -117,7 +117,7 @@ internal class ChildNodeCreationManager( } @Suppress("ForbiddenComment") - fun childOrCreate(element: Element): ChildEntry.Initialized { + fun childOrCreate(element: Element): ChildEntry.Initialized { // TODO: Should not allow child creation and throw exception instead to avoid desynchronisation val value = _children.value val child = value[element] ?: error( @@ -140,8 +140,8 @@ internal class ChildNodeCreationManager( } } - private fun SavedStateMap?.restoreChildren(): ChildEntryMap? = - (this?.get(KEY_CHILDREN_STATE) as? Map, SavedStateMap>)?.mapValues { + private fun SavedStateMap?.restoreChildren(): ChildEntryMap? = + (this?.get(KEY_CHILDREN_STATE) as? Map, SavedStateMap>)?.mapValues { // Always restore in suspended mode, they will be unsuspended or destroyed on the first sync cycle childEntry(it.key, it.value, true) } @@ -171,10 +171,10 @@ internal class ChildNodeCreationManager( ) private fun childEntry( - key: Element, + key: Element, savedState: SavedStateMap?, suspended: Boolean, - ): ChildEntry = + ): ChildEntry = if (suspended) { ChildEntry.Suspended(key, savedState) } else { @@ -186,7 +186,7 @@ internal class ChildNodeCreationManager( ) } - private fun ChildEntry.initialize(): ChildEntry.Initialized = + private fun ChildEntry.initialize(): ChildEntry.Initialized = when (this) { is ChildEntry.Initialized -> this is ChildEntry.Suspended -> @@ -200,7 +200,7 @@ internal class ChildNodeCreationManager( } @Suppress("ForbiddenComment") - private fun ChildEntry.suspend(): ChildEntry.Suspended = + private fun ChildEntry.suspend(): ChildEntry.Suspended = when (this) { is ChildEntry.Suspended -> this is ChildEntry.Initialized -> diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt index 5a00c8b7d..78a0b5c64 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt @@ -17,15 +17,15 @@ import kotlin.math.roundToInt internal val defaultExtraTouch = 48.dp @Composable -fun ParentNode.AppyxNavigationComponent( - appyxComponent: BaseAppyxComponent, +fun ParentNode.AppyxNavigationComponent( + appyxComponent: BaseAppyxComponent, modifier: Modifier = Modifier, clipToBounds: Boolean = false, gestureValidator: GestureValidator = GestureValidator.defaultValidator, gestureExtraTouchArea: Dp = defaultExtraTouch, decorator: (@Composable ( child: ChildRenderer, - elementUiModel: ElementUiModel + elementUiModel: ElementUiModel ) -> Unit) = { child, _ -> child() } ) { val density = LocalDensity.current diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt index 63ecabbee..d5a2c8df9 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt @@ -9,9 +9,9 @@ import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @Composable -fun ParentNode.Child( - elementUiModel: ElementUiModel, - decorator: @Composable (child: ChildRenderer, elementUiModel: ElementUiModel) -> Unit +fun ParentNode.Child( + elementUiModel: ElementUiModel, + decorator: @Composable (child: ChildRenderer, elementUiModel: ElementUiModel) -> Unit ) { val navElement = elementUiModel.element val childEntry = remember(navElement.id) { childOrCreate(navElement) } @@ -24,9 +24,9 @@ fun ParentNode.Child( ) } -private class ChildRendererImpl( +private class ChildRendererImpl( private val node: Node, - private val elementUiModel: ElementUiModel + private val elementUiModel: ElementUiModel ) : ChildRenderer { @Suppress("ComposableNaming") // This wants to be 'Invoke' but that won't work with 'operator'. diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt index 02149fd7c..fbd07cb7b 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt @@ -12,18 +12,18 @@ import com.bumble.appyx.navigation.node.ParentNode import kotlinx.coroutines.flow.SharingStarted @Composable -fun ParentNode.PermanentChild( - permanentAppyxComponent: PermanentAppyxComponent, - interactionTarget: InteractionTarget, +fun ParentNode.PermanentChild( + permanentAppyxComponent: PermanentAppyxComponent, + reference: ChildReference, modifier: Modifier = Modifier ) { val scope = rememberCoroutineScope() - val child by remember(interactionTarget, permanentAppyxComponent) { + val child by remember(reference, permanentAppyxComponent) { children .mapState(scope, SharingStarted.WhileSubscribed()) { childrenMap -> childrenMap .keys - .find { it.interactionTarget == interactionTarget } + .find { it.interactionTarget == reference } ?.let { childOrCreate(it) } } }.collectAsState() diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt index 339af381d..b6d1a253e 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt @@ -16,9 +16,9 @@ import kotlinx.coroutines.launch * Hosts [PlatformLifecycleRegistry] to manage the current node lifecycle * and updates lifecycle of children nodes when updated. */ -internal class ChildNodeLifecycleManager( - private val appyxComponent: AppyxComponent, - private val children: StateFlow>, +internal class ChildNodeLifecycleManager( + private val appyxComponent: AppyxComponent, + private val children: StateFlow>, private val keepMode: ChildEntry.KeepMode, private val coroutineScope: CoroutineScope, ) { diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt index 0eb246d20..18fbda854 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt @@ -3,7 +3,7 @@ package com.bumble.appyx.navigation.navigation import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node -fun interface ChildNodeBuilder { +fun interface ChildNodeBuilder { - fun buildChildNode(reference: T, buildContext: BuildContext): Node + fun buildChildNode(reference: ChildReference, buildContext: BuildContext): Node } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt index 67c4096bc..f9a9ffff3 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt @@ -9,9 +9,9 @@ object EmptyNodeView : NodeView { override fun View(modifier: Modifier) = Unit } -class EmptyParentNodeView : ParentNodeView { +class EmptyParentNodeView : ParentNodeView { @Composable - override fun ParentNode.NodeView(modifier: Modifier) = Unit + override fun ParentNode.NodeView(modifier: Modifier) = Unit } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt index 72d039f8a..c0def8328 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt @@ -32,25 +32,25 @@ import kotlin.reflect.KClass @Suppress("TooManyFunctions") @Stable -abstract class ParentNode( - val appyxComponent: AppyxComponent, +abstract class ParentNode( + val appyxComponent: AppyxComponent, buildContext: BuildContext, - view: ParentNodeView = EmptyParentNodeView(), + view: ParentNodeView = EmptyParentNodeView(), childKeepMode: ChildEntry.KeepMode = Appyx.defaultChildKeepMode, - private val childAware: ChildAware> = ChildAwareImpl(), + private val childAware: ChildAware> = ChildAwareImpl(), plugins: List = listOf(), ) : Node( view = view, buildContext = buildContext, plugins = plugins + appyxComponent + childAware -), ChildNodeBuilder { +), ChildNodeBuilder { - private val childNodeCreationManager = ChildNodeCreationManager( + private val childNodeCreationManager = ChildNodeCreationManager( savedStateMap = buildContext.savedStateMap, customisations = buildContext.customisations, keepMode = childKeepMode, ) - val children: StateFlow> + val children: StateFlow> get() = childNodeCreationManager.children private val childNodeLifecycleManager = ChildNodeLifecycleManager( @@ -66,7 +66,7 @@ abstract class ParentNode( childNodeLifecycleManager.launch() } - fun childOrCreate(element: Element): ChildEntry.Initialized = + fun childOrCreate(element: Element): ChildEntry.Initialized = childNodeCreationManager.childOrCreate(element) override fun updateLifecycleState(state: Lifecycle.State) { diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt index d7aa820ba..4acbd33a9 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt @@ -3,10 +3,10 @@ package com.bumble.appyx.navigation.node import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -interface ParentNodeView : NodeView { +interface ParentNodeView : NodeView { @Composable - fun ParentNode.NodeView(modifier: Modifier) + fun ParentNode.NodeView(modifier: Modifier) /** * Do not override this function. Parent views should implement NodeView method. @@ -14,7 +14,7 @@ interface ParentNodeView : NodeView { @Suppress("UNCHECKED_CAST") @Composable override fun View(modifier: Modifier) { - val node = LocalNode.current as? ParentNode + val node = LocalNode.current as? ParentNode ?: error("${this::class} is not provided to the appropriate ParentNode") node.NodeView(modifier = modifier) } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt index f3fa956da..30a06b84b 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt @@ -99,11 +99,11 @@ class PermanentChildNode( ) { PermanentChild( permanentAppyxComponent = permanentAppyxComponent, - interactionTarget = InteractionTarget.Child1 + reference = InteractionTarget.Child1 ) PermanentChild( permanentAppyxComponent = permanentAppyxComponent, - interactionTarget = InteractionTarget.Child2 + reference = InteractionTarget.Child2 ) } } From 8db4efe6dc224d01717a803a156a7fe74faac24d Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 19:13:50 +0000 Subject: [PATCH 15/25] Rename reference to navTarget --- .../navigation/node/PermanentChildTest.kt | 29 +++++++++---------- .../children/ChildNodeCreationManager.kt | 2 +- .../navigation/navigation/ChildNodeBuilder.kt | 4 +-- .../navigation/node/cakes/CakeListNode.kt | 8 ++--- .../navigation/node/checkout/CheckoutNode.kt | 4 +-- .../node/loggedout/LoggedOutNode.kt | 4 +-- .../navigation/node/profile/ProfileNode.kt | 4 +-- .../appyx/navigation/node/root/RootNode.kt | 6 ++-- .../compose/ComposeNavigationContainerNode.kt | 4 +-- .../node/datingcards/DatingCardsNode.kt | 4 +-- .../node/backstack/BackStackExamplesNode.kt | 4 +-- .../node/backstack/BackStackNode.kt | 8 ++--- .../backstack/debug/BackstackDebugNode.kt | 6 ++-- .../node/container/ContainerNode.kt | 4 +-- .../node/modal/ModalExamplesNode.kt | 4 +-- .../node/permanentchild/PermanentChildNode.kt | 4 +-- .../navigation/node/promoter/PromoterNode.kt | 6 ++-- .../node/spotlight/SpotlightNode.kt | 6 ++-- .../SpotlightObserveTransitionsExampleNode.kt | 6 ++-- .../spotlight/debug/SpotlightDebugNode.kt | 6 ++-- .../utils/material3/AppyxMaterial3NavNode.kt | 4 +-- .../utils/testing/ui/utils/DummyParentNode.kt | 2 +- 22 files changed, 63 insertions(+), 66 deletions(-) diff --git a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt index 1ec0b9603..67683b3af 100644 --- a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt +++ b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/node/PermanentChildTest.kt @@ -13,7 +13,7 @@ import com.bumble.appyx.navigation.AppyxTestScenario import com.bumble.appyx.navigation.children.nodeOrNull import com.bumble.appyx.navigation.composable.PermanentChild import com.bumble.appyx.navigation.modality.BuildContext -import com.bumble.appyx.navigation.node.PermanentChildTest.TestParentNode.ChildReference +import com.bumble.appyx.navigation.node.PermanentChildTest.TestParentNode.Child import com.bumble.appyx.utils.multiplatform.Parcelable import com.bumble.appyx.utils.multiplatform.Parcelize import org.junit.Assert.assertEquals @@ -36,14 +36,14 @@ class PermanentChildTest { createPermanentAppyxComponentWithInteractionKey() rule.start() - rule.onNode(hasTestTag(ChildReference::class.java.name)).assertExists() + rule.onNode(hasTestTag(Child::class.java.name)).assertExists() } @Test fun `WHEN_permanent_model_does_not_contain_relevant_nav_key_THEN_permanent_child_is_not_rendered`() { rule.start() - rule.onNode(hasTestTag(ChildReference::class.java.name)) + rule.onNode(hasTestTag(Child::class.java.name)) .assertDoesNotExist() } @@ -54,12 +54,12 @@ class PermanentChildTest { rule.node.renderPermanentChild = false val childNodes = rule.node.children.value.values.map { it.nodeOrNull } - rule.onNode(hasTestTag(ChildReference::class.java.name)) + rule.onNode(hasTestTag(Child::class.java.name)) .assertDoesNotExist() rule.node.renderPermanentChild = true - rule.onNode(hasTestTag(ChildReference::class.java.name)).assertExists() + rule.onNode(hasTestTag(Child::class.java.name)).assertExists() assertEquals(childNodes, rule.node.children.value.values.map { it.nodeOrNull }) } @@ -69,7 +69,7 @@ class PermanentChildTest { buildContext = it, permanentAppyxComponent = PermanentAppyxComponent( savedStateMap = null, - listOf(ChildReference) + listOf(Child) ) ) } @@ -78,33 +78,30 @@ class PermanentChildTest { class TestParentNode( buildContext: BuildContext, - private val permanentAppyxComponent: PermanentAppyxComponent = + private val permanentAppyxComponent: PermanentAppyxComponent = PermanentAppyxComponent(savedStateMap = buildContext.savedStateMap) - ) : ParentNode( + ) : ParentNode( buildContext = buildContext, appyxComponent = permanentAppyxComponent ) { @Parcelize - object ChildReference : Parcelable + object Child : Parcelable var renderPermanentChild by mutableStateOf(true) - override fun buildChildNode( - reference: ChildReference, - buildContext: BuildContext - ): Node = + override fun buildChildNode(navTarget: Child, buildContext: BuildContext): Node = node(buildContext) { modifier -> BasicText( - text = reference.toString(), - modifier = modifier.testTag(ChildReference::class.java.name), + text = navTarget.toString(), + modifier = modifier.testTag(Child::class.java.name), ) } @Composable override fun View(modifier: Modifier) { if (renderPermanentChild) { - PermanentChild(permanentAppyxComponent, ChildReference) + PermanentChild(permanentAppyxComponent, Child) } } } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt index 8fd7e6084..c2b7d0665 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt @@ -193,7 +193,7 @@ internal class ChildNodeCreationManager( ChildEntry.Initialized( key = key, node = parentNode.buildChildNode( - reference = key.interactionTarget, + navTarget = key.interactionTarget, buildContext = childBuildContext(savedState), ).build() ) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt index 18fbda854..0d5c7bf40 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt @@ -3,7 +3,7 @@ package com.bumble.appyx.navigation.navigation import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node -fun interface ChildNodeBuilder { +fun interface ChildNodeBuilder { - fun buildChildNode(reference: ChildReference, buildContext: BuildContext): Node + fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt index aa02bee91..277eaf28c 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt @@ -75,13 +75,13 @@ class CakeListNode( ) : NavTarget() } - override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = - when (reference) { - is NavTarget.Backdrop -> CakeBackdropNode(buildContext, reference.cake) { + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = + when (navTarget) { + is NavTarget.Backdrop -> CakeBackdropNode(buildContext, navTarget.cake) { toggleHeroMode() } - is NavTarget.CakeImage -> CakeImageNode(buildContext, reference.cake) { + is NavTarget.CakeImage -> CakeImageNode(buildContext, navTarget.cake) { toggleHeroMode() } } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt index 985e365ea..bd6edda73 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt @@ -64,8 +64,8 @@ class CheckoutNode( object Success : NavTarget() } - override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = + when (navTarget) { is NavTarget.CartItems -> CartItemsNode(buildContext, cart) { backStack.push(NavTarget.Address) } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt index 82732a116..30c602917 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt @@ -71,8 +71,8 @@ class LoggedOutNode( object Login : NavTarget() } - override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = + when (navTarget) { is NavTarget.Splash -> node(buildContext) { modifier -> SplashScreen(modifier) } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt index 3833fbba6..4546fe6cd 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt @@ -44,8 +44,8 @@ class ProfileNode( object ProfileChild : NavTarget() } - override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = + when (navTarget) { is NavTarget.ProfileChild -> node(buildContext) { modifier -> Column( modifier = modifier.fillMaxSize(), diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt index 2f1b41320..0086debc0 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt @@ -54,15 +54,15 @@ class RootNode( ) : NavTarget() } - override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = + when (navTarget) { is NavTarget.LoggedOut -> LoggedOutNode( buildContext = buildContext, onLogin = { user -> onLogin(user) } ) is NavTarget.Main -> MainNode( buildContext = buildContext, - user = reference.user, + user = navTarget.user, onLogout = { backStack.replace(NavTarget.LoggedOut) } ) } diff --git a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt index 645564e87..99b3d622e 100644 --- a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt +++ b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt @@ -38,8 +38,8 @@ internal class ComposeNavigationContainerNode( object Main : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Main -> node(buildContext) { Column( modifier = Modifier.fillMaxWidth(), diff --git a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt index fdf9b5b1d..f815b9a62 100644 --- a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt +++ b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt @@ -44,8 +44,8 @@ class DatingCardsNode( class ProfileCard(val profile: Profile) : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - ProfileCardNode(buildContext, (reference as InteractionTarget.ProfileCard).profile) + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + ProfileCardNode(buildContext, (navTarget as InteractionTarget.ProfileCard).profile) @Composable override fun View(modifier: Modifier) { diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt index 481c460a4..1f73fa2f5 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt @@ -66,8 +66,8 @@ class BackStackExamplesNode( object BackStack3D : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.BackStackPicker -> node(buildContext) { BackStackPicker(it) } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt index 39465d5dd..c1b5595b8 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt @@ -71,8 +71,8 @@ class BackStackNode( class Child(val index: Int) : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = rememberSaveable(saver = ColorSaver) { colors.shuffled().random() } @@ -89,10 +89,10 @@ class BackStackNode( ) .background(backgroundColor) .padding(24.dp) - .gestureModifier(backStack, reference.index.toString()) + .gestureModifier(backStack, navTarget.index.toString()) ) { Text( - text = reference.index.toString(), + text = navTarget.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt index 9fc6a65b8..d277a3d76 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt @@ -66,8 +66,8 @@ class BackstackDebugNode( class Child(val index: Int) : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } @@ -79,7 +79,7 @@ class BackstackDebugNode( .padding(24.dp) ) { Text( - text = reference.index.toString(), + text = navTarget.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt index f651b8d76..912e8ce38 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt @@ -76,8 +76,8 @@ class ContainerNode( } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Selector -> node(buildContext) { modifier -> Selector(modifier) } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt index 6d6ba4c55..833192485 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt @@ -55,8 +55,8 @@ class ModalExamplesNode( object Child : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt index 30a06b84b..b065e64f8 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt @@ -49,8 +49,8 @@ class PermanentChildNode( object Child2 : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Child1 -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt index 8bc6821b8..1c2927ced 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt @@ -73,8 +73,8 @@ class PromoterNode( class Child(val index: Int) : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } @@ -86,7 +86,7 @@ class PromoterNode( .padding(24.dp) ) { Text( - text = reference.index.toString(), + text = navTarget.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt index 3e05036ff..78ac85027 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt @@ -67,8 +67,8 @@ class SpotlightNode( class Child(val index: Int) : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Child -> node(buildContext) { modifier -> val backgroundColorIdx = rememberSaveable { colors.shuffled().indices.random() } val backgroundColor = colors[backgroundColorIdx] @@ -84,7 +84,7 @@ class SpotlightNode( ) { Text( - text = "${reference.index} – Clicked: $clicked", + text = "${navTarget.index} – Clicked: $clicked", fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt index a8b90432c..a3d7986fa 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt @@ -66,8 +66,8 @@ class SpotlightObserveTransitionsExampleNode( class Child(val index: Int) : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Child -> node(buildContext) { modifier -> val backgroundColor = remember { colors.shuffled().random() } Box( @@ -78,7 +78,7 @@ class SpotlightObserveTransitionsExampleNode( .padding(24.dp) ) { Text( - text = reference.index.toString(), + text = navTarget.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt index 58fd492c4..51dde151b 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt @@ -67,8 +67,8 @@ class SpotlightDebugNode( class Child(val index: Int) : InteractionTarget() } - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext): Node = - when (reference) { + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + when (navTarget) { is InteractionTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( @@ -79,7 +79,7 @@ class SpotlightDebugNode( .padding(24.dp) ) { Text( - text = reference.index.toString(), + text = navTarget.index.toString(), fontSize = 21.sp, color = Color.Black, fontWeight = FontWeight.Bold diff --git a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt index c036f5993..fb92b8ae5 100644 --- a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt +++ b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt @@ -82,9 +82,9 @@ open class AppyxMaterial3NavNode( plugins = plugins ) { - override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = navTargetResolver - .invoke(reference) + .invoke(navTarget) .node .invoke(buildContext) diff --git a/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt b/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt index 1711991f1..8f8aad815 100644 --- a/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt +++ b/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/utils/DummyParentNode.kt @@ -9,5 +9,5 @@ class DummyParentNode : ParentNode( appyxComponent = EmptyAppyxComponent(), buildContext = BuildContext.root(savedStateMap = null) ) { - override fun buildChildNode(reference: InteractionTarget, buildContext: BuildContext) = node(buildContext) { } + override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext) = node(buildContext) { } } From b346eb5290255af3ba48558c202c726edf9b8897 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 19:15:16 +0000 Subject: [PATCH 16/25] Rename ChildReference to NavTarget --- .../navigation/children/ChildEntryMap.kt | 2 +- .../children/ChildNodeCreationManager.kt | 38 +++++++++---------- .../composable/AppyxNavigationComponent.kt | 6 +-- .../appyx/navigation/composable/Child.kt | 10 ++--- .../navigation/composable/PermanentChild.kt | 6 +-- .../lifecycle/ChildNodeLifecycleManager.kt | 6 +-- .../appyx/navigation/node/EmptyNodeViews.kt | 4 +- .../appyx/navigation/node/ParentNode.kt | 16 ++++---- .../appyx/navigation/node/ParentNodeView.kt | 6 +-- 9 files changed, 47 insertions(+), 47 deletions(-) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt index 2bdce7dd3..ec77961d3 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildEntryMap.kt @@ -2,4 +2,4 @@ package com.bumble.appyx.navigation.children import com.bumble.appyx.interactions.core.Element -typealias ChildEntryMap = Map, ChildEntry> +typealias ChildEntryMap = Map, ChildEntry> diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt index c2b7d0665..1c022ac61 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt @@ -20,17 +20,17 @@ import kotlinx.coroutines.launch * * Lifecycle of these nodes is managed in [com.bumble.appyx.core.lifecycle.ChildNodeLifecycleManager]. */ -internal class ChildNodeCreationManager( +internal class ChildNodeCreationManager( private var savedStateMap: SavedStateMap?, private val customisations: NodeCustomisationDirectory, private val keepMode: ChildEntry.KeepMode, ) { - private lateinit var parentNode: ParentNode + private lateinit var parentNode: ParentNode private val _children = - MutableStateFlow, ChildEntry>>(emptyMap()) - val children: StateFlow> = _children.asStateFlow() + MutableStateFlow, ChildEntry>>(emptyMap()) + val children: StateFlow> = _children.asStateFlow() - fun launch(parentNode: ParentNode) { + fun launch(parentNode: ParentNode) { this.parentNode = parentNode savedStateMap.restoreChildren()?.also { restoredMap -> _children.update { restoredMap } @@ -39,12 +39,12 @@ internal class ChildNodeCreationManager( syncAppyxComponentWithChildren(parentNode) } - private fun syncAppyxComponentWithChildren(parentNode: ParentNode) { + private fun syncAppyxComponentWithChildren(parentNode: ParentNode) { parentNode.lifecycle.coroutineScope.launch { parentNode.appyxComponent.elements.collect { state -> - val appyxComponentKeepKeys: Set> - val appyxComponentSuspendKeys: Set> - val appyxComponentKeys: Set> + val appyxComponentKeepKeys: Set> + val appyxComponentSuspendKeys: Set> + val appyxComponentKeys: Set> when (keepMode) { ChildEntry.KeepMode.KEEP -> { appyxComponentKeepKeys = @@ -71,9 +71,9 @@ internal class ChildNodeCreationManager( } private fun updateChildren( - appyxComponentElements: Set>, - appyxComponentKeepElements: Set>, - appyxComponentSuspendElements: Set>, + appyxComponentElements: Set>, + appyxComponentKeepElements: Set>, + appyxComponentSuspendElements: Set>, ) { _children.update { map -> val localElements = map.keys @@ -117,7 +117,7 @@ internal class ChildNodeCreationManager( } @Suppress("ForbiddenComment") - fun childOrCreate(element: Element): ChildEntry.Initialized { + fun childOrCreate(element: Element): ChildEntry.Initialized { // TODO: Should not allow child creation and throw exception instead to avoid desynchronisation val value = _children.value val child = value[element] ?: error( @@ -140,8 +140,8 @@ internal class ChildNodeCreationManager( } } - private fun SavedStateMap?.restoreChildren(): ChildEntryMap? = - (this?.get(KEY_CHILDREN_STATE) as? Map, SavedStateMap>)?.mapValues { + private fun SavedStateMap?.restoreChildren(): ChildEntryMap? = + (this?.get(KEY_CHILDREN_STATE) as? Map, SavedStateMap>)?.mapValues { // Always restore in suspended mode, they will be unsuspended or destroyed on the first sync cycle childEntry(it.key, it.value, true) } @@ -171,10 +171,10 @@ internal class ChildNodeCreationManager( ) private fun childEntry( - key: Element, + key: Element, savedState: SavedStateMap?, suspended: Boolean, - ): ChildEntry = + ): ChildEntry = if (suspended) { ChildEntry.Suspended(key, savedState) } else { @@ -186,7 +186,7 @@ internal class ChildNodeCreationManager( ) } - private fun ChildEntry.initialize(): ChildEntry.Initialized = + private fun ChildEntry.initialize(): ChildEntry.Initialized = when (this) { is ChildEntry.Initialized -> this is ChildEntry.Suspended -> @@ -200,7 +200,7 @@ internal class ChildNodeCreationManager( } @Suppress("ForbiddenComment") - private fun ChildEntry.suspend(): ChildEntry.Suspended = + private fun ChildEntry.suspend(): ChildEntry.Suspended = when (this) { is ChildEntry.Suspended -> this is ChildEntry.Initialized -> diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt index 78a0b5c64..dea2f4835 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt @@ -17,15 +17,15 @@ import kotlin.math.roundToInt internal val defaultExtraTouch = 48.dp @Composable -fun ParentNode.AppyxNavigationComponent( - appyxComponent: BaseAppyxComponent, +fun ParentNode.AppyxNavigationComponent( + appyxComponent: BaseAppyxComponent, modifier: Modifier = Modifier, clipToBounds: Boolean = false, gestureValidator: GestureValidator = GestureValidator.defaultValidator, gestureExtraTouchArea: Dp = defaultExtraTouch, decorator: (@Composable ( child: ChildRenderer, - elementUiModel: ElementUiModel + elementUiModel: ElementUiModel ) -> Unit) = { child, _ -> child() } ) { val density = LocalDensity.current diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt index d5a2c8df9..6be14d401 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/Child.kt @@ -9,9 +9,9 @@ import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @Composable -fun ParentNode.Child( - elementUiModel: ElementUiModel, - decorator: @Composable (child: ChildRenderer, elementUiModel: ElementUiModel) -> Unit +fun ParentNode.Child( + elementUiModel: ElementUiModel, + decorator: @Composable (child: ChildRenderer, elementUiModel: ElementUiModel) -> Unit ) { val navElement = elementUiModel.element val childEntry = remember(navElement.id) { childOrCreate(navElement) } @@ -24,9 +24,9 @@ fun ParentNode.Child( ) } -private class ChildRendererImpl( +private class ChildRendererImpl( private val node: Node, - private val elementUiModel: ElementUiModel + private val elementUiModel: ElementUiModel ) : ChildRenderer { @Suppress("ComposableNaming") // This wants to be 'Invoke' but that won't work with 'operator'. diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt index fbd07cb7b..8144a866b 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt @@ -12,9 +12,9 @@ import com.bumble.appyx.navigation.node.ParentNode import kotlinx.coroutines.flow.SharingStarted @Composable -fun ParentNode.PermanentChild( - permanentAppyxComponent: PermanentAppyxComponent, - reference: ChildReference, +fun ParentNode.PermanentChild( + permanentAppyxComponent: PermanentAppyxComponent, + reference: NavTarget, modifier: Modifier = Modifier ) { val scope = rememberCoroutineScope() diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt index b6d1a253e..f0005aba0 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/lifecycle/ChildNodeLifecycleManager.kt @@ -16,9 +16,9 @@ import kotlinx.coroutines.launch * Hosts [PlatformLifecycleRegistry] to manage the current node lifecycle * and updates lifecycle of children nodes when updated. */ -internal class ChildNodeLifecycleManager( - private val appyxComponent: AppyxComponent, - private val children: StateFlow>, +internal class ChildNodeLifecycleManager( + private val appyxComponent: AppyxComponent, + private val children: StateFlow>, private val keepMode: ChildEntry.KeepMode, private val coroutineScope: CoroutineScope, ) { diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt index f9a9ffff3..bb4f36ee8 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/EmptyNodeViews.kt @@ -9,9 +9,9 @@ object EmptyNodeView : NodeView { override fun View(modifier: Modifier) = Unit } -class EmptyParentNodeView : ParentNodeView { +class EmptyParentNodeView : ParentNodeView { @Composable - override fun ParentNode.NodeView(modifier: Modifier) = Unit + override fun ParentNode.NodeView(modifier: Modifier) = Unit } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt index c0def8328..3795c9038 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt @@ -32,25 +32,25 @@ import kotlin.reflect.KClass @Suppress("TooManyFunctions") @Stable -abstract class ParentNode( - val appyxComponent: AppyxComponent, +abstract class ParentNode( + val appyxComponent: AppyxComponent, buildContext: BuildContext, - view: ParentNodeView = EmptyParentNodeView(), + view: ParentNodeView = EmptyParentNodeView(), childKeepMode: ChildEntry.KeepMode = Appyx.defaultChildKeepMode, - private val childAware: ChildAware> = ChildAwareImpl(), + private val childAware: ChildAware> = ChildAwareImpl(), plugins: List = listOf(), ) : Node( view = view, buildContext = buildContext, plugins = plugins + appyxComponent + childAware -), ChildNodeBuilder { +), ChildNodeBuilder { - private val childNodeCreationManager = ChildNodeCreationManager( + private val childNodeCreationManager = ChildNodeCreationManager( savedStateMap = buildContext.savedStateMap, customisations = buildContext.customisations, keepMode = childKeepMode, ) - val children: StateFlow> + val children: StateFlow> get() = childNodeCreationManager.children private val childNodeLifecycleManager = ChildNodeLifecycleManager( @@ -66,7 +66,7 @@ abstract class ParentNode( childNodeLifecycleManager.launch() } - fun childOrCreate(element: Element): ChildEntry.Initialized = + fun childOrCreate(element: Element): ChildEntry.Initialized = childNodeCreationManager.childOrCreate(element) override fun updateLifecycleState(state: Lifecycle.State) { diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt index 4acbd33a9..fd347ae10 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNodeView.kt @@ -3,10 +3,10 @@ package com.bumble.appyx.navigation.node import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -interface ParentNodeView : NodeView { +interface ParentNodeView : NodeView { @Composable - fun ParentNode.NodeView(modifier: Modifier) + fun ParentNode.NodeView(modifier: Modifier) /** * Do not override this function. Parent views should implement NodeView method. @@ -14,7 +14,7 @@ interface ParentNodeView : NodeView { @Suppress("UNCHECKED_CAST") @Composable override fun View(modifier: Modifier) { - val node = LocalNode.current as? ParentNode + val node = LocalNode.current as? ParentNode ?: error("${this::class} is not provided to the appropriate ParentNode") node.NodeView(modifier = modifier) } From bc90b31dcac0339bde3c7b7359b34e6342c6124e Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 19:36:13 +0000 Subject: [PATCH 17/25] Rename InteractionTarget to NavTarget in demo apps --- .../navigation/composable/PermanentChild.kt | 6 +- .../spotlighthero/ExitHeroModeStrategy.kt | 4 +- .../component/spotlighthero/SpotlightHero.kt | 16 ++--- .../spotlighthero/SpotlightHeroModel.kt | 36 +++++------ .../spotlighthero/operation/Activate.kt | 16 ++--- .../spotlighthero/operation/First.kt | 16 ++--- .../component/spotlighthero/operation/Last.kt | 16 ++--- .../component/spotlighthero/operation/Next.kt | 16 ++--- .../spotlighthero/operation/Previous.kt | 16 ++--- .../spotlighthero/operation/SetHeroMode.kt | 12 ++-- .../spotlighthero/operation/ToggleHeroMode.kt | 12 ++-- .../visualisation/SpotlightHeroGestures.kt | 8 +-- .../SpotlightHeroVisualisation.kt | 4 +- .../SpotlightHeroDefaultVisualisation.kt | 18 +++--- .../node/datingcards/DatingCardsNode.kt | 16 ++--- .../node/backstack/BackStackExamplesNode.kt | 40 ++++++------ .../node/backstack/BackStackNode.kt | 24 +++---- .../backstack/debug/BackstackDebugNode.kt | 28 ++++---- .../node/container/ContainerNode.kt | 64 +++++++++---------- .../node/modal/ModalExamplesNode.kt | 18 +++--- .../node/permanentchild/PermanentChildNode.kt | 24 +++---- .../navigation/node/promoter/PromoterNode.kt | 14 ++-- .../node/spotlight/SpotlightNode.kt | 20 +++--- .../SpotlightObserveTransitionsExampleNode.kt | 20 +++--- .../spotlight/debug/SpotlightDebugNode.kt | 18 +++--- 25 files changed, 241 insertions(+), 241 deletions(-) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt index 8144a866b..e947fda64 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/PermanentChild.kt @@ -14,16 +14,16 @@ import kotlinx.coroutines.flow.SharingStarted @Composable fun ParentNode.PermanentChild( permanentAppyxComponent: PermanentAppyxComponent, - reference: NavTarget, + navTarget: NavTarget, modifier: Modifier = Modifier ) { val scope = rememberCoroutineScope() - val child by remember(reference, permanentAppyxComponent) { + val child by remember(navTarget, permanentAppyxComponent) { children .mapState(scope, SharingStarted.WhileSubscribed()) { childrenMap -> childrenMap .keys - .find { it.interactionTarget == reference } + .find { it.interactionTarget == navTarget } ?.let { childOrCreate(it) } } }.collectAsState() diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/ExitHeroModeStrategy.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/ExitHeroModeStrategy.kt index 81b6c6a0c..75f7bcfff 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/ExitHeroModeStrategy.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/ExitHeroModeStrategy.kt @@ -10,10 +10,10 @@ import com.bumble.appyx.navigation.component.spotlighthero.operation.SetHeroMode import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow -class ExitHeroModeStrategy( +class ExitHeroModeStrategy( val scope: CoroutineScope, val animationSpec: AnimationSpec? = null -) : BaseBackPressHandlerStrategy>() { +) : BaseBackPressHandlerStrategy>() { override val canHandleBackPress: StateFlow by lazy { transitionModel.output.mapState(scope) { output -> diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHero.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHero.kt index 382fad9e3..da396f5b6 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHero.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHero.kt @@ -20,11 +20,11 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.update -open class SpotlightHero( +open class SpotlightHero( scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Main), - private val model: SpotlightHeroModel, - visualisation: (UiContext) -> SpotlightHeroVisualisation, - gestureFactory: (TransitionBounds) -> GestureFactory> = { + private val model: SpotlightHeroModel, + visualisation: (UiContext) -> SpotlightHeroVisualisation, + gestureFactory: (TransitionBounds) -> GestureFactory> = { GestureFactory.Noop() }, animationSpec: AnimationSpec = spring(), @@ -35,7 +35,7 @@ open class SpotlightHero( ), disableAnimations: Boolean = false, isDebug: Boolean = false -) : BaseAppyxComponent>( +) : BaseAppyxComponent>( scope = scope, model = model, visualisation = visualisation, @@ -46,13 +46,13 @@ open class SpotlightHero( backPressStrategy = ExitHeroModeStrategy(scope), isDebug = isDebug ) { - val currentState: State + val currentState: State get() = model.currentState val activeIndex: StateFlow = model.output .mapState(scope) { it.currentTargetState.activeIndex } - val activeElement: StateFlow = model.output + val activeElement: StateFlow = model.output .mapState(scope) { it.currentTargetState.activeElement } val mode: StateFlow = model.output @@ -67,7 +67,7 @@ open class SpotlightHero( .collectAsState().value .collectAsState().value - override fun onVisualisationReady(visualisation: Visualisation>) { + override fun onVisualisationReady(visualisation: Visualisation>) { super.onVisualisationReady(visualisation) _heroProgress.update { (visualisation as SpotlightHeroVisualisation).heroProgress.renderValueFlow diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt index fce44d52b..b4793f57a 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt @@ -9,12 +9,12 @@ import com.bumble.appyx.utils.multiplatform.Parcelable import com.bumble.appyx.utils.multiplatform.Parcelize import com.bumble.appyx.utils.multiplatform.RawValue -class SpotlightHeroModel( - items: List>, +class SpotlightHeroModel( + items: List>, initialMode: Mode = Mode.LIST, initialActiveIndex: Float = 0f, savedStateMap: SavedStateMap?, -) : BaseTransitionModel>( +) : BaseTransitionModel>( savedStateMap = savedStateMap ) { enum class Mode { @@ -22,16 +22,16 @@ class SpotlightHeroModel( } @Parcelize - data class State( + data class State( val mode: Mode = Mode.LIST, - val positions: @RawValue List>, + val positions: @RawValue List>, val activeIndex: Float ) : Parcelable { @Parcelize - data class Position( - val backdrop: Element, - val main: Element, + data class Position( + val backdrop: Element, + val main: Element, ) : Parcelable fun hasPrevious(): Boolean = @@ -40,11 +40,11 @@ class SpotlightHeroModel( fun hasNext(): Boolean = activeIndex <= positions.lastIndex - 1 - val activeElement: InteractionTarget = - positions[activeIndex.toInt()].main.interactionTarget + val activeElement: NavTarget = + positions[activeIndex.toInt()].main.NavTarget } - override val initialState: State = + override val initialState: State = State( mode = initialMode, positions = items.map { @@ -56,22 +56,22 @@ class SpotlightHeroModel( activeIndex = initialActiveIndex ) - val currentState: State + val currentState: State get() = output.value.currentTargetState - override fun State.removeDestroyedElement( - element: Element - ): State = + override fun State.removeDestroyedElement( + element: Element + ): State = this - override fun State.removeDestroyedElements(): State = + override fun State.removeDestroyedElements(): State = this - override fun State.availableElements(): Set> = + override fun State.availableElements(): Set> = positions .flatMap { listOf(it.backdrop, it.main) } .toSet() - override fun State.destroyedElements(): Set> = + override fun State.destroyedElements(): Set> = emptySet() } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Activate.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Activate.kt index 340a70f74..1cbae47a9 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Activate.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Activate.kt @@ -8,29 +8,29 @@ import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHero import com.bumble.appyx.utils.multiplatform.Parcelize @Parcelize -class Activate( +class Activate( private val index: Float, override var mode: Operation.Mode = Operation.Mode.IMPOSED -) : BaseOperation>() { +) : BaseOperation>() { - override fun isApplicable(state: SpotlightHeroModel.State): Boolean = + override fun isApplicable(state: SpotlightHeroModel.State): Boolean = index != state.activeIndex && (index in 0f..state.positions.lastIndex.toFloat()) override fun createFromState( - baseLineState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + baseLineState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = baseLineState override fun createTargetState( - fromState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + fromState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = fromState.copy( activeIndex = index, ) } -fun SpotlightHero.activate( +fun SpotlightHero.activate( index: Float, animationSpec: AnimationSpec = defaultAnimationSpec, mode: Operation.Mode = Operation.Mode.IMPOSED diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/First.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/First.kt index f71f51851..7be16906a 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/First.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/First.kt @@ -9,27 +9,27 @@ import com.bumble.appyx.utils.multiplatform.Parcelize @Parcelize -class First( +class First( override var mode: Operation.Mode = Operation.Mode.IMPOSED -) : BaseOperation>() { +) : BaseOperation>() { - override fun isApplicable(state: SpotlightHeroModel.State): Boolean = + override fun isApplicable(state: SpotlightHeroModel.State): Boolean = true override fun createFromState( - baseLineState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + baseLineState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = baseLineState override fun createTargetState( - fromState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + fromState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = fromState.copy( activeIndex = 0f, ) } -fun SpotlightHero.first( +fun SpotlightHero.first( animationSpec: AnimationSpec = defaultAnimationSpec, mode: Operation.Mode = Operation.Mode.IMPOSED ) { diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Last.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Last.kt index 6be51dae9..c80b818e2 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Last.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Last.kt @@ -9,27 +9,27 @@ import com.bumble.appyx.utils.multiplatform.Parcelize @Parcelize -class Last( +class Last( override var mode: Operation.Mode = Operation.Mode.IMPOSED -) : BaseOperation>() { +) : BaseOperation>() { - override fun isApplicable(state: SpotlightHeroModel.State): Boolean = + override fun isApplicable(state: SpotlightHeroModel.State): Boolean = true override fun createFromState( - baseLineState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + baseLineState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = baseLineState override fun createTargetState( - fromState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + fromState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = fromState.copy( activeIndex = fromState.positions.lastIndex.toFloat(), ) } -fun SpotlightHero.last( +fun SpotlightHero.last( animationSpec: AnimationSpec = defaultAnimationSpec, mode: Operation.Mode = Operation.Mode.IMPOSED ) { diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Next.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Next.kt index b7e958cd1..471ef50fe 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Next.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Next.kt @@ -8,27 +8,27 @@ import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel import com.bumble.appyx.utils.multiplatform.Parcelize @Parcelize -class Next( +class Next( override var mode: Operation.Mode = Operation.Mode.IMPOSED -) : BaseOperation>() { +) : BaseOperation>() { - override fun isApplicable(state: SpotlightHeroModel.State): Boolean = + override fun isApplicable(state: SpotlightHeroModel.State): Boolean = state.hasNext() override fun createFromState( - baseLineState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + baseLineState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = baseLineState override fun createTargetState( - fromState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + fromState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = fromState.copy( activeIndex = fromState.activeIndex + 1f ) } -fun SpotlightHero.next( +fun SpotlightHero.next( animationSpec: AnimationSpec = defaultAnimationSpec, mode: Operation.Mode = Operation.Mode.IMPOSED ) { diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Previous.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Previous.kt index 6305b1408..e672bcd0f 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Previous.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/Previous.kt @@ -9,27 +9,27 @@ import com.bumble.appyx.utils.multiplatform.Parcelize @Parcelize -class Previous( +class Previous( override var mode: Operation.Mode = Operation.Mode.IMPOSED -) : BaseOperation>() { +) : BaseOperation>() { - override fun isApplicable(state: SpotlightHeroModel.State): Boolean = + override fun isApplicable(state: SpotlightHeroModel.State): Boolean = state.hasPrevious() override fun createFromState( - baseLineState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + baseLineState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = baseLineState override fun createTargetState( - fromState: SpotlightHeroModel.State - ): SpotlightHeroModel.State = + fromState: SpotlightHeroModel.State + ): SpotlightHeroModel.State = fromState.copy( activeIndex = fromState.activeIndex - 1f, ) } -fun SpotlightHero.previous( +fun SpotlightHero.previous( animationSpec: AnimationSpec = defaultAnimationSpec, mode: Operation.Mode = Operation.Mode.IMPOSED ) { diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/SetHeroMode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/SetHeroMode.kt index 55292b581..5471cbcd9 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/SetHeroMode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/SetHeroMode.kt @@ -9,24 +9,24 @@ import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.St import com.bumble.appyx.utils.multiplatform.Parcelize @Parcelize -class SetHeroMode( +class SetHeroMode( private val heroMode: SpotlightHeroModel.Mode, override var mode: Operation.Mode = Operation.Mode.KEYFRAME -) : BaseOperation>() { +) : BaseOperation>() { - override fun isApplicable(state: State): Boolean = + override fun isApplicable(state: State): Boolean = state.mode != heroMode - override fun createFromState(baseLineState: State): State = + override fun createFromState(baseLineState: State): State = baseLineState - override fun createTargetState(fromState: State): State = + override fun createTargetState(fromState: State): State = fromState.copy( mode = heroMode ) } -fun SpotlightHero.setHeroMode( +fun SpotlightHero.setHeroMode( heroMode: SpotlightHeroModel.Mode, animationSpec: AnimationSpec = defaultAnimationSpec, mode: Operation.Mode = Operation.Mode.IMMEDIATE diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/ToggleHeroMode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/ToggleHeroMode.kt index 447c40a88..37d790049 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/ToggleHeroMode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/operation/ToggleHeroMode.kt @@ -10,17 +10,17 @@ import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel.St import com.bumble.appyx.utils.multiplatform.Parcelize @Parcelize -class ToggleHeroMode( +class ToggleHeroMode( override var mode: Operation.Mode = Operation.Mode.KEYFRAME -) : BaseOperation>() { +) : BaseOperation>() { - override fun isApplicable(state: State): Boolean = + override fun isApplicable(state: State): Boolean = true - override fun createFromState(baseLineState: State): State = + override fun createFromState(baseLineState: State): State = baseLineState - override fun createTargetState(fromState: State): State = + override fun createTargetState(fromState: State): State = fromState.copy( mode = when (fromState.mode) { LIST -> HERO @@ -29,7 +29,7 @@ class ToggleHeroMode( ) } -fun SpotlightHero.toggleHeroMode( +fun SpotlightHero.toggleHeroMode( animationSpec: AnimationSpec = defaultAnimationSpec, mode: Operation.Mode = Operation.Mode.IMMEDIATE ) { diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroGestures.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroGestures.kt index 4b9e6ec06..1e103fae0 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroGestures.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroGestures.kt @@ -14,17 +14,17 @@ import com.bumble.appyx.navigation.component.spotlighthero.operation.Next import com.bumble.appyx.navigation.component.spotlighthero.operation.Previous import com.bumble.appyx.navigation.component.spotlighthero.operation.SetHeroMode -class SpotlightHeroGestures( +class SpotlightHeroGestures( transitionBounds: TransitionBounds, -) : GestureFactory> { +) : GestureFactory> { private val width = transitionBounds.widthPx.toFloat() private val height = transitionBounds.heightPx.toFloat() override fun createGesture( - state: SpotlightHeroModel.State, + state: SpotlightHeroModel.State, delta: Offset, density: Density - ): Gesture> = + ): Gesture> = when (dragDirection4(delta)) { Drag.Direction4.LEFT -> Gesture( operation = Next(), diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroVisualisation.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroVisualisation.kt index e9f4ac0d2..00452534d 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroVisualisation.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/SpotlightHeroVisualisation.kt @@ -4,8 +4,8 @@ import com.bumble.appyx.interactions.core.ui.Visualisation import com.bumble.appyx.navigation.component.spotlighthero.SpotlightHeroModel import com.bumble.appyx.navigation.component.spotlighthero.visualisation.property.HeroProgress -interface SpotlightHeroVisualisation : - Visualisation> { +interface SpotlightHeroVisualisation : + Visualisation> { val heroProgress: HeroProgress } diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt index ae168a063..1cde4ca54 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/visualisation/default/SpotlightHeroDefaultVisualisation.kt @@ -21,11 +21,11 @@ import com.bumble.appyx.navigation.component.spotlighthero.visualisation.Spotlig import com.bumble.appyx.navigation.component.spotlighthero.visualisation.property.HeroProgress import com.bumble.appyx.transitionmodel.BaseVisualisation -class SpotlightHeroDefaultVisualisation( +class SpotlightHeroDefaultVisualisation( uiContext: UiContext, - initialState: State -) : SpotlightHeroVisualisation, - BaseVisualisation, TargetUiState, MutableUiState>( + initialState: State +) : SpotlightHeroVisualisation, + BaseVisualisation, TargetUiState, MutableUiState>( uiContext = uiContext ) { private val scrollX = GenericFloatProperty( @@ -36,10 +36,10 @@ class SpotlightHeroDefaultVisualisation( coroutineScope = uiContext.coroutineScope, target = GenericFloatProperty.Target(initialState.heroProgress()) ) - override val viewpointDimensions: List) -> Float, GenericFloatProperty>> = + override val viewpointDimensions: List) -> Float, GenericFloatProperty>> = listOf( - { state: State -> state.activeIndex } to scrollX, - { state: State -> state.heroProgress() } to heroProgress + { state: State -> state.activeIndex } to scrollX, + { state: State -> state.heroProgress() } to heroProgress ) private val backdropStandard: TargetUiState = TargetUiState( @@ -69,13 +69,13 @@ class SpotlightHeroDefaultVisualisation( positionOffset = PositionOffset.Target(DpOffset(0.dp, 40.dp)), ) - private fun State.heroProgress(): Float = + private fun State.heroProgress(): Float = when (mode) { LIST -> 0f HERO -> 1f } - override fun State.toUiTargets(): List> = + override fun State.toUiTargets(): List> = positions.flatMapIndexed { index, position -> listOf( MatchedTargetUiState( diff --git a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt index f815b9a62..8c6aa66fd 100644 --- a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt +++ b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt @@ -13,7 +13,7 @@ import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode -import com.bumble.appyx.navigation.node.datingcards.DatingCardsNode.InteractionTarget +import com.bumble.appyx.navigation.node.datingcards.DatingCardsNode.NavTarget import com.bumble.appyx.navigation.node.profilecard.ProfileCardNode import com.bumble.appyx.navigation.ui.appyx_dark import com.bumble.appyx.samples.common.profile.Profile @@ -22,11 +22,11 @@ import com.bumble.appyx.utils.multiplatform.Parcelize class DatingCardsNode( buildContext: BuildContext, - private val cards: Cards = + private val cards: Cards = Cards( model = CardsModel( initialItems = Profile.allProfiles.shuffled().map { - InteractionTarget.ProfileCard(it) + NavTarget.ProfileCard(it) }, savedStateMap = buildContext.savedStateMap ), @@ -34,18 +34,18 @@ class DatingCardsNode( gestureFactory = { CardsVisualisation.Gestures(it) }, ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = cards ) { - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - class ProfileCard(val profile: Profile) : InteractionTarget() + class ProfileCard(val profile: Profile) : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = - ProfileCardNode(buildContext, (navTarget as InteractionTarget.ProfileCard).profile) + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = + ProfileCardNode(buildContext, (navTarget as NavTarget.ProfileCard).profile) @Composable override fun View(modifier: Modifier) { diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt index 1f73fa2f5..0c16a949c 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt @@ -25,7 +25,7 @@ import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode -import com.bumble.appyx.navigation.node.backstack.BackStackExamplesNode.InteractionTarget +import com.bumble.appyx.navigation.node.backstack.BackStackExamplesNode.NavTarget import com.bumble.appyx.navigation.node.node import com.bumble.appyx.navigation.ui.TextButton import com.bumble.appyx.navigation.ui.appyx_dark @@ -35,53 +35,53 @@ import com.bumble.appyx.utils.multiplatform.Parcelize class BackStackExamplesNode( buildContext: BuildContext, - private val backStack: BackStack = BackStack( + private val backStack: BackStack = BackStack( model = BackStackModel( - initialTargets = listOf(InteractionTarget.BackStackPicker), + initialTargets = listOf(NavTarget.BackStackPicker), savedStateMap = buildContext.savedStateMap ), visualisation = { BackStackSlider(it) } ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = backStack ) { private val padding = mutableStateOf(16) - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - object BackStackPicker : InteractionTarget() + object BackStackPicker : NavTarget() @Parcelize - object BackStackSlider : InteractionTarget() + object BackStackSlider : NavTarget() @Parcelize - object BackStackFader : InteractionTarget() + object BackStackFader : NavTarget() @Parcelize - object BackstackParallax : InteractionTarget() + object BackstackParallax : NavTarget() @Parcelize - object BackStack3D : InteractionTarget() + object BackStack3D : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.BackStackPicker -> node(buildContext) { + is NavTarget.BackStackPicker -> node(buildContext) { BackStackPicker(it) } - is InteractionTarget.BackStackFader -> BackStackNode(buildContext, { + is NavTarget.BackStackFader -> BackStackNode(buildContext, { BackStackFader( it ) }) - is InteractionTarget.BackStackSlider -> BackStackNode(buildContext, { + is NavTarget.BackStackSlider -> BackStackNode(buildContext, { BackStackSlider( it ) }) - is InteractionTarget.BackstackParallax -> BackStackNode( + is NavTarget.BackstackParallax -> BackStackNode( buildContext = buildContext, visualisation = { BackStackParallax(uiContext = it) }, gestureFactory = { BackStackParallax.Gestures(it) }, @@ -89,7 +89,7 @@ class BackStackExamplesNode( ).also { padding.value = 0 } - is InteractionTarget.BackStack3D -> BackStackNode( + is NavTarget.BackStack3D -> BackStackNode( buildContext = buildContext, visualisation = { BackStack3D(it) }, gestureFactory = { BackStack3D.Gestures(it) }, @@ -112,16 +112,16 @@ class BackStackExamplesNode( horizontalAlignment = Alignment.CenterHorizontally, ) { TextButton(text = "BackStack slider") { - backStack.push(InteractionTarget.BackStackSlider) + backStack.push(NavTarget.BackStackSlider) } TextButton(text = "BackStack fader") { - backStack.push(InteractionTarget.BackStackFader) + backStack.push(NavTarget.BackStackFader) } TextButton(text = "BackStack parallax") { - backStack.push(InteractionTarget.BackstackParallax) + backStack.push(NavTarget.BackstackParallax) } TextButton(text = "BackStack 3D") { - backStack.push(InteractionTarget.BackStack3D) + backStack.push(NavTarget.BackStack3D) } } } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt index c1b5595b8..95d133362 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt @@ -47,33 +47,33 @@ import kotlin.random.Random class BackStackNode( buildContext: BuildContext, - visualisation: (UiContext) -> Visualisation>, - gestureFactory: (TransitionBounds) -> GestureFactory> = { + visualisation: (UiContext) -> Visualisation>, + gestureFactory: (TransitionBounds) -> GestureFactory> = { GestureFactory.Noop() }, gestureSettleConfig: GestureSettleConfig = GestureSettleConfig(), private val isMaxSize: Boolean = false, - private val backStack: BackStack = BackStack( + private val backStack: BackStack = BackStack( model = BackStackModel( - initialTargets = listOf(InteractionTarget.Child(1)), + initialTargets = listOf(NavTarget.Child(1)), savedStateMap = buildContext.savedStateMap ), visualisation = visualisation, gestureFactory = gestureFactory, gestureSettleConfig = gestureSettleConfig, ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = backStack, ) { - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - class Child(val index: Int) : InteractionTarget() + class Child(val index: Int) : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Child -> node(buildContext) { + is NavTarget.Child -> node(buildContext) { val backgroundColor = rememberSaveable(saver = ColorSaver) { colors.shuffled().random() } @@ -130,16 +130,16 @@ class BackStackNode( horizontalArrangement = Arrangement.SpaceEvenly ) { TextButton(text = "Push") { - backStack.push(InteractionTarget.Child(Random.nextInt(20))) + backStack.push(NavTarget.Child(Random.nextInt(20))) } TextButton(text = "Pop") { backStack.pop() } TextButton(text = "Replace") { - backStack.replace(InteractionTarget.Child(Random.nextInt(20))) + backStack.replace(NavTarget.Child(Random.nextInt(20))) } TextButton(text = "New root") { - backStack.newRoot(InteractionTarget.Child(Random.nextInt(20))) + backStack.newRoot(NavTarget.Child(Random.nextInt(20))) } } } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt index d277a3d76..65676494c 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt @@ -30,7 +30,7 @@ import com.bumble.appyx.navigation.composable.KnobControl import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode -import com.bumble.appyx.navigation.node.backstack.debug.BackstackDebugNode.InteractionTarget +import com.bumble.appyx.navigation.node.backstack.debug.BackstackDebugNode.NavTarget import com.bumble.appyx.navigation.node.node import com.bumble.appyx.navigation.ui.appyx_dark import com.bumble.appyx.utils.multiplatform.Parcelable @@ -38,37 +38,37 @@ import com.bumble.appyx.utils.multiplatform.Parcelize class BackstackDebugNode( buildContext: BuildContext, - private val backStack: BackStack = BackStack( + private val backStack: BackStack = BackStack( model = BackStackModel( - initialTargets = listOf(InteractionTarget.Child(1)), + initialTargets = listOf(NavTarget.Child(1)), savedStateMap = buildContext.savedStateMap, ), visualisation = { BackStackSlider(it) } ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = backStack ) { init { - backStack.push(InteractionTarget.Child(2)) - backStack.push(InteractionTarget.Child(3)) - backStack.push(InteractionTarget.Child(4)) - backStack.push(InteractionTarget.Child(5)) - backStack.replace(InteractionTarget.Child(6)) + backStack.push(NavTarget.Child(2)) + backStack.push(NavTarget.Child(3)) + backStack.push(NavTarget.Child(4)) + backStack.push(NavTarget.Child(5)) + backStack.replace(NavTarget.Child(6)) backStack.pop() backStack.pop() - backStack.newRoot(InteractionTarget.Child(1)) + backStack.newRoot(NavTarget.Child(1)) } - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - class Child(val index: Int) : InteractionTarget() + class Child(val index: Int) : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Child -> node(buildContext) { + is NavTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt index 912e8ce38..36163c32f 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt @@ -21,7 +21,7 @@ import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode import com.bumble.appyx.navigation.node.backstack.BackStackExamplesNode import com.bumble.appyx.navigation.node.backstack.debug.BackstackDebugNode -import com.bumble.appyx.navigation.node.container.ContainerNode.InteractionTarget +import com.bumble.appyx.navigation.node.container.ContainerNode.NavTarget import com.bumble.appyx.navigation.node.modal.ModalExamplesNode import com.bumble.appyx.navigation.node.node import com.bumble.appyx.navigation.node.permanentchild.PermanentChildNode @@ -34,65 +34,65 @@ import com.bumble.appyx.utils.multiplatform.Parcelize class ContainerNode( buildContext: BuildContext, - private val backStack: BackStack = BackStack( + private val backStack: BackStack = BackStack( model = BackStackModel( - initialTargets = listOf(InteractionTarget.Selector), + initialTargets = listOf(NavTarget.Selector), savedStateMap = buildContext.savedStateMap, ), visualisation = { BackStackSlider(it) } ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = backStack ) { - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - object Selector : InteractionTarget() + object Selector : NavTarget() @Parcelize - object PermanentChild : InteractionTarget() + object PermanentChild : NavTarget() // @Parcelize -// object DatingCards : InteractionTarget() +// object DatingCards : NavTarget() @Parcelize - object SpotlightExperiment : InteractionTarget() + object SpotlightExperiment : NavTarget() @Parcelize - object ObservingTransitionsExample : InteractionTarget() + object ObservingTransitionsExample : NavTarget() @Parcelize - object BackStackExperimentDebug : InteractionTarget() + object BackStackExperimentDebug : NavTarget() @Parcelize - object BackStack : InteractionTarget() + object BackStack : NavTarget() @Parcelize - object Modal : InteractionTarget() + object Modal : NavTarget() @Parcelize - object PromoterExperiment : InteractionTarget() + object PromoterExperiment : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Selector -> node(buildContext) { modifier -> + is NavTarget.Selector -> node(buildContext) { modifier -> Selector(modifier) } - is InteractionTarget.PermanentChild -> PermanentChildNode(buildContext) -// is InteractionTarget.DatingCards -> DatingCardsNode(buildContext) - is InteractionTarget.SpotlightExperiment -> SpotlightNode(buildContext) - is InteractionTarget.ObservingTransitionsExample -> SpotlightObserveTransitionsExampleNode( + is NavTarget.PermanentChild -> PermanentChildNode(buildContext) +// is NavTarget.DatingCards -> DatingCardsNode(buildContext) + is NavTarget.SpotlightExperiment -> SpotlightNode(buildContext) + is NavTarget.ObservingTransitionsExample -> SpotlightObserveTransitionsExampleNode( buildContext ) - is InteractionTarget.BackStack -> BackStackExamplesNode(buildContext) - is InteractionTarget.BackStackExperimentDebug -> BackstackDebugNode(buildContext) - is InteractionTarget.Modal -> ModalExamplesNode(buildContext) - is InteractionTarget.PromoterExperiment -> PromoterNode(buildContext) + is NavTarget.BackStack -> BackStackExamplesNode(buildContext) + is NavTarget.BackStackExperimentDebug -> BackstackDebugNode(buildContext) + is NavTarget.Modal -> ModalExamplesNode(buildContext) + is NavTarget.PromoterExperiment -> PromoterNode(buildContext) } @@ -111,28 +111,28 @@ class ContainerNode( horizontalAlignment = Alignment.CenterHorizontally, ) { // TextButton(text = "Dating Cards") { -//// backStack.push(InteractionTarget.DatingCards) +//// backStack.push(NavTarget.DatingCards) // } TextButton(text = "Spotlight") { - backStack.push(InteractionTarget.SpotlightExperiment) + backStack.push(NavTarget.SpotlightExperiment) } TextButton(text = "Observe transitions example") { - backStack.push(InteractionTarget.ObservingTransitionsExample) + backStack.push(NavTarget.ObservingTransitionsExample) } TextButton(text = "Backstack Examples") { - backStack.push(InteractionTarget.BackStack) + backStack.push(NavTarget.BackStack) } TextButton(text = "Backstack Debug") { - backStack.push(InteractionTarget.BackStackExperimentDebug) + backStack.push(NavTarget.BackStackExperimentDebug) } TextButton(text = "Promoter") { - backStack.push(InteractionTarget.PromoterExperiment) + backStack.push(NavTarget.PromoterExperiment) } TextButton(text = "Permanent Child") { - backStack.push(InteractionTarget.PermanentChild) + backStack.push(NavTarget.PermanentChild) } TextButton(text = "Modal") { - backStack.push(InteractionTarget.Modal) + backStack.push(NavTarget.Modal) } } } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt index 833192485..3e85636da 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt @@ -27,7 +27,7 @@ import com.bumble.appyx.navigation.composable.AppyxNavigationComponent import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode -import com.bumble.appyx.navigation.node.modal.ModalExamplesNode.InteractionTarget +import com.bumble.appyx.navigation.node.modal.ModalExamplesNode.NavTarget import com.bumble.appyx.navigation.node.node import com.bumble.appyx.navigation.ui.TextButton import com.bumble.appyx.navigation.ui.appyx_dark @@ -38,26 +38,26 @@ import kotlin.random.Random class ModalExamplesNode( buildContext: BuildContext, - private val modal: Modal = Modal( + private val modal: Modal = Modal( model = ModalModel( - initialElements = listOf(InteractionTarget.Child), + initialElements = listOf(NavTarget.Child), savedStateMap = buildContext.savedStateMap ), visualisation = { ModalVisualisation(it) } ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = modal ) { - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - object Child : InteractionTarget() + object Child : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Child -> node(buildContext) { + is NavTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( @@ -101,7 +101,7 @@ class ModalExamplesNode( modifier = Modifier .padding(horizontal = 4.dp), ) { - modal.add(InteractionTarget.Child) + modal.add(NavTarget.Child) } TextButton( text = "Show", diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt index b065e64f8..67c85a3a3 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/permanentchild/PermanentChildNode.kt @@ -29,29 +29,29 @@ import com.bumble.appyx.utils.multiplatform.Parcelize class PermanentChildNode( buildContext: BuildContext, - private val permanentAppyxComponent: PermanentAppyxComponent = + private val permanentAppyxComponent: PermanentAppyxComponent = PermanentAppyxComponent( savedStateMap = buildContext.savedStateMap, initialTargets = listOf( - InteractionTarget.Child1, - InteractionTarget.Child2 + NavTarget.Child1, + NavTarget.Child2 ) ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = permanentAppyxComponent ) { - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - object Child1 : InteractionTarget() + object Child1 : NavTarget() @Parcelize - object Child2 : InteractionTarget() + object Child2 : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Child1 -> node(buildContext) { + is NavTarget.Child1 -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( modifier = Modifier @@ -70,7 +70,7 @@ class PermanentChildNode( } } - is InteractionTarget.Child2 -> node(buildContext) { + is NavTarget.Child2 -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( modifier = Modifier @@ -99,11 +99,11 @@ class PermanentChildNode( ) { PermanentChild( permanentAppyxComponent = permanentAppyxComponent, - reference = InteractionTarget.Child1 + navTarget = NavTarget.Child1 ) PermanentChild( permanentAppyxComponent = permanentAppyxComponent, - reference = InteractionTarget.Child2 + navTarget = NavTarget.Child2 ) } } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt index 1c2927ced..12182ea6b 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt @@ -38,14 +38,14 @@ import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode import com.bumble.appyx.navigation.node.node -import com.bumble.appyx.navigation.node.promoter.PromoterNode.InteractionTarget -import com.bumble.appyx.navigation.node.promoter.PromoterNode.InteractionTarget.Child +import com.bumble.appyx.navigation.node.promoter.PromoterNode.NavTarget +import com.bumble.appyx.navigation.node.promoter.PromoterNode.NavTarget.Child import com.bumble.appyx.utils.multiplatform.Parcelable import com.bumble.appyx.utils.multiplatform.Parcelize class PromoterNode( buildContext: BuildContext, - private val promoter: Promoter = Promoter( + private val promoter: Promoter = Promoter( model = PromoterModel( savedStateMap = buildContext.savedStateMap ), @@ -56,7 +56,7 @@ class PromoterNode( }, animationSpec = spring(stiffness = Spring.StiffnessVeryLow / 20) ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = promoter ) { @@ -68,12 +68,12 @@ class PromoterNode( promoter.addFirst(Child(4)) } - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - class Child(val index: Int) : InteractionTarget() + class Child(val index: Int) : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { is Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt index 78ac85027..2a77485d8 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt @@ -39,37 +39,37 @@ import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode import com.bumble.appyx.navigation.node.node -import com.bumble.appyx.navigation.node.spotlight.SpotlightNode.InteractionTarget +import com.bumble.appyx.navigation.node.spotlight.SpotlightNode.NavTarget import com.bumble.appyx.navigation.ui.appyx_dark import com.bumble.appyx.utils.multiplatform.Parcelable import com.bumble.appyx.utils.multiplatform.Parcelize class SpotlightNode( buildContext: BuildContext, - private val model: SpotlightModel = SpotlightModel( - items = List(7) { InteractionTarget.Child(it) }, + private val model: SpotlightModel = SpotlightModel( + items = List(7) { NavTarget.Child(it) }, initialActiveIndex = 0f, savedStateMap = buildContext.savedStateMap, ), - private val spotlight: Spotlight = Spotlight( + private val spotlight: Spotlight = Spotlight( model = model, visualisation = { SpotlightSlider(it, model.currentState) }, gestureFactory = { SpotlightSlider.Gestures(it) } ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = spotlight ) { - private val newItems = List(7) { InteractionTarget.Child(it * 3) } + private val newItems = List(7) { NavTarget.Child(it * 3) } - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - class Child(val index: Int) : InteractionTarget() + class Child(val index: Int) : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Child -> node(buildContext) { modifier -> + is NavTarget.Child -> node(buildContext) { modifier -> val backgroundColorIdx = rememberSaveable { colors.shuffled().indices.random() } val backgroundColor = colors[backgroundColorIdx] var clicked by rememberSaveable { mutableStateOf(false) } diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt index a3d7986fa..a6ef431ab 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt @@ -38,37 +38,37 @@ import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode import com.bumble.appyx.navigation.node.node -import com.bumble.appyx.navigation.node.spotlight.SpotlightObserveTransitionsExampleNode.InteractionTarget +import com.bumble.appyx.navigation.node.spotlight.SpotlightObserveTransitionsExampleNode.NavTarget import com.bumble.appyx.navigation.ui.appyx_dark import com.bumble.appyx.utils.multiplatform.Parcelable import com.bumble.appyx.utils.multiplatform.Parcelize class SpotlightObserveTransitionsExampleNode( buildContext: BuildContext, - private val model: SpotlightModel = SpotlightModel( - items = List(7) { InteractionTarget.Child(it) }, + private val model: SpotlightModel = SpotlightModel( + items = List(7) { NavTarget.Child(it) }, initialActiveIndex = 0f, savedStateMap = buildContext.savedStateMap ), - private val spotlight: Spotlight = Spotlight( + private val spotlight: Spotlight = Spotlight( model = model, visualisation = { SpotlightSliderRotation(it, model.currentState) }, gestureFactory = { SpotlightSlider.Gestures(it) } ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = spotlight ) { - private val newItems = List(7) { InteractionTarget.Child(it * 3) } + private val newItems = List(7) { NavTarget.Child(it * 3) } - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - class Child(val index: Int) : InteractionTarget() + class Child(val index: Int) : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Child -> node(buildContext) { modifier -> + is NavTarget.Child -> node(buildContext) { modifier -> val backgroundColor = remember { colors.shuffled().random() } Box( modifier = modifier diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt index 51dde151b..6e3b76703 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt @@ -31,24 +31,24 @@ import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode import com.bumble.appyx.navigation.node.node -import com.bumble.appyx.navigation.node.spotlight.debug.SpotlightDebugNode.InteractionTarget +import com.bumble.appyx.navigation.node.spotlight.debug.SpotlightDebugNode.NavTarget import com.bumble.appyx.navigation.ui.appyx_dark import com.bumble.appyx.utils.multiplatform.Parcelable import com.bumble.appyx.utils.multiplatform.Parcelize class SpotlightDebugNode( buildContext: BuildContext, - private val model: SpotlightModel = SpotlightModel( - items = List(7) { InteractionTarget.Child(it + 1) }, + private val model: SpotlightModel = SpotlightModel( + items = List(7) { NavTarget.Child(it + 1) }, initialActiveIndex = 0f, savedStateMap = buildContext.savedStateMap ), - private val spotlight: Spotlight = Spotlight( + private val spotlight: Spotlight = Spotlight( model = model, visualisation = { SpotlightSlider(it, model.currentState) }, isDebug = true ) -) : ParentNode( +) : ParentNode( buildContext = buildContext, appyxComponent = spotlight ) { @@ -62,14 +62,14 @@ class SpotlightDebugNode( spotlight.first() } - sealed class InteractionTarget : Parcelable { + sealed class NavTarget : Parcelable { @Parcelize - class Child(val index: Int) : InteractionTarget() + class Child(val index: Int) : NavTarget() } - override fun buildChildNode(navTarget: InteractionTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = when (navTarget) { - is InteractionTarget.Child -> node(buildContext) { + is NavTarget.Child -> node(buildContext) { val backgroundColor = remember { colors.shuffled().random() } Box( modifier = Modifier From b45cd2c5dc9b62312abeab7aed434bbce218ed80 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 19:38:06 +0000 Subject: [PATCH 18/25] Fix migration docs --- documentation/releases/2.0.0-alpha10.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 79e186168..7702f5d49 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -65,10 +65,10 @@ class YourNode( } - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = -+ override fun buildChildNode(reference: NavTarget, buildContext: BuildContext): Node = ++ override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = - when (navTarget) { -+ when (reference) { ++ when (navTarget) { TODO() } ``` @@ -79,8 +79,8 @@ class YourNode( ```diff class SomeVisualisation( /*...*/ --) : BaseVisualisation, TargetUiState, MutableUiState>( -+) : BaseVisualisation, MutableUiState, TargetUiState>( +-) : BaseVisualisation, MutableUiState, TargetUiState>( ++) : BaseVisualisation, TargetUiState, MutableUiState>( ``` From e6bad098f8be0db6bec76864a2b0a7bc38681de9 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 20:05:33 +0000 Subject: [PATCH 19/25] Rename AppyxNavigationComponent -> AppyxNavigationContainer, AppyxInteractionsComponent -> AppyxInteractionsContainer --- .../experimental/cards/android/DatingCards.kt | 4 ++-- .../promoter/android/PromoterExperiment.kt | 4 ++-- .../internal/testdrive/TestDriveExperiment.kt | 4 ++-- ...onsComponent.kt => AppyxInteractionsContainer.kt} | 2 +- ...ationComponent.kt => AppyxNavigationContainer.kt} | 6 +++--- .../bumble/appyx/benchmark/app/node/MosaicNode.kt | 4 ++-- .../appyx/interactions/sample/ModalExperiment.kt | 4 ++-- .../com/bumble/appyx/interactions/widgets/Widgets.kt | 4 ++-- .../ios/src/iosMain/kotlin/AppyxSample.kt | 4 ++-- .../appyx/navigation/node/cakes/CakeListNode.kt | 4 ++-- .../appyx/navigation/node/checkout/CheckoutNode.kt | 4 ++-- .../appyx/navigation/node/loggedout/LoggedOutNode.kt | 4 ++-- .../appyx/navigation/node/profile/ProfileNode.kt | 4 ++-- .../bumble/appyx/navigation/node/root/RootNode.kt | 4 ++-- .../com/bumble/appyx/demos/common/AppyxWebSample.kt | 4 ++-- .../appyx/demos/dragprediction/DragPrediction.kt | 4 ++-- .../appyx/demos/incompletedrag/IncompleteDrag.kt | 4 ++-- .../kotlin/com/bumble/appyx/demos/sample1/Sample1.kt | 4 ++-- .../kotlin/com/bumble/appyx/demos/sample2/Sample2.kt | 4 ++-- .../kotlin/com/bumble/appyx/demos/sample3/Sample3.kt | 4 ++-- .../compose/ComposeNavigationContainerNode.kt | 4 ++-- .../navigation/node/datingcards/DatingCardsNode.kt | 4 ++-- .../node/backstack/BackStackExamplesNode.kt | 4 ++-- .../appyx/navigation/node/backstack/BackStackNode.kt | 4 ++-- .../node/backstack/debug/BackstackDebugNode.kt | 4 ++-- .../appyx/navigation/node/container/ContainerNode.kt | 4 ++-- .../appyx/navigation/node/modal/ModalExamplesNode.kt | 4 ++-- .../appyx/navigation/node/promoter/PromoterNode.kt | 4 ++-- .../appyx/navigation/node/spotlight/SpotlightNode.kt | 4 ++-- .../SpotlightObserveTransitionsExampleNode.kt | 4 ++-- .../node/spotlight/debug/SpotlightDebugNode.kt | 4 ++-- documentation/2.x/migrationguide.md | 6 +++--- documentation/interactions/usage.md | 12 ++++++------ documentation/navigation/quick-start.md | 2 +- documentation/releases/2.0.0-alpha10.md | 8 ++++---- .../appyx/utils/material3/AppyxMaterial3NavNode.kt | 4 ++-- 36 files changed, 78 insertions(+), 78 deletions(-) rename appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/{AppyxInteractionsComponent.kt => AppyxInteractionsContainer.kt} (99%) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/{AppyxNavigationComponent.kt => AppyxNavigationContainer.kt} (92%) diff --git a/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt b/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt index b608bf804..a33ad9010 100644 --- a/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt +++ b/appyx-components/experimental/cards/android/src/main/kotlin/com/bumble/appyx/components/experimental/cards/android/DatingCards.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.unit.dp import com.bumble.appyx.components.experimental.cards.Cards import com.bumble.appyx.components.experimental.cards.CardsModel import com.bumble.appyx.components.experimental.cards.ui.CardsVisualisation -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.gesture.GestureValidator.Companion.permissiveValidator import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.theme.appyx_dark @@ -38,7 +38,7 @@ fun DatingCards(modifier: Modifier = Modifier) { AppyxComponentSetup(cards) - AppyxInteractionsComponent( + AppyxInteractionsContainer( modifier = modifier .fillMaxSize() .background(appyx_dark) diff --git a/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt b/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt index 03630d04f..afdd022ce 100644 --- a/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt +++ b/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt @@ -25,7 +25,7 @@ import com.bumble.appyx.components.experimental.promoter.Promoter import com.bumble.appyx.components.experimental.promoter.PromoterModel import com.bumble.appyx.components.experimental.promoter.operation.addFirst import com.bumble.appyx.components.experimental.promoter.ui.PromoterVisualisation -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -74,7 +74,7 @@ fun PromoterExperiment(modifier: Modifier = Modifier) { val screenWidthPx = (LocalConfiguration.current.screenWidthDp * density.density).roundToInt() val screenHeightPx = (LocalConfiguration.current.screenHeightDp * density.density).roundToInt() - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = promoter, modifier = Modifier .weight(0.9f) diff --git a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt index ba54cc5ea..1f706443d 100644 --- a/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt +++ b/appyx-components/internal/test-drive/common/src/commonMain/kotlin/com/bumble/appyx/components/internal/testdrive/TestDriveExperiment.kt @@ -29,7 +29,7 @@ import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.components.internal.testdrive.ui.rotation.TestDriveRotationVisualisation import com.bumble.appyx.components.internal.testdrive.ui.rotation.TestDriveRotationVisualisation.Companion.toTargetUiState import com.bumble.appyx.components.internal.testdrive.ui.simple.TestDriveSimpleVisualisation -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.gesture.GestureValidator import com.bumble.appyx.interactions.core.gesture.GestureValidator.Companion.defaultValidator import com.bumble.appyx.interactions.core.model.transition.Keyframes @@ -134,7 +134,7 @@ fun TestDriveUi( vertical = 12.dp ) ) { - AppyxInteractionsComponent( + AppyxInteractionsContainer( screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, appyxComponent = testDrive, diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsContainer.kt similarity index 99% rename from appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsComponent.kt rename to appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsContainer.kt index 92951c8ed..d99484062 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/AppyxInteractionsContainer.kt @@ -50,7 +50,7 @@ private val defaultExtraTouch = 48f.dp @Suppress("LongMethod") @Composable -fun AppyxInteractionsComponent( +fun AppyxInteractionsContainer( appyxComponent: BaseAppyxComponent, screenWidthPx: Int, screenHeightPx: Int, diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationContainer.kt similarity index 92% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationContainer.kt index dea2f4835..81d5e5cec 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationComponent.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/composable/AppyxNavigationContainer.kt @@ -5,7 +5,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.gesture.GestureValidator import com.bumble.appyx.interactions.core.model.BaseAppyxComponent import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -17,7 +17,7 @@ import kotlin.math.roundToInt internal val defaultExtraTouch = 48.dp @Composable -fun ParentNode.AppyxNavigationComponent( +fun ParentNode.AppyxNavigationContainer( appyxComponent: BaseAppyxComponent, modifier: Modifier = Modifier, clipToBounds: Boolean = false, @@ -32,7 +32,7 @@ fun ParentNode.AppyxNavigationCom val screenWidthPx = (LocalScreenSize.current.widthDp * density.density).value.roundToInt() val screenHeightPx = (LocalScreenSize.current.heightDp * density.density).value.roundToInt() - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent, screenWidthPx, screenHeightPx, diff --git a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt index b383f331f..c329fad56 100644 --- a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt +++ b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/node/MosaicNode.kt @@ -35,7 +35,7 @@ import com.bumble.appyx.benchmark.app.mosaic.operation.flip import com.bumble.appyx.benchmark.app.mosaic.operation.scatter import com.bumble.appyx.benchmark.app.ui.FlashCard import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -104,7 +104,7 @@ class MosaicNode( .background(Color.Black) .padding(24.dp), ) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = mosaic, modifier = Modifier .align(Alignment.Center) diff --git a/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt b/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt index 3c0b87301..1b4baa631 100644 --- a/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt +++ b/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/sample/ModalExperiment.kt @@ -20,7 +20,7 @@ import com.bumble.appyx.components.modal.ModalModel import com.bumble.appyx.components.modal.operation.add import com.bumble.appyx.components.modal.operation.show import com.bumble.appyx.components.modal.ui.ModalVisualisation -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.ui.context.UiContext import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -84,7 +84,7 @@ fun ModalUi( modifier: Modifier = Modifier, color: Color = Color.Unspecified ) { - AppyxInteractionsComponent( + AppyxInteractionsContainer( screenWidthPx = (LocalConfiguration.current.screenWidthDp * LocalDensity.current.density).roundToInt(), screenHeightPx = (LocalConfiguration.current.screenHeightDp * LocalDensity.current.density).roundToInt(), clipToBounds = false, diff --git a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt index 0fc7d2734..7714fc20b 100644 --- a/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt +++ b/demos/appyx-interactions/desktop/src/desktopMain/kotlin/com/bumble/appyx/interactions/widgets/Widgets.kt @@ -19,7 +19,7 @@ import com.bumble.appyx.components.spotlight.operation.next import com.bumble.appyx.components.spotlight.operation.previous import com.bumble.appyx.components.spotlight.ui.slider.SpotlightSlider import com.bumble.appyx.interactions.Events -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -94,7 +94,7 @@ private fun WidgetsUi( screenHeightPx: Int, modifier: Modifier = Modifier, ) { - AppyxInteractionsComponent( + AppyxInteractionsContainer( clipToBounds = false, appyxComponent = spotlight, modifier = modifier diff --git a/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt b/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt index df791af83..4c834b362 100644 --- a/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt +++ b/demos/appyx-interactions/ios/src/iosMain/kotlin/AppyxSample.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.BaseAppyxComponent import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -56,7 +56,7 @@ internal fun AppyxSample( modifier = modifier, horizontalAlignment = CenterHorizontally, ) { - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = appyxComponent, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt index 277eaf28c..517c3a3bb 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/cakes/CakeListNode.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import com.bumble.appyx.interactions.core.ui.math.lerpFloat -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -98,7 +98,7 @@ class CakeListNode( Box( modifier = modifier.fillMaxSize() ) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = spotlight, modifier = Modifier .align(Alignment.Center) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt index bd6edda73..9a71493a3 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/checkout/CheckoutNode.kt @@ -9,7 +9,7 @@ import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.ui.parallax.BackStackParallax import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.interactions.core.ui.gesture.GestureFactory -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -90,7 +90,7 @@ class CheckoutNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt index 30c602917..bff2c5011 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/loggedout/LoggedOutNode.kt @@ -24,7 +24,7 @@ import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.ui.parallax.BackStackParallax import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.interactions.core.ui.gesture.GestureFactory -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -84,7 +84,7 @@ class LoggedOutNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt index 4546fe6cd..6e65186bb 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/profile/ProfileNode.kt @@ -15,7 +15,7 @@ import androidx.compose.ui.unit.dp import com.bumble.appyx.components.backstack.BackStack import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -71,7 +71,7 @@ class ProfileNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt index 0086debc0..81e399c5b 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/root/RootNode.kt @@ -7,7 +7,7 @@ import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.operation.replace import com.bumble.appyx.components.backstack.ui.fader.BackStackFader import com.bumble.appyx.interactions.core.plugin.Plugin -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -69,7 +69,7 @@ class RootNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = Modifier ) diff --git a/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt b/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt index f64a40c58..4f625967c 100644 --- a/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt +++ b/demos/mkdocs/appyx-components/common/src/commonMain/kotlin/com/bumble/appyx/demos/common/AppyxWebSample.kt @@ -25,7 +25,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.bumble.appyx.demos.common.InteractionTarget.Element -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.BaseAppyxComponent import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup import com.bumble.appyx.interactions.core.ui.output.ElementUiModel @@ -85,7 +85,7 @@ fun AppyxWebSample( } ) ) { - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = appyxComponent, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt index 42df136d7..cc37c6b44 100644 --- a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt +++ b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/DragPrediction.kt @@ -45,7 +45,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.demos.dragprediction.DragPredictionVisualisation.Companion.toTargetUiState import com.bumble.appyx.demos.dragprediction.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.transition.Keyframes import com.bumble.appyx.interactions.core.model.transition.Update import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig @@ -191,7 +191,7 @@ fun ModelUi( model: TestDriveModel, modifier: Modifier = Modifier.fillMaxSize() ) { - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt index fef9e829d..0b6f39781 100644 --- a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt +++ b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/IncompleteDrag.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.incompletedrag.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -141,7 +141,7 @@ fun ModelUi( } ) - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt index 8792056c8..d13c1a929 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/Sample1.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.sample1.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -139,7 +139,7 @@ fun ModelUi( } ) - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt index 8ed3ad3e4..0984c7c02 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/Sample2.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.ElementState.D import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.sample2.InteractionTarget.Child1 -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.ui.helper.AppyxComponentSetup @@ -139,7 +139,7 @@ fun ModelUi( } ) - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt index df61b43f6..69891bd62 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/Sample3.kt @@ -45,7 +45,7 @@ import com.bumble.appyx.components.internal.testdrive.TestDriveModel.State.Eleme import com.bumble.appyx.components.internal.testdrive.operation.next import com.bumble.appyx.demos.sample3.InteractionTarget.Child1 import com.bumble.appyx.demos.sample3.Sample3Visualisation.Companion.toTargetUiState -import com.bumble.appyx.interactions.core.AppyxInteractionsComponent +import com.bumble.appyx.interactions.core.AppyxInteractionsContainer import com.bumble.appyx.interactions.core.model.transition.Keyframes import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME @@ -195,7 +195,7 @@ fun ModelUi( model: TestDriveModel, modifier: Modifier = Modifier.fillMaxSize() ) { - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = testDrive, screenWidthPx = screenWidthPx, screenHeightPx = screenHeightPx, diff --git a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt index 99b3d622e..cbc38bba1 100644 --- a/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt +++ b/demos/navigation-compose/src/main/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationContainerNode.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.Modifier import com.bumble.appyx.components.backstack.BackStack import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -55,7 +55,7 @@ internal class ComposeNavigationContainerNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( modifier = modifier.fillMaxWidth(), appyxComponent = backStack ) diff --git a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt index 8c6aa66fd..41033a0a8 100644 --- a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt +++ b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/navigation/node/datingcards/DatingCardsNode.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.unit.dp import com.bumble.appyx.components.experimental.cards.Cards import com.bumble.appyx.components.experimental.cards.CardsModel import com.bumble.appyx.components.experimental.cards.ui.CardsVisualisation -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -49,7 +49,7 @@ class DatingCardsNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( modifier = modifier .fillMaxSize() .background(appyx_dark) diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt index 0c16a949c..ffc674840 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackExamplesNode.kt @@ -21,7 +21,7 @@ import com.bumble.appyx.components.backstack.ui.parallax.BackStackParallax import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.components.backstack.ui.stack3d.BackStack3D import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -129,7 +129,7 @@ class BackStackExamplesNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = Modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt index 95d133362..6cfd2f5c2 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/BackStackNode.kt @@ -33,7 +33,7 @@ import com.bumble.appyx.interactions.core.ui.gesture.GestureSettleConfig import com.bumble.appyx.interactions.core.ui.helper.gestureModifier import com.bumble.appyx.navigation.ColorSaver import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -108,7 +108,7 @@ class BackStackNode( .fillMaxWidth() .background(appyx_dark) ) { - AppyxNavigationComponent( + AppyxNavigationContainer( clipToBounds = true, appyxComponent = backStack, modifier = Modifier diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt index 65676494c..3ff0f52d1 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/backstack/debug/BackstackDebugNode.kt @@ -25,7 +25,7 @@ import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.operation.replace import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.composable.KnobControl import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node @@ -99,7 +99,7 @@ class BackstackDebugNode( KnobControl(onValueChange = { backStack.setNormalisedProgress(it) }) - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = Modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt index 36163c32f..1d377e563 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/container/ContainerNode.kt @@ -15,7 +15,7 @@ import com.bumble.appyx.components.backstack.BackStack import com.bumble.appyx.components.backstack.BackStackModel import com.bumble.appyx.components.backstack.operation.push import com.bumble.appyx.components.backstack.ui.slider.BackStackSlider -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -140,7 +140,7 @@ class ContainerNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt index 3e85636da..1a19aace8 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/modal/ModalExamplesNode.kt @@ -23,7 +23,7 @@ import com.bumble.appyx.components.modal.operation.revert import com.bumble.appyx.components.modal.operation.show import com.bumble.appyx.components.modal.ui.ModalVisualisation import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -82,7 +82,7 @@ class ModalExamplesNode( .background(appyx_dark), verticalArrangement = Arrangement.Bottom ) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = modal, modifier = Modifier .fillMaxSize() diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt index 12182ea6b..f31c86068 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/promoter/PromoterNode.kt @@ -33,7 +33,7 @@ import com.bumble.appyx.components.experimental.promoter.ui.PromoterVisualisatio import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.core.model.transition.Operation.Mode.KEYFRAME import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -103,7 +103,7 @@ class PromoterNode( modifier = modifier .fillMaxSize() ) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = promoter, modifier = Modifier .weight(0.9f) diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt index 2a77485d8..23f0fdd1d 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightNode.kt @@ -34,7 +34,7 @@ import com.bumble.appyx.components.spotlight.operation.previous import com.bumble.appyx.components.spotlight.operation.updateElements import com.bumble.appyx.components.spotlight.ui.slider.SpotlightSlider import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -100,7 +100,7 @@ class SpotlightNode( .fillMaxSize() .background(appyx_dark) ) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = spotlight, modifier = Modifier .padding( diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt index a6ef431ab..2d506026c 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/SpotlightObserveTransitionsExampleNode.kt @@ -33,7 +33,7 @@ import com.bumble.appyx.interactions.core.ui.property.impl.RotationY import com.bumble.appyx.interactions.core.ui.property.impl.position.PositionAlignment import com.bumble.appyx.interactions.core.ui.property.motionPropertyRenderValue import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.ParentNode @@ -119,7 +119,7 @@ class SpotlightObserveTransitionsExampleNode( .fillMaxSize() .background(appyx_dark) ) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = spotlight, modifier = Modifier .padding( diff --git a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt index 6e3b76703..bacecfb4d 100644 --- a/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt +++ b/demos/sandbox-appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/spotlight/debug/SpotlightDebugNode.kt @@ -25,7 +25,7 @@ import com.bumble.appyx.components.spotlight.operation.next import com.bumble.appyx.components.spotlight.operation.previous import com.bumble.appyx.components.spotlight.ui.slider.SpotlightSlider import com.bumble.appyx.navigation.colors -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.composable.KnobControl import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node @@ -99,7 +99,7 @@ class SpotlightDebugNode( KnobControl(onValueChange = { spotlight.setNormalisedProgress(it) }) - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = spotlight, modifier = Modifier.padding( horizontal = 64.dp, diff --git a/documentation/2.x/migrationguide.md b/documentation/2.x/migrationguide.md index 9df774a5c..00b232c53 100644 --- a/documentation/2.x/migrationguide.md +++ b/documentation/2.x/migrationguide.md @@ -39,7 +39,7 @@ Check also [Multiplatform](../navigation/multiplatform.md) documentation and the ## Rough equivalents - 1.x → 2.x -- `NavModel` → `AppyxNavigationComponent` +- `NavModel` → `AppyxComponent` - `TransitionHandler` → `Visualisation` @@ -115,7 +115,7 @@ Artifacts have a `utils-` prefix: +import com.bumble.appyx.components.backstack.BackStackModel +import com.bumble.appyx.components.backstack.operation.push +import com.bumble.appyx.components.backstack.ui.fader.BackStackFader -+import com.bumble.appyx.navigation.composable.AppyxNavigationComponent ++import com.bumble.appyx.navigation.composable.AppyxNavigationContainer +import com.bumble.appyx.navigation.modality.BuildContext +import com.bumble.appyx.navigation.node.Node +import com.bumble.appyx.navigation.node.ParentNode @@ -155,7 +155,7 @@ class RootNode( - Children( - navModel = backStack, - transitionHandler = rememberBackstackFader(transitionSpec = { spring() }), -+ AppyxNavigationComponent( ++ AppyxNavigationContainer( + appyxComponent = backStack, modifier = Modifier.fillMaxSize() ) diff --git a/documentation/interactions/usage.md b/documentation/interactions/usage.md index 0b29c4f07..3bdc0c040 100644 --- a/documentation/interactions/usage.md +++ b/documentation/interactions/usage.md @@ -68,7 +68,7 @@ fun SomeComposable() { ### In the scope of Appyx Interactions -You can render your component with the `AppyxInteractionsComponent` composable. +You can render your component with the `AppyxInteractionsContainer` composable. Make sure to: @@ -78,7 +78,7 @@ Make sure to: ```kotlin @Composable fun SomeComposable() { - AppyxInteractionsComponent( + AppyxInteractionsContainer( appyxComponent = yourComponent, screenWidthPx = TODO(), screenHeightPx = TODO(), @@ -96,7 +96,7 @@ fun SomeComposable() { ### In the scope of Appyx Navigation -Appyx Navigation extends on the functionality of `AppyxInteractionsComponent` and adds `AppyxNavigationComponent` as a wrapper around it. +Appyx Navigation extends on the functionality of `AppyxInteractionsContainer` and adds `AppyxNavigationContainer` as a wrapper around it. For client code usage they're almost identical. However, you should always use the latter when using Appyx Navigation as it makes sure the related child `Nodes` are lifecycled properly. @@ -114,7 +114,7 @@ class YourNode( @Composable override fun View(modifier: Modifier) { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = yourComponent, modifier = modifier ) @@ -124,9 +124,9 @@ class YourNode( ### When to use which? -You should use `AppyxInteractionsComponent` if you're adding standalone Appyx components to your project without using navigation. +You should use `AppyxInteractionsContainer` if you're adding standalone Appyx components to your project without using navigation. -You should always use `AppyxNavigationComponent` if you're using Appyx Navigation. +You should always use `AppyxNavigationContainer` if you're using Appyx Navigation. diff --git a/documentation/navigation/quick-start.md b/documentation/navigation/quick-start.md index c3af6570c..5859eebbf 100644 --- a/documentation/navigation/quick-start.md +++ b/documentation/navigation/quick-start.md @@ -146,7 +146,7 @@ override fun View(modifier: Modifier) { modifier = modifier ) { // Let's include the elements of our component into the composition - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = backStack, modifier = Modifier.weight(0.9f) ) diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 7702f5d49..466932db0 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -10,7 +10,7 @@ When used in the scope of Appyx Navigation: ```diff -import com.bumble.appyx.navigation.composable.AppyxComponent -+import com.bumble.appyx.navigation.composable.AppyxNavigationComponent ++import com.bumble.appyx.navigation.composable.AppyxNavigationContainer class YourNode( /*...*/ @@ -19,7 +19,7 @@ class YourNode( @Composable override fun View(modifier: Modifier) { - AppyxComponent( -+ AppyxNavigationComponent( ++ AppyxNavigationContainer( appyxComponent = yourComponent, modifier = modifier ) @@ -31,12 +31,12 @@ When used in the scope of Appyx Interactions: ```diff -import com.bumble.appyx.interactions.core.AppyxComponent -+import com.bumble.appyx.interactions.core.AppyxInteractionsComponent ++import com.bumble.appyx.interactions.core.AppyxInteractionsContainer @Composable fun SomeComposable() { - AppyxComponent( -+ AppyxInteractionsComponent( ++ AppyxInteractionsContainer( appyxComponent = yourComponent, screenWidthPx = TODO(), screenHeightPx = TODO(), diff --git a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt index fb92b8ae5..4ce44dd2d 100644 --- a/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt +++ b/utils/material3/src/commonMain/kotlin/com/bumble/appyx/utils/material3/AppyxMaterial3NavNode.kt @@ -36,7 +36,7 @@ import com.bumble.appyx.navigation.Appyx import com.bumble.appyx.navigation.children.ChildAware import com.bumble.appyx.navigation.children.ChildAwareImpl import com.bumble.appyx.navigation.children.ChildEntry -import com.bumble.appyx.navigation.composable.AppyxNavigationComponent +import com.bumble.appyx.navigation.composable.AppyxNavigationContainer import com.bumble.appyx.navigation.integration.LocalScreenSize import com.bumble.appyx.navigation.integration.ScreenSize import com.bumble.appyx.navigation.integration.ScreenSize.WindowSizeClass.COMPACT @@ -138,7 +138,7 @@ open class AppyxMaterial3NavNode( @Composable fun CurrentNavItem() { - AppyxNavigationComponent( + AppyxNavigationContainer( appyxComponent = spotlight ) } From 036bd73c0548fe7bb726b7792cb8a7feda707e0f Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 20:18:25 +0000 Subject: [PATCH 20/25] Merged com.bumble.appyx.navigation.integrationpoint into .integration --- .../appyx/navigation/integration/ActivityIntegrationPoint.kt | 1 - .../appyx/navigation/integration/AndroidIntegrationPoint.kt | 1 - .../bumble/appyx/navigation/integration/AndroidNodeHost.kt | 1 - .../appyx/navigation/integration/LocalIntegrationPoint.kt | 1 - .../com/bumble/appyx/navigation/integration/NodeActivity.kt | 1 - .../appyx/navigation/integration/NodeComponentActivity.kt | 1 - .../{integrationpoint => integration}/IntegrationPoint.kt | 2 +- .../IntegrationPointProvider.kt | 2 +- .../{integrationpoint => integration}/IntegrationPointStub.kt | 2 +- .../com/bumble/appyx/navigation/integration/NodeHost.kt | 1 - .../kotlin/com/bumble/appyx/navigation/node/Node.kt | 4 ++-- .../kotlin/com/bumble/appyx/navigation/node/ParentNode.kt | 2 +- .../bumble/appyx/navigation/integration/DesktopNodeHost.kt | 1 - .../appyx/navigation/integration/MainIntegrationPoint.kt | 1 - .../com/bumble/appyx/navigation/integration/IosNodeHost.kt | 1 - .../appyx/navigation/integration/MainIntegrationPoint.kt | 1 - .../appyx/navigation/integration/MainIntegrationPoint.kt | 1 - .../com/bumble/appyx/navigation/integration/WebNodeHost.kt | 1 - documentation/2.x/migrationguide.md | 4 ++-- documentation/releases/2.0.0-alpha10.md | 4 ++++ .../kotlin/com/bumble/appyx/utils/interop/ribs/RibsNode.kt | 2 +- .../com/bumble/appyx/utils/interop/ribs/InteropActivity.kt | 2 +- .../com/bumble/appyx/utils/interop/ribs/InteropBuilder.kt | 2 +- .../utils/testing/unit/common/util/TestIntegrationPoint.kt | 2 +- 24 files changed, 16 insertions(+), 25 deletions(-) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/{integrationpoint => integration}/IntegrationPoint.kt (83%) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/{integrationpoint => integration}/IntegrationPointProvider.kt (63%) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/{integrationpoint => integration}/IntegrationPointStub.kt (93%) diff --git a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/ActivityIntegrationPoint.kt b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/ActivityIntegrationPoint.kt index 6d0d7e7d6..6168e8176 100644 --- a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/ActivityIntegrationPoint.kt +++ b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/ActivityIntegrationPoint.kt @@ -9,7 +9,6 @@ import com.bumble.appyx.navigation.integration.activitystarter.ActivityBoundary import com.bumble.appyx.navigation.integration.activitystarter.ActivityStarter import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequestBoundary import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequester -import com.bumble.appyx.navigation.integrationpoint.IntegrationPointProvider open class ActivityIntegrationPoint( private val activity: Activity, diff --git a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidIntegrationPoint.kt b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidIntegrationPoint.kt index 29ee8e8c7..661222265 100644 --- a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidIntegrationPoint.kt +++ b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidIntegrationPoint.kt @@ -5,7 +5,6 @@ import androidx.compose.runtime.Stable import com.bumble.appyx.navigation.integration.activitystarter.ActivityStarter import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequester import com.bumble.appyx.navigation.integration.requestcode.RequestCodeRegistry -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint @Stable abstract class AndroidIntegrationPoint( diff --git a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidNodeHost.kt b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidNodeHost.kt index 1ef635180..7e367f51c 100644 --- a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidNodeHost.kt +++ b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/AndroidNodeHost.kt @@ -5,7 +5,6 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.unit.dp -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint import com.bumble.appyx.navigation.lifecycle.Lifecycle import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.utils.customisations.NodeCustomisationDirectory diff --git a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/LocalIntegrationPoint.kt b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/LocalIntegrationPoint.kt index d0e7a7280..0213b796b 100644 --- a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/LocalIntegrationPoint.kt +++ b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/LocalIntegrationPoint.kt @@ -1,7 +1,6 @@ package com.bumble.appyx.navigation.integration import androidx.compose.runtime.staticCompositionLocalOf -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint val LocalIntegrationPoint = staticCompositionLocalOf { error("CompositionLocal LocalIntegrationPoint not present") diff --git a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeActivity.kt b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeActivity.kt index 1d38d40af..644419b7d 100644 --- a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeActivity.kt +++ b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeActivity.kt @@ -3,7 +3,6 @@ package com.bumble.appyx.navigation.integration import android.content.Intent import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.bumble.appyx.navigation.integrationpoint.IntegrationPointProvider /** * Helper class for root [Node] integration into projects using [AppCompatActivity]. diff --git a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeComponentActivity.kt b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeComponentActivity.kt index ea8ffbdf8..42a218ecb 100644 --- a/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeComponentActivity.kt +++ b/appyx-navigation/common/src/androidMain/kotlin/com/bumble/appyx/navigation/integration/NodeComponentActivity.kt @@ -3,7 +3,6 @@ package com.bumble.appyx.navigation.integration import android.content.Intent import android.os.Bundle import androidx.activity.ComponentActivity -import com.bumble.appyx.navigation.integrationpoint.IntegrationPointProvider /** * Helper class for root [Node] integration into projects using [ComponentActivity]. diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPoint.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPoint.kt similarity index 83% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPoint.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPoint.kt index 615cfbaff..7f04c84db 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPoint.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPoint.kt @@ -1,4 +1,4 @@ -package com.bumble.appyx.navigation.integrationpoint +package com.bumble.appyx.navigation.integration import androidx.compose.runtime.Stable import com.bumble.appyx.navigation.navigation.upnavigation.UpNavigationHandler diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPointProvider.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointProvider.kt similarity index 63% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPointProvider.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointProvider.kt index e00eac329..2dae20175 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPointProvider.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointProvider.kt @@ -1,4 +1,4 @@ -package com.bumble.appyx.navigation.integrationpoint +package com.bumble.appyx.navigation.integration interface IntegrationPointProvider { diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPointStub.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointStub.kt similarity index 93% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPointStub.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointStub.kt index e50b252dd..18ecbe5d5 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integrationpoint/IntegrationPointStub.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointStub.kt @@ -1,4 +1,4 @@ -package com.bumble.appyx.navigation.integrationpoint +package com.bumble.appyx.navigation.integration class IntegrationPointStub : IntegrationPoint() { companion object { diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/NodeHost.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/NodeHost.kt index 715e9e752..a517ddc8f 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/NodeHost.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/NodeHost.kt @@ -10,7 +10,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.mapSaver import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Modifier -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint import com.bumble.appyx.navigation.lifecycle.Lifecycle import com.bumble.appyx.navigation.lifecycle.PlatformLifecycleEventObserver import com.bumble.appyx.navigation.modality.BuildContext diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt index b79cb35bb..36da49fae 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt @@ -10,8 +10,8 @@ import com.bumble.appyx.interactions.core.plugin.SavesInstanceState import com.bumble.appyx.interactions.core.state.MutableSavedStateMap import com.bumble.appyx.interactions.core.state.MutableSavedStateMapImpl import com.bumble.appyx.navigation.Appyx -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint -import com.bumble.appyx.navigation.integrationpoint.IntegrationPointStub +import com.bumble.appyx.navigation.integration.IntegrationPoint +import com.bumble.appyx.navigation.integration.IntegrationPointStub import com.bumble.appyx.navigation.lifecycle.DefaultPlatformLifecycleObserver import com.bumble.appyx.navigation.lifecycle.Lifecycle import com.bumble.appyx.navigation.lifecycle.LifecycleLogger diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt index 3795c9038..e1e7927ba 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/ParentNode.kt @@ -20,7 +20,7 @@ import com.bumble.appyx.navigation.children.nodeOrNull import com.bumble.appyx.navigation.lifecycle.ChildNodeLifecycleManager import com.bumble.appyx.navigation.lifecycle.Lifecycle import com.bumble.appyx.navigation.modality.BuildContext -import com.bumble.appyx.navigation.navigation.ChildNodeBuilder +import com.bumble.appyx.navigation.children.ChildNodeBuilder import com.bumble.appyx.navigation.platform.PlatformBackHandler import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch diff --git a/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/DesktopNodeHost.kt b/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/DesktopNodeHost.kt index 24f5b3ecd..1ff67e052 100644 --- a/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/DesktopNodeHost.kt +++ b/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/DesktopNodeHost.kt @@ -8,7 +8,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier import androidx.compose.ui.window.WindowState -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.platform.LocalOnBackPressedDispatcherOwner import com.bumble.appyx.navigation.platform.OnBackPressedDispatcher diff --git a/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt b/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt index 774f3432f..3036626eb 100644 --- a/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt +++ b/appyx-navigation/common/src/desktopMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt @@ -1,6 +1,5 @@ package com.bumble.appyx.navigation.integration -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint import kotlin.system.exitProcess class MainIntegrationPoint : IntegrationPoint() { diff --git a/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/IosNodeHost.kt b/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/IosNodeHost.kt index cf0f5b289..6c5ef8ba6 100644 --- a/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/IosNodeHost.kt +++ b/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/IosNodeHost.kt @@ -7,7 +7,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.platform.LocalOnBackPressedDispatcherOwner import com.bumble.appyx.navigation.platform.OnBackPressedDispatcher diff --git a/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt b/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt index 7488b14aa..3855b0734 100644 --- a/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt +++ b/appyx-navigation/common/src/iosMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt @@ -1,6 +1,5 @@ package com.bumble.appyx.navigation.integration -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint import platform.UIKit.UIViewController import platform.UIKit.navigationController diff --git a/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt b/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt index 5d867a433..2adb723bb 100644 --- a/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt +++ b/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/MainIntegrationPoint.kt @@ -1,6 +1,5 @@ package com.bumble.appyx.navigation.integration -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint class MainIntegrationPoint : IntegrationPoint() { override val isChangingConfigurations: Boolean diff --git a/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/WebNodeHost.kt b/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/WebNodeHost.kt index b964aa552..ca9cb00d1 100644 --- a/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/WebNodeHost.kt +++ b/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/WebNodeHost.kt @@ -6,7 +6,6 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.platform.LocalOnBackPressedDispatcherOwner import com.bumble.appyx.navigation.platform.OnBackPressedDispatcher diff --git a/documentation/2.x/migrationguide.md b/documentation/2.x/migrationguide.md index 00b232c53..d3f313f67 100644 --- a/documentation/2.x/migrationguide.md +++ b/documentation/2.x/migrationguide.md @@ -86,7 +86,7 @@ Artifacts have a `utils-` prefix: -import com.bumble.appyx.core.integrationpoint.NodeActivity +import com.bumble.appyx.navigation.integration.NodeHost -+import com.bumble.appyx.navigation.integrationpoint.NodeActivity ++import com.bumble.appyx.navigation.integration.NodeActivity class MainActivity : NodeActivity() { super.onCreate(savedInstanceState) @@ -171,7 +171,7 @@ class RootNode( -import com.bumble.appyx.core.integrationpoint.IntegrationPointStub +import com.bumble.appyx.navigation.integration.NodeHost -+import com.bumble.appyx.navigation.integrationpoint.IntegrationPointStub ++import com.bumble.appyx.navigation.integration.IntegrationPointStub @Preview @Composable diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 466932db0..48b7c7537 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -4,6 +4,10 @@ title: 2.0.0-alpha10 – Migration guide # 2.0.0-alpha10 – Migration guide +## Package changes + +- Merged `com.bumble.appyx.navigation.integrationpoint` into `com.bumble.appyx.navigation.integration` + ## Rename ambiguous `AppyxComponent` composables When used in the scope of Appyx Navigation: diff --git a/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/RibsNode.kt b/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/RibsNode.kt index dcff75a14..0b776a4a6 100644 --- a/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/RibsNode.kt +++ b/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/RibsNode.kt @@ -24,7 +24,7 @@ import com.badoo.ribs.routing.resolution.Resolution import com.badoo.ribs.routing.router.Router import com.badoo.ribs.routing.source.backstack.BackStack import com.badoo.ribs.routing.source.backstack.operation.push -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint +import com.bumble.appyx.navigation.integration.IntegrationPoint import com.bumble.appyx.navigation.modality.BuildContext import kotlinx.parcelize.Parcelize import java.util.UUID diff --git a/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropActivity.kt b/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropActivity.kt index 3d69126aa..d3bf2a952 100644 --- a/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropActivity.kt +++ b/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropActivity.kt @@ -4,7 +4,7 @@ import android.content.Intent import android.os.Bundle import com.badoo.ribs.android.RibActivity import com.bumble.appyx.navigation.integration.ActivityIntegrationPoint -import com.bumble.appyx.navigation.integrationpoint.IntegrationPointProvider +import com.bumble.appyx.navigation.integration.IntegrationPointProvider abstract class InteropActivity : RibActivity(), IntegrationPointProvider { diff --git a/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropBuilder.kt b/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropBuilder.kt index b46ef9c45..4d2b912c7 100644 --- a/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropBuilder.kt +++ b/utils/interop-ribs/src/main/kotlin/com/bumble/appyx/utils/interop/ribs/InteropBuilder.kt @@ -3,7 +3,7 @@ package com.bumble.appyx.utils.interop.ribs import com.badoo.ribs.builder.SimpleBuilder import com.badoo.ribs.core.modality.BuildParams import com.bumble.appyx.navigation.integration.NodeFactory -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint +import com.bumble.appyx.navigation.integration.IntegrationPoint import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node import com.bumble.appyx.navigation.node.build diff --git a/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt b/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt index 2d3bbf728..8f037ceb0 100644 --- a/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt +++ b/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt @@ -1,6 +1,6 @@ package com.bumble.appyx.utils.testing.unit.common.util -import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint +import com.bumble.appyx.navigation.integration.IntegrationPoint import com.bumble.appyx.navigation.navigation.upnavigation.UpNavigationHandler class TestIntegrationPoint( From a5d56b056d59434fe6a16319cf4bf8b6f54f8455 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 20:24:07 +0000 Subject: [PATCH 21/25] Move classes from navigation.navigation to where they fit --- .../{navigation => children}/ChildNodeBuilder.kt | 2 +- .../UpNavigationHandler.kt | 2 +- documentation/releases/2.0.0-alpha10.md | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/{navigation => children}/ChildNodeBuilder.kt (83%) rename appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/{navigation/upnavigation => integration}/UpNavigationHandler.kt (53%) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeBuilder.kt similarity index 83% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeBuilder.kt index 0d5c7bf40..8e73e48c1 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/ChildNodeBuilder.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeBuilder.kt @@ -1,4 +1,4 @@ -package com.bumble.appyx.navigation.navigation +package com.bumble.appyx.navigation.children import com.bumble.appyx.navigation.modality.BuildContext import com.bumble.appyx.navigation.node.Node diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/upnavigation/UpNavigationHandler.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/UpNavigationHandler.kt similarity index 53% rename from appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/upnavigation/UpNavigationHandler.kt rename to appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/UpNavigationHandler.kt index 43c472de7..1b5b69503 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/navigation/upnavigation/UpNavigationHandler.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/UpNavigationHandler.kt @@ -1,4 +1,4 @@ -package com.bumble.appyx.navigation.navigation.upnavigation +package com.bumble.appyx.navigation.integration fun interface UpNavigationHandler { fun handleUpNavigation() diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 48b7c7537..380ee032b 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -6,7 +6,15 @@ title: 2.0.0-alpha10 – Migration guide ## Package changes -- Merged `com.bumble.appyx.navigation.integrationpoint` into `com.bumble.appyx.navigation.integration` +```diff +// Moved all classes: +-com.bumble.appyx.navigation.integrationpoint.* ++com.bumble.appyx.navigation.integration.* + +// Moved class: +-com.bumble.appyx.navigation.navigation.UpNavigationHandler ++com.bumble.appyx.navigation.integration.UpNavigationHandler +``` ## Rename ambiguous `AppyxComponent` composables From 33e80aa8971de0b16e12b909c50ca62cd35f4a4d Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Tue, 9 Jan 2024 20:28:15 +0000 Subject: [PATCH 22/25] Fix compilation issues --- .../appyx/navigation/children/ChildNodeCreationManager.kt | 2 +- .../com/bumble/appyx/navigation/integration/IntegrationPoint.kt | 1 - .../navigation/component/spotlighthero/SpotlightHeroModel.kt | 2 +- .../utils/testing/unit/common/util/TestIntegrationPoint.kt | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt index 1c022ac61..dbd15dd14 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/children/ChildNodeCreationManager.kt @@ -18,7 +18,7 @@ import kotlinx.coroutines.launch /** * Initializes and removes nodes based on parent node's navModel. * - * Lifecycle of these nodes is managed in [com.bumble.appyx.core.lifecycle.ChildNodeLifecycleManager]. + * Lifecycle of these nodes is managed in [com.bumble.appyx.navigation.lifecycle.ChildNodeLifecycleManager]. */ internal class ChildNodeCreationManager( private var savedStateMap: SavedStateMap?, diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPoint.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPoint.kt index 7f04c84db..739eb50c4 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPoint.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPoint.kt @@ -1,7 +1,6 @@ package com.bumble.appyx.navigation.integration import androidx.compose.runtime.Stable -import com.bumble.appyx.navigation.navigation.upnavigation.UpNavigationHandler @Stable abstract class IntegrationPoint : UpNavigationHandler { diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt index b4793f57a..aeee945e8 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/component/spotlighthero/SpotlightHeroModel.kt @@ -41,7 +41,7 @@ class SpotlightHeroModel( activeIndex <= positions.lastIndex - 1 val activeElement: NavTarget = - positions[activeIndex.toInt()].main.NavTarget + positions[activeIndex.toInt()].main.interactionTarget } override val initialState: State = diff --git a/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt b/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt index 8f037ceb0..f6f2f364b 100644 --- a/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt +++ b/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestIntegrationPoint.kt @@ -1,7 +1,7 @@ package com.bumble.appyx.utils.testing.unit.common.util import com.bumble.appyx.navigation.integration.IntegrationPoint -import com.bumble.appyx.navigation.navigation.upnavigation.UpNavigationHandler +import com.bumble.appyx.navigation.integration.UpNavigationHandler class TestIntegrationPoint( private val upNavigationHandler: UpNavigationHandler, From a45885264b17719ec9581476838abba42d5c00be Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Thu, 11 Jan 2024 17:50:39 +0000 Subject: [PATCH 23/25] Fix migration guide --- documentation/releases/2.0.0-alpha10.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 380ee032b..7f51e7335 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -78,9 +78,7 @@ class YourNode( - override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node = + override fun buildChildNode(navTarget: NavTarget, buildContext: BuildContext): Node = - -- when (navTarget) { -+ when (navTarget) { + when (navTarget) { TODO() } ``` From 9db6506561087a92b3cbfdc3a1a79426a8120b67 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Thu, 11 Jan 2024 17:50:50 +0000 Subject: [PATCH 24/25] Fix compilation error --- .../utils/testing/unit/common/util/TestUpNavigationHandler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestUpNavigationHandler.kt b/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestUpNavigationHandler.kt index 1fa54d2f7..174909a8a 100644 --- a/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestUpNavigationHandler.kt +++ b/utils/testing-unit-common/src/main/kotlin/com/bumble/appyx/utils/testing/unit/common/util/TestUpNavigationHandler.kt @@ -1,6 +1,6 @@ package com.bumble.appyx.utils.testing.unit.common.util -import com.bumble.appyx.navigation.navigation.upnavigation.UpNavigationHandler +import com.bumble.appyx.navigation.integration.UpNavigationHandler import kotlin.test.assertFalse import kotlin.test.assertTrue From 4d6a0c4d7d6cc5c2c16e7b6291d3f383e1e074f6 Mon Sep 17 00:00:00 2001 From: Zsolt Kocsi Date: Thu, 11 Jan 2024 18:05:15 +0000 Subject: [PATCH 25/25] Update migration guide --- documentation/releases/2.0.0-alpha10.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 7f51e7335..ab999b258 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -14,6 +14,11 @@ title: 2.0.0-alpha10 – Migration guide // Moved class: -com.bumble.appyx.navigation.navigation.UpNavigationHandler +com.bumble.appyx.navigation.integration.UpNavigationHandler + +// Removed duplicate typealias and moved to utils: +-import com.bumble.appyx.interactions.core.state.SavedStateMap +-import com.bumble.appyx.navigation.state.SavedStateMap ++import com.bumble.appyx.utils.multiplatform.SavedStateMap ``` ## Rename ambiguous `AppyxComponent` composables