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

Issue #494: Add flag to control gesture continuity #599

Merged
merged 5 commits into from
Sep 19, 2023

Conversation

vladcipariu91
Copy link
Collaborator

Issue

Description

Added isContinuous Boolean flag to Gesture. This is set to true by default. However in cases where a new gesture being created with the remaining offset isn't desirable this can be set to false.

Check list

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

…eated as a new operation or simply discarded
@vladcipariu91 vladcipariu91 self-assigned this Sep 18, 2023
@vladcipariu91 vladcipariu91 changed the title Add flag to control gesture continuity Issue #494: Add flag to control gesture continuity Sep 18, 2023
@@ -6,16 +6,24 @@ import com.bumble.appyx.interactions.core.ui.math.proportionOf

open class Gesture<InteractionTarget, ModelState> internal constructor(
val operation: Operation<ModelState>,
val isContinuous: Boolean,
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think if we moved it to GestureFactory? That way it wouldn't need to be specified per every gesture. The cases we have so far are either all of them are continuous or all of them are not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the current option gives more control, however your suggestion is simpler to use, I would choose the existing one, but it's your call

Copy link
Contributor

Choose a reason for hiding this comment

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

Can be a combination:

  • GestureFactory provides the default
  • Gesture falls back to factory default but allows overriding if you want

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming based on the cases so far that it's either/or for the whole of it, so if it's only one choice I'd go with factory-level definition for its ease.

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'll update to only use on the factory

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@zsoltk done!

@vladcipariu91 vladcipariu91 merged commit 8ccd6a3 into bumble-tech:2.x Sep 19, 2023
@vladcipariu91 vladcipariu91 deleted the 494_gesture_control_flag branch September 19, 2023 13:43
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