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

Refactor interop touches handling #1818

Merged
merged 4 commits into from
Feb 4, 2025
Merged

Conversation

ASalavei
Copy link
Collaborator

@ASalavei ASalavei commented Jan 31, 2025

Update the inner logic of the UserInputGestureRecognizer, which is responsible for handling and sending touches to Compose:

  • Rework the interception of Interop gestures while maintaining the same user experience.
  • UIScrollView subclasses get higher priority over Compose scrolling when content can be scrolled.
  • Support the ability to abort gestures when overtaken by gesture recognisers or Interop views.
    Update InteropWrappingView' to properly disable interop views for touches when it's needed. Refactor MetalRedrawer' to simplify the calculation of the needsToBeProactive flag.

Fixes https://youtrack.jetbrains.com/issue/CMP-7296/UIKit-UIMenu-is-not-dismissed-on-click-of-Composable
Fixes https://youtrack.jetbrains.com/issue/CMP-6683/iOS-prohibit-interop-tap-interceptions
Fixes: https://youtrack.jetbrains.com/issue/CMP-7014/iOS-interactive-pop-fails-sometimes-when-integrating-Compose-into-UINavigationController
Fixes: https://youtrack.jetbrains.com/issue/CMP-3806/Nested-scrolling-does-not-interopate-with-Swift-UI-scrolling-on-iOS
Fixes: https://youtrack.jetbrains.com/issue/CMP-1606/iOS-integrate-touches-consumption
Fixes: https://youtrack.jetbrains.com/issue/CMP-5877/iOS-non-eager-touch-interception
Partially fixes: https://youtrack.jetbrains.com/issue/CMP-5707/iOS-compose-inside-modal-pan-interop

Release Notes

Fixes - iOS

  • Fixed issues where the interactive pop gesture would stop working.
  • Fixes an issue where it's not possible to close the UIMenu that appears over the Compose content.

Features - iOS

  • Compose works correctly with nested UIScrollViews, as well as within UIScrollViews.
  • Added the ability to close modal Compose view controllers (with non-scrollable content on them) with a swipe gesture.

@ASalavei ASalavei changed the title Refactor interop touches handling [WIP] Refactor interop touches handling Jan 31, 2025
@ASalavei ASalavei changed the title [WIP] Refactor interop touches handling Refactor interop touches handling Feb 1, 2025
@ASalavei ASalavei marked this pull request as ready for review February 1, 2025 12:00
Copy link

@elijah-semyonov elijah-semyonov left a comment

Choose a reason for hiding this comment

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

LGTM

@ASalavei ASalavei merged commit ef6dd67 into jb-main Feb 4, 2025
7 checks passed
@ASalavei ASalavei deleted the andrei.salavei/interop-touches branch February 4, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants