Skip to content

Commit

Permalink
Merge pull request #668 from manuel-martos/1.x-rename-integration-point
Browse files Browse the repository at this point in the history
Appyx 1.x - Rename integration point
  • Loading branch information
manuel-martos authored Feb 1, 2024
2 parents 1ab37ff + dcc1c3c commit 20f2290
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion documentation/how-to-use-appyx/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MainActivity : NodeActivity() {
super.onCreate(savedInstanceState)
setContent {
AppTheme {
NodeHost(integrationPoint = appyxIntegrationPoint) {
NodeHost(integrationPoint = appyxV1IntegrationPoint) {
RootNode(buildContext = it)
}
}
Expand Down
2 changes: 1 addition & 1 deletion documentation/navigation/deep-linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ExplicitNavigationExampleActivity : NodeActivity(), Navigator {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
NodeHost(integrationPoint = appyxIntegrationPoint) {
NodeHost(integrationPoint = appyxV1IntegrationPoint) {
RootNode(
buildContext = it,
plugins = listOf(object : NodeReadyObserver<RootNode> {
Expand Down
2 changes: 1 addition & 1 deletion documentation/navigation/explicit-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class ExplicitNavigationExampleActivity : NodeActivity(), Navigator {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
NodeHost(integrationPoint = appyxIntegrationPoint) {
NodeHost(integrationPoint = appyxV1IntegrationPoint) {
RootNode(
buildContext = it,
navigator = this@ExplicitNavigationExampleActivity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AppyxTestScenario<T : Node>(
AppyxTestActivity.composableView = { activity ->
decorator {
NodeHost(
integrationPoint = activity.appyxIntegrationPoint,
integrationPoint = activity.appyxV1IntegrationPoint,
factory = { buildContext ->
node = nodeFactory.create(buildContext)
awaitNode.countDown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ open class ActivityIntegrationPoint(
"Activity ${activity::class.qualifiedName} does not implement IntegrationPointProvider"
)

return integrationPointProvider.appyxIntegrationPoint
return integrationPointProvider.appyxV1IntegrationPoint
}

@Suppress("UNCHECKED_CAST")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package com.bumble.appyx.core.integrationpoint

interface IntegrationPointProvider {

val appyxIntegrationPoint: IntegrationPoint
val appyxV1IntegrationPoint: IntegrationPoint
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 [appyxIntegrationPoint]:
* down the tree via [appyxV1IntegrationPoint]:
* - [ActivityStarter]
* - [PermissionRequester]
*
Expand All @@ -19,7 +19,7 @@ import androidx.appcompat.app.AppCompatActivity
*/
open class NodeActivity : AppCompatActivity(), IntegrationPointProvider {

override lateinit var appyxIntegrationPoint: ActivityIntegrationPoint
override lateinit var appyxV1IntegrationPoint: ActivityIntegrationPoint
protected set

protected open fun createIntegrationPoint(savedInstanceState: Bundle?) =
Expand All @@ -30,12 +30,12 @@ open class NodeActivity : AppCompatActivity(), IntegrationPointProvider {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
appyxIntegrationPoint = createIntegrationPoint(savedInstanceState)
appyxV1IntegrationPoint = createIntegrationPoint(savedInstanceState)
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
appyxIntegrationPoint.onActivityResult(requestCode, resultCode, data)
appyxV1IntegrationPoint.onActivityResult(requestCode, resultCode, data)
}

override fun onRequestPermissionsResult(
Expand All @@ -44,12 +44,12 @@ open class NodeActivity : AppCompatActivity(), IntegrationPointProvider {
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
appyxIntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults)
appyxV1IntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults)
}

override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
appyxIntegrationPoint.onSaveInstanceState(outState)
appyxV1IntegrationPoint.onSaveInstanceState(outState)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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 [appyxIntegrationPoint]:
* down the tree via [appyxV1IntegrationPoint]:
* - [ActivityStarter]
* - [PermissionRequester]
*
Expand All @@ -19,7 +19,7 @@ import androidx.activity.ComponentActivity
*/
open class NodeComponentActivity : ComponentActivity(), IntegrationPointProvider {

override lateinit var appyxIntegrationPoint: ActivityIntegrationPoint
override lateinit var appyxV1IntegrationPoint: ActivityIntegrationPoint
protected set

protected open fun createIntegrationPoint(savedInstanceState: Bundle?) =
Expand All @@ -30,13 +30,13 @@ open class NodeComponentActivity : ComponentActivity(), IntegrationPointProvider

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
appyxIntegrationPoint = createIntegrationPoint(savedInstanceState)
appyxV1IntegrationPoint = createIntegrationPoint(savedInstanceState)
}

@Suppress("OVERRIDE_DEPRECATION")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
appyxIntegrationPoint.onActivityResult(requestCode, resultCode, data)
appyxV1IntegrationPoint.onActivityResult(requestCode, resultCode, data)
}

@Suppress("OVERRIDE_DEPRECATION")
Expand All @@ -46,11 +46,11 @@ open class NodeComponentActivity : ComponentActivity(), IntegrationPointProvider
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
appyxIntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults)
appyxV1IntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults)
}

override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
appyxIntegrationPoint.onSaveInstanceState(outState)
appyxV1IntegrationPoint.onSaveInstanceState(outState)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppyxRibsInteropActivity : InteropActivity() {

override fun createRib(savedInstanceState: Bundle?): Rib =
RibsNodeBuilder()
.build(BuildContext.root(savedInstanceState), appyxIntegrationPoint)
.build(BuildContext.root(savedInstanceState), appyxV1IntegrationPoint)
.also { ribsNode = it }

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.bumble.appyx.core.integrationpoint.IntegrationPointProvider

abstract class InteropActivity : RibActivity(), IntegrationPointProvider {

override lateinit var appyxIntegrationPoint: ActivityIntegrationPoint
override lateinit var appyxV1IntegrationPoint: ActivityIntegrationPoint

protected open fun createAppyxIntegrationPoint(savedInstanceState: Bundle?) =
ActivityIntegrationPoint(
Expand All @@ -18,14 +18,14 @@ 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
appyxIntegrationPoint = createAppyxIntegrationPoint(savedInstanceState)
// appyxV1IntegrationPoint ready before we create a root node
appyxV1IntegrationPoint = createAppyxIntegrationPoint(savedInstanceState)
super.onCreate(savedInstanceState)
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
appyxIntegrationPoint.onActivityResult(requestCode, resultCode, data)
appyxV1IntegrationPoint.onActivityResult(requestCode, resultCode, data)
}

override fun onRequestPermissionsResult(
Expand All @@ -34,12 +34,12 @@ abstract class InteropActivity : RibActivity(), IntegrationPointProvider {
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
appyxIntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults)
appyxV1IntegrationPoint.onRequestPermissionsResult(requestCode, permissions, grantResults)
}

override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
appyxIntegrationPoint.onSaveInstanceState(outState)
appyxV1IntegrationPoint.onSaveInstanceState(outState)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ open class AppyxActivityTestRule<T : Node>(
override fun beforeActivityLaunched() {
AppyxTestActivity.composableView = { activity ->
decorator {
NodeHost(integrationPoint = activity.appyxIntegrationPoint, factory = { buildContext ->
NodeHost(integrationPoint = activity.appyxV1IntegrationPoint, factory = { buildContext ->
node = nodeFactory.create(buildContext)
node
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MainActivity : NodeActivity() {
// A surface container using the 'background' color from the theme
Surface(color = MaterialTheme.colorScheme.background) {
Column {
NodeHost(integrationPoint = appyxIntegrationPoint) {
NodeHost(integrationPoint = appyxV1IntegrationPoint) {
SamplesContainerNode(buildContext = it)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.appyxIntegrationPoint,
LocalIntegrationPoint provides appyxTestActivity.appyxV1IntegrationPoint,
) {
ComposeNavigationRoot()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MainActivity : NodeActivity() {
AppyxSandboxTheme {
// A surface container using the 'background' color from the theme
Surface(color = MaterialTheme.colorScheme.background) {
NodeHost(integrationPoint = appyxIntegrationPoint) {
NodeHost(integrationPoint = appyxV1IntegrationPoint) {
ContainerBuilder().build(buildContext = it)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ViewCustomisationsActivity : NodeActivity() {
Surface(color = MaterialTheme.colorScheme.background) {
Column {
NodeHost(
integrationPoint = appyxIntegrationPoint,
integrationPoint = appyxV1IntegrationPoint,
customisations = getCustomisations(hasCustomisedView)
) {
ViewCustomisationExampleBuilder().build(buildContext = it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ExplicitNavigationExampleActivity : NodeActivity(), Navigator {
// A surface container using the 'background' color from the theme
Surface(color = MaterialTheme.colorScheme.background) {
Column {
NodeHost(integrationPoint = appyxIntegrationPoint) {
NodeHost(integrationPoint = appyxV1IntegrationPoint) {
RootNode(
buildContext = it,
navigator = this@ExplicitNavigationExampleActivity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InteropExampleActivity : InteropActivity() {
override val rootViewGroup: ViewGroup get() = rootView

override fun createRib(savedInstanceState: Bundle?): Rib {
return RibsParentBuilder(appyxIntegrationPoint).build(
return RibsParentBuilder(appyxV1IntegrationPoint).build(
buildContext = BuildContext.root(
savedInstanceState= savedInstanceState,
customisations = ribCustomisations()
Expand Down

0 comments on commit 20f2290

Please sign in to comment.