-
Notifications
You must be signed in to change notification settings - Fork 60
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
Double tap and triple tap gesture handling in textfields on iOS #831
Double tap and triple tap gesture handling in textfields on iOS #831
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
...ndation/src/uikitMain/kotlin/androidx/compose/foundation/gestures/UIKitTapGestureDetector.kt
Outdated
Show resolved
Hide resolved
...ndation/src/uikitMain/kotlin/androidx/compose/foundation/gestures/UIKitTapGestureDetector.kt
Outdated
Show resolved
Hide resolved
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.
Thanks!
There some suggestions to reduce duplication, and small correction fixes
...tion/src/uikitMain/kotlin/androidx/compose/foundation/text/TextFieldPointerModifier.uikit.kt
Outdated
Show resolved
Hide resolved
.../src/androidMain/kotlin/androidx/compose/foundation/text/TextFieldPointerModifier.android.kt
Show resolved
Hide resolved
...ndation/src/uikitMain/kotlin/androidx/compose/foundation/gestures/UIKitTapGestureDetector.kt
Outdated
Show resolved
Hide resolved
...tion/src/uikitMain/kotlin/androidx/compose/foundation/text/TextFieldPointerModifier.uikit.kt
Show resolved
Hide resolved
...tion/src/uikitMain/kotlin/androidx/compose/foundation/text/TextFieldPointerModifier.uikit.kt
Outdated
Show resolved
Hide resolved
...ndation/src/uikitMain/kotlin/androidx/compose/foundation/gestures/UIKitTapGestureDetector.kt
Outdated
Show resolved
Hide resolved
...ndation/src/uikitMain/kotlin/androidx/compose/foundation/gestures/UIKitTapGestureDetector.kt
Outdated
Show resolved
Hide resolved
...ndation/src/uikitMain/kotlin/androidx/compose/foundation/gestures/UIKitTapGestureDetector.kt
Outdated
Show resolved
Hide resolved
.../src/androidMain/kotlin/androidx/compose/foundation/text/TextFieldPointerModifier.android.kt
Show resolved
Hide resolved
...tion/src/uikitMain/kotlin/androidx/compose/foundation/text/TextFieldPointerModifier.uikit.kt
Outdated
Show resolved
Hide resolved
.../src/androidMain/kotlin/androidx/compose/foundation/text/TextFieldPointerModifier.android.kt
Show resolved
Hide resolved
… in uikit sourceset
…ompose/foundation/text/TextFieldPointerModifier.common.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…mpose/foundation/text/TextFieldPointerModifier.uikit.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…mpose/foundation/text/TextFieldPointerModifier.uikit.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…mpose/foundation/text/TextFieldPointerModifier.uikit.kt Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
… added handling of tap, double tap and triple tap on textfield
6fe5f86
to
a8b1134
Compare
move tap detection logic to skiko remove redunant code remove duplicate
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.
Looks good, thanks!
…textfields on iOS (#831) ## Proposed Changes Added UIKitTapGesturesDetector.kt - repeating tap gestures detector. Moved and separated the logic for handling taps in the textfields. Added handling of double and triple taps in the textfields on iOS. This PR also includes review fixes from [my previous, closed one](#798) ## Testing Test: Open any screen with textfield with mutable text, then try to double or triple tap on text (or if its empty, write something in it). Try to test with focused textfield and unfocused. Double tap selects the word, triple tap selects the paragraph. ## Issues Fixed JetBrains/compose-multiplatform#2682 https://youtrack.jetbrains.com/issue/COMPOSE-333/iOS-TextField-Incorrect-behavior-of-text-selection-by-double-tap (YT double version of the previous issue) https://youtrack.jetbrains.com/issue/COMPOSE-409/iOS-TextField-support-triple-tap-handle ## Google CLA You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/. This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well. --------- Co-authored-by: dima.avdeev <dima.avdeev@jetbrains.com> Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…tap gesture handling in textfields on iOS (#831) ## Proposed Changes Added UIKitTapGesturesDetector.kt - repeating tap gestures detector. Moved and separated the logic for handling taps in the textfields. Added handling of double and triple taps in the textfields on iOS. This PR also includes review fixes from [my previous, closed one](#798) ## Testing Test: Open any screen with textfield with mutable text, then try to double or triple tap on text (or if its empty, write something in it). Try to test with focused textfield and unfocused. Double tap selects the word, triple tap selects the paragraph. ## Issues Fixed JetBrains/compose-multiplatform#2682 https://youtrack.jetbrains.com/issue/COMPOSE-333/iOS-TextField-Incorrect-behavior-of-text-selection-by-double-tap (YT double version of the previous issue) https://youtrack.jetbrains.com/issue/COMPOSE-409/iOS-TextField-support-triple-tap-handle ## Google CLA You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/. This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well. --------- Co-authored-by: dima.avdeev <dima.avdeev@jetbrains.com> Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
Proposed Changes
Added UIKitTapGesturesDetector.kt - repeating tap gestures detector.
Moved and separated the logic for handling taps in the textfields.
Added handling of double and triple taps in the textfields on iOS.
This PR also includes review fixes from my previous, closed one
Testing
Test: Open any screen with textfield with mutable text, then try to double or triple tap on text (or if its empty, write something in it). Try to test with focused textfield and unfocused.
Double tap selects the word, triple tap selects the paragraph.
Issues Fixed
JetBrains/compose-multiplatform#2682
https://youtrack.jetbrains.com/issue/COMPOSE-333/iOS-TextField-Incorrect-behavior-of-text-selection-by-double-tap (YT double version of the previous issue)
https://youtrack.jetbrains.com/issue/COMPOSE-409/iOS-TextField-support-triple-tap-handle
Google CLA
You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/.
This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.