Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify AppyxComponent composables #643

Merged

Conversation

KovalevAndrey
Copy link
Collaborator

@KovalevAndrey KovalevAndrey commented Dec 14, 2023

Description

AppyxComponent in appyx-interactions and appyx-navigation are identical in their core and should reused as much code as possible to simplify support

Check list

  • I have updated CHANGELOG.md if required.
  • I have updated documentation if required.

@@ -56,189 +19,27 @@ internal val defaultExtraTouch = 48.dp
fun <InteractionTarget : Any, ModelState : Any> ParentNode<InteractionTarget>.AppyxComponent(
appyxComponent: BaseAppyxComponent<InteractionTarget, ModelState>,
modifier: Modifier = Modifier,
draggables: ImmutableList<Draggable> = immutableListOf(appyxComponent),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove it or find a better implementation. If we accidentally pass an empty list it will stop working

@@ -73,7 +74,8 @@ class BackStackNode(
override fun resolve(interactionTarget: InteractionTarget, buildContext: BuildContext): Node =
when (interactionTarget) {
is InteractionTarget.Child -> node(buildContext) {
val backgroundColor = remember { colors.shuffled().random() }
val backgroundColor =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking here that we save UI state for a Node correctly

@@ -5,6 +5,7 @@
### 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any change needed on docs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope


return alignmentOffset
com.bumble.appyx.interactions.core.AppyxComponent(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be nicer to import it with an alias and don't use fully qualified name here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but not necessarily. Since it's just one method call I think it's fine like this as well

@KovalevAndrey KovalevAndrey merged commit 119020c into bumble-tech:2.x Dec 15, 2023
7 checks passed
@KovalevAndrey KovalevAndrey deleted the 2.x-appyx-component-unification branch December 15, 2023 10:00
@KovalevAndrey KovalevAndrey added this to the 2.0 milestone Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants