-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Update how handler configuration is handled on Android #3484
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
base: main
Are you sure you want to change the base?
Conversation
|
||
fun setMinNumberOfPointers(minNumberOfPointers: Int) = apply { | ||
this.minNumberOfPointers = minNumberOfPointers | ||
shouldCancelWhenOutside = DEFAULT_SHOULD_CANCEL_WHEN_OUTSIDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like shouldCancelWhenOutside
was reset to false
on every config update so the default in the initializer wasn't doing anything 🙈
this.disallowInterruption = disallowInterruption | ||
shouldActivateOnStart = DEFAULT_SHOULD_ACTIVATE_ON_START | ||
disallowInterruption = DEFAULT_DISALLOW_INTERRUPTION | ||
shouldCancelWhenOutside = DEFAULT_SHOULD_CANCEL_WHEN_OUTSIDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
numberOfPointersRequired = numberOfPointers | ||
return this | ||
maxDist = defaultMaxDist | ||
shouldCancelWhenOutside = DEFAULT_SHOULD_CANCEL_WHEN_OUTSIDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Description
All handler factories were stored in the
RNGestureHandlerModule
which always seemed like an odd place to keep them in to me. This PR moves each factory to be a nested class of the relevant gesture handler. This gives us private access to the handler inside the factory, which in turn allows to get rid of the setter methods and assign directly instead. Those were with use since RNGH was written in java, but we have Kotlin now. It's time to let go and use proper syntax.It also adds default constants for each config property that didn't have it before.
Test plan
Example app