-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
Add Text
component
#3202
base: main
Are you sure you want to change the base?
Add Text
component
#3202
Conversation
android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt
Outdated
Show resolved
Hide resolved
@@ -79,6 +86,7 @@ class NativeViewGestureHandler : GestureHandler<NativeViewGestureHandler>() { | |||
is ReactEditText -> this.hook = EditTextHook(this, view) | |||
is ReactSwipeRefreshLayout -> this.hook = SwipeRefreshLayoutHook(this, view) | |||
is ReactScrollView -> this.hook = ScrollViewHook() | |||
is ReactTextView -> this.hook = TextHook() |
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.
is ReactTextView -> this.hook = TextHook() | |
is ReactTextView -> this.hook = TextViewHook() |
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.
I didn't like it either 😅
Changed in 1852e67
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.
You may have forgotten to commit this change or to push it 😅
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.
Seems like I did forgot to push it 😅 (5697078)
@@ -201,6 +214,10 @@ class NativeViewGestureHandler : GestureHandler<NativeViewGestureHandler>() { | |||
fun shouldCancelRootViewGestureHandlerIfNecessary() = false | |||
} | |||
|
|||
private class TextHook() : NativeViewGestureHandlerHook { | |||
override fun shouldRecognizeSimultaneously(handler: GestureHandler<*>) = false |
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.
Doesn't this break in ScrollView
?
event.nativeEvent.oldState === State.ACTIVE && | ||
event.nativeEvent.state === State.END |
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.
Have you tried on iOS? Maybe checking simply the END
state is enough?
Description
This PR adds
Text
component to Gesture Handler.Upon investigating #3159 we decided that it will be better to add our own
Text
component, instead of forcing users to create their own version ofText
withNativeViewGestureHandler
.Test plan
Tested on the following code: