From 245219a68007d96abcf8e2c1d3089fd1998f359a Mon Sep 17 00:00:00 2001 From: Manel Martos Date: Fri, 26 Jan 2024 09:57:05 +0100 Subject: [PATCH] Rename appyxV2IntegrationPoint to appyxIntegrationPoint --- .../appyx/navigation/AppyxTestScenario.kt | 2 +- .../integration/ActivityIntegrationPoint.kt | 2 +- .../navigation/integration/NodeActivity.kt | 12 +++++------ .../integration/NodeComponentActivity.kt | 12 +++++------ .../integration/IntegrationPointProvider.kt | 2 +- .../appyx/benchmark/app/MainActivity.kt | 2 +- .../bumble/appyx/interactions/MainActivity.kt | 2 +- .../appyx/demos/navigation/MainActivity.kt | 2 +- .../compose/ComposeNavigationRootTest.kt | 2 +- .../demos/sandbox/navigation/MainActivity.kt | 2 +- documentation/2.x/migrationguide.md | 21 ------------------- documentation/navigation/multiplatform.md | 2 +- .../interop/ribs/AppyxRibsInteropActivity.kt | 2 +- .../utils/interop/ribs/InteropActivity.kt | 10 ++++----- .../testing/ui/rules/AppyxActivityTestRule.kt | 2 +- 15 files changed, 28 insertions(+), 49 deletions(-) diff --git a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/AppyxTestScenario.kt b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/AppyxTestScenario.kt index f04c53c25..2a3075634 100644 --- a/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/AppyxTestScenario.kt +++ b/appyx-navigation/android/src/androidTest/kotlin/com/bumble/appyx/navigation/AppyxTestScenario.kt @@ -28,7 +28,7 @@ class AppyxTestScenario>( decorator { NodeHost( lifecycle = AndroidLifecycle(LocalLifecycleOwner.current.lifecycle), - integrationPoint = activity.appyxV2IntegrationPoint, + integrationPoint = activity.appyxIntegrationPoint, ) { nodeContext -> node = nodeFactory.create(nodeContext) awaitNode.countDown() 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 6168e8176..135a14970 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 @@ -61,7 +61,7 @@ open class ActivityIntegrationPoint( "Activity ${activity::class.qualifiedName} does not implement IntegrationPointProvider" ) - return integrationPointProvider.appyxV2IntegrationPoint as? AndroidIntegrationPoint + return integrationPointProvider.appyxIntegrationPoint as? AndroidIntegrationPoint ?: error( "Activity ${activity::class.qualifiedName} does not provide AndroidIntegrationPoint" ) 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 644419b7d..3e14b5725 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 @@ -10,7 +10,7 @@ import androidx.appcompat.app.AppCompatActivity * See [NodeComponentActivity] for building upon [ComponentActivity]. * * Also offers base functionality to satisfy dependencies of Android-related functionality - * down the tree via [appyxV2IntegrationPoint]: + * down the tree via [appyxIntegrationPoint]: * - [ActivityStarter] * - [PermissionRequester] * @@ -19,7 +19,7 @@ import androidx.appcompat.app.AppCompatActivity */ open class NodeActivity : AppCompatActivity(), IntegrationPointProvider { - override lateinit var appyxV2IntegrationPoint: ActivityIntegrationPoint + override lateinit var appyxIntegrationPoint: ActivityIntegrationPoint protected set protected open fun createIntegrationPoint(savedInstanceState: Bundle?) = @@ -30,12 +30,12 @@ open class NodeActivity : AppCompatActivity(), IntegrationPointProvider { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - appyxV2IntegrationPoint = createIntegrationPoint(savedInstanceState) + appyxIntegrationPoint = createIntegrationPoint(savedInstanceState) } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) - appyxV2IntegrationPoint.onActivityResult(requestCode, resultCode, data) + appyxIntegrationPoint.onActivityResult(requestCode, resultCode, data) } override fun onRequestPermissionsResult( @@ -44,12 +44,12 @@ open class NodeActivity : AppCompatActivity(), IntegrationPointProvider { grantResults: IntArray ) { super.onRequestPermissionsResult(requestCode, permissions, grantResults) - appyxV2IntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults) + appyxIntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults) } override fun onSaveInstanceState(outState: Bundle) { super.onSaveInstanceState(outState) - appyxV2IntegrationPoint.onSaveInstanceState(outState) + appyxIntegrationPoint.onSaveInstanceState(outState) } } 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 42a218ecb..7a5f23f1d 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 @@ -10,7 +10,7 @@ import androidx.activity.ComponentActivity * See [NodeActivity] for building upon [AppCompatActivity] * * Also offers base functionality to satisfy dependencies of Android-related functionality - * down the tree via [appyxV2IntegrationPoint]: + * down the tree via [appyxIntegrationPoint]: * - [ActivityStarter] * - [PermissionRequester] * @@ -19,7 +19,7 @@ import androidx.activity.ComponentActivity */ open class NodeComponentActivity : ComponentActivity(), IntegrationPointProvider { - override lateinit var appyxV2IntegrationPoint: ActivityIntegrationPoint + override lateinit var appyxIntegrationPoint: ActivityIntegrationPoint protected set protected open fun createIntegrationPoint(savedInstanceState: Bundle?) = @@ -30,13 +30,13 @@ open class NodeComponentActivity : ComponentActivity(), IntegrationPointProvider override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - appyxV2IntegrationPoint = createIntegrationPoint(savedInstanceState) + appyxIntegrationPoint = createIntegrationPoint(savedInstanceState) } @Suppress("OVERRIDE_DEPRECATION") override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) - appyxV2IntegrationPoint.onActivityResult(requestCode, resultCode, data) + appyxIntegrationPoint.onActivityResult(requestCode, resultCode, data) } @Suppress("OVERRIDE_DEPRECATION") @@ -46,11 +46,11 @@ open class NodeComponentActivity : ComponentActivity(), IntegrationPointProvider grantResults: IntArray ) { super.onRequestPermissionsResult(requestCode, permissions, grantResults) - appyxV2IntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults) + appyxIntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults) } override fun onSaveInstanceState(outState: Bundle) { super.onSaveInstanceState(outState) - appyxV2IntegrationPoint.onSaveInstanceState(outState) + appyxIntegrationPoint.onSaveInstanceState(outState) } } diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointProvider.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointProvider.kt index 2dae20175..71c93dd35 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointProvider.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/integration/IntegrationPointProvider.kt @@ -2,5 +2,5 @@ package com.bumble.appyx.navigation.integration interface IntegrationPointProvider { - val appyxV2IntegrationPoint: IntegrationPoint + val appyxIntegrationPoint: IntegrationPoint } diff --git a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/MainActivity.kt b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/MainActivity.kt index dcc5eeb33..3b78f7446 100644 --- a/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/MainActivity.kt +++ b/benchmark/benchmark-app/src/main/kotlin/com/bumble/appyx/benchmark/app/MainActivity.kt @@ -24,7 +24,7 @@ class MainActivity : NodeActivity() { ) { NodeHost( lifecycle = AndroidLifecycle(LocalLifecycleOwner.current.lifecycle), - integrationPoint = appyxV2IntegrationPoint, + integrationPoint = appyxIntegrationPoint, ) { MosaicNode( nodeContext = it, diff --git a/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/MainActivity.kt b/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/MainActivity.kt index 34f5f0214..2ae68800f 100644 --- a/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/MainActivity.kt +++ b/demos/appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/MainActivity.kt @@ -38,7 +38,7 @@ class MainActivity : NodeActivity() { ) { NodeHost( lifecycle = AndroidLifecycle(LocalLifecycleOwner.current.lifecycle), - integrationPoint = appyxV2IntegrationPoint, + integrationPoint = appyxIntegrationPoint, ) { AppyxMaterial3NavNode( nodeContext = it, diff --git a/demos/appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/navigation/MainActivity.kt b/demos/appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/navigation/MainActivity.kt index 7bb8504d5..3de97bde5 100644 --- a/demos/appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/navigation/MainActivity.kt +++ b/demos/appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/navigation/MainActivity.kt @@ -46,7 +46,7 @@ class MainActivity : NodeActivity() { CompositionLocalProvider(LocalNavigator provides navigator) { NodeHost( lifecycle = AndroidLifecycle(LocalLifecycleOwner.current.lifecycle), - integrationPoint = appyxV2IntegrationPoint, + integrationPoint = appyxIntegrationPoint, ) { RootNode( nodeContext = it, diff --git a/demos/navigation-compose/src/androidTest/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationRootTest.kt b/demos/navigation-compose/src/androidTest/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationRootTest.kt index 41bb77f97..0c35a00f0 100644 --- a/demos/navigation-compose/src/androidTest/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationRootTest.kt +++ b/demos/navigation-compose/src/androidTest/kotlin/com/bumble/appyx/sample/navigtion/compose/ComposeNavigationRootTest.kt @@ -19,7 +19,7 @@ class ComposeNavigationRootTest { // 'integrationPoint' must be provided to ensure it can be accessed from within the // Jetpack compose navigation graph. CompositionLocalProvider( - LocalIntegrationPoint provides appyxTestActivity.appyxV2IntegrationPoint, + LocalIntegrationPoint provides appyxTestActivity.appyxIntegrationPoint, ) { ComposeNavigationRoot() } diff --git a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/MainActivity.kt b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/MainActivity.kt index b0c9a772b..7ad9325e5 100644 --- a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/MainActivity.kt +++ b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/MainActivity.kt @@ -33,7 +33,7 @@ class MainActivity : NodeActivity() { Surface(color = MaterialTheme.colorScheme.background) { NodeHost( lifecycle = AndroidLifecycle(LocalLifecycleOwner.current.lifecycle), - integrationPoint = appyxV2IntegrationPoint, + integrationPoint = appyxIntegrationPoint, ) { MainNavNode( nodeContext = it, diff --git a/documentation/2.x/migrationguide.md b/documentation/2.x/migrationguide.md index 0989f563d..3fe89a84f 100644 --- a/documentation/2.x/migrationguide.md +++ b/documentation/2.x/migrationguide.md @@ -80,27 +80,6 @@ Artifacts have a `utils-` prefix: ``` -### MainActivity - -```diff --import com.bumble.appyx.core.integration.NodeHost --import com.bumble.appyx.core.integrationpoint.NodeActivity - -+import com.bumble.appyx.navigation.integration.NodeHost -+import com.bumble.appyx.navigation.integration.NodeActivity - - class MainActivity : NodeActivity() { - super.onCreate(savedInstanceState) - setContent { - HelloAppyxTheme { -- NodeHost(integrationPoint = appyxIntegrationPoint) { -+ NodeHost(integrationPoint = appyxV2IntegrationPoint) { - RootNode(it) - } - } - } -``` - ### Usage site (RootNode) ```diff diff --git a/documentation/navigation/multiplatform.md b/documentation/navigation/multiplatform.md index 0122d8fe5..aa9da73e6 100644 --- a/documentation/navigation/multiplatform.md +++ b/documentation/navigation/multiplatform.md @@ -90,7 +90,7 @@ class MainActivity : NodeActivity() { YourAppTheme { NodeHost( lifecycle = AndroidLifecycle(LocalLifecycleOwner.current.lifecycle), - integrationPoint = appyxV2IntegrationPoint + integrationPoint = appyxIntegrationPoint ) { RootNode(nodeContext = it) } diff --git a/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/AppyxRibsInteropActivity.kt b/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/AppyxRibsInteropActivity.kt index 72c871b08..ac9a233ce 100644 --- a/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/AppyxRibsInteropActivity.kt +++ b/utils/interop-ribs/src/androidTest/kotlin/com/bumble/appyx/utils/interop/ribs/AppyxRibsInteropActivity.kt @@ -14,7 +14,7 @@ class AppyxRibsInteropActivity : InteropActivity() { override fun createRib(savedInstanceState: Bundle?): Rib = RibsNodeBuilder() - .build(BuildContext.root(savedInstanceState), appyxV2IntegrationPoint) + .build(BuildContext.root(savedInstanceState), appyxIntegrationPoint) .also { ribsNode = it } } 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 d3bf2a952..01760e607 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 @@ -8,7 +8,7 @@ import com.bumble.appyx.navigation.integration.IntegrationPointProvider abstract class InteropActivity : RibActivity(), IntegrationPointProvider { - override lateinit var appyxV2IntegrationPoint: ActivityIntegrationPoint + override lateinit var appyxIntegrationPoint: ActivityIntegrationPoint protected open fun createAppyxIntegrationPoint(savedInstanceState: Bundle?) = ActivityIntegrationPoint( @@ -19,13 +19,13 @@ abstract class InteropActivity : RibActivity(), IntegrationPointProvider { override fun onCreate(savedInstanceState: Bundle?) { // super.onCreate() creates RIB with AppyxNode inside. It's important to have // appyxIntegrationPoint ready before we create a root node - appyxV2IntegrationPoint = createAppyxIntegrationPoint(savedInstanceState) + appyxIntegrationPoint = createAppyxIntegrationPoint(savedInstanceState) super.onCreate(savedInstanceState) } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) - appyxV2IntegrationPoint.onActivityResult(requestCode, resultCode, data) + appyxIntegrationPoint.onActivityResult(requestCode, resultCode, data) } override fun onRequestPermissionsResult( @@ -34,12 +34,12 @@ abstract class InteropActivity : RibActivity(), IntegrationPointProvider { grantResults: IntArray ) { super.onRequestPermissionsResult(requestCode, permissions, grantResults) - appyxV2IntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults) + appyxIntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults) } override fun onSaveInstanceState(outState: Bundle) { super.onSaveInstanceState(outState) - appyxV2IntegrationPoint.onSaveInstanceState(outState) + appyxIntegrationPoint.onSaveInstanceState(outState) } } diff --git a/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/rules/AppyxActivityTestRule.kt b/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/rules/AppyxActivityTestRule.kt index 781cc8d28..5df4f8c13 100644 --- a/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/rules/AppyxActivityTestRule.kt +++ b/utils/testing-ui/src/main/kotlin/com/bumble/appyx/utils/testing/ui/rules/AppyxActivityTestRule.kt @@ -48,7 +48,7 @@ open class AppyxActivityTestRule>( decorator { NodeHost( lifecycle = AndroidLifecycle(LocalLifecycleOwner.current.lifecycle), - integrationPoint = activity.appyxV2IntegrationPoint, + integrationPoint = activity.appyxIntegrationPoint, ) { nodeContext -> node = nodeFactory.create(nodeContext) node