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

iOS multitap selection in selection container #984

Merged

Conversation

mazunin-v-jb
Copy link

Proposed Changes

  • Allow selecting text in Selection Container by double and triple tap on the text like in textfields.

Testing

Test: Open test app, go Components -> Selection, try to select text.

Issues Fixed

Fixes: https://youtrack.jetbrains.com/issue/COMPOSE-440/iOS-support-double-tap-text-selection-in-SelectionContainer

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.

@mazunin-v-jb mazunin-v-jb self-assigned this Jan 8, 2024
@mazunin-v-jb mazunin-v-jb marked this pull request as draft January 8, 2024 15:00
@mazunin-v-jb
Copy link
Author

mazunin-v-jb commented Jan 8, 2024

Caught a rare, unstable and strange crash. It shouldn't be related to this PR, so I want to ensure that it's not a https://youtrack.jetbrains.com/issue/COMPOSE-478/fix-iOS-SelectionContainer first.
I'll keep that as a draft for now.

upd. couldn't reproduce it for several days. I think it's a non-related bug. I'll make this PR as ready for review.

@mazunin-v-jb mazunin-v-jb marked this pull request as ready for review January 16, 2024 18:11
@mazunin-v-jb mazunin-v-jb requested review from MatkovIvan and igordmn and removed request for MatkovIvan and igordmn January 16, 2024 18:13
@mazunin-v-jb
Copy link
Author

So many changes from androidx-main in these files both refactoring and logical, I'll convert this PR to draft again. Need to check and adapt my changes.

@mazunin-v-jb mazunin-v-jb marked this pull request as draft January 18, 2024 21:33
@mazunin-v-jb mazunin-v-jb force-pushed the v.mazunin/dev/multitap-selection-in-selection-container branch from 102f34d to 9cfccfa Compare January 25, 2024 01:14
@mazunin-v-jb mazunin-v-jb marked this pull request as ready for review January 25, 2024 15:12
@mazunin-v-jb
Copy link
Author

mazunin-v-jb commented Jan 25, 2024

Now should work as planned.
@dima-avdeev-jb, there is an issue with crush on calling the context menu, so we shouldn't merge it before your fix for that.

Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

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

It seems like a lot of code without unit test coverage.
Also, I'd prefer sharing the code instead of copying it.

However, I'm not going to block this PR, just consider it as a future improvement.

}
}

// The rest of that method copied from SelectionGestures.kt
Copy link
Member

Choose a reason for hiding this comment

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

Can we share the code instead of copy-pasting?

Copy link
Author

Choose a reason for hiding this comment

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

We can as well as the other copy-paste, but I thought it would be better to have as less common code changes as possible.

@mazunin-v-jb mazunin-v-jb force-pushed the v.mazunin/dev/multitap-selection-in-selection-container branch from 1e84a5a to 1aa9dcd Compare January 29, 2024 11:52
@mazunin-v-jb mazunin-v-jb merged commit 7d6901f into jb-main Jan 29, 2024
6 checks passed
@mazunin-v-jb mazunin-v-jb deleted the v.mazunin/dev/multitap-selection-in-selection-container branch January 29, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants