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

Implement touch interception for layouts on Android #13725

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattleibow
Copy link
Member

@mattleibow mattleibow commented Mar 6, 2023

Description of Change

Android needs custom logic to "intercept" touch events when tapping on a view that covers another view.

We already have the InputTransparent concept, but this is for children of a layout. The touch interception is needed to stop taps on a layout/view from passing through that layout onto the view below it.

Tasks

  • Code
    • Native views
      • LayoutViewGroup
      • WrapperView
      • Check for more container views
    • Non-interactive views
      • Frame
      • Image
      • Label
      • Box
      • ProgressBar
      • ActivityIndicator
  • Manual Tests
    • ListView / ViewCell
    • CollectionView
    • Layouts (Grids/Stacks)
    • InputTransparency
  • Tests
    • Device Tests
    • UI Tests
      • ListView / ViewCell
      • CollectionView
      • Layouts (Grids/Stacks)
      • InputTransparency
  • Type/member naming!
  • More I am sure

Issues Fixed

Fixes #10252

@mattleibow mattleibow self-assigned this Mar 8, 2023
@jfversluis
Copy link
Member

Probably/maybe related: #10040

@SarthakB26
Copy link

Any idea when this will be available ? Adding empty TapGesture is not very efficient.

@samhouts samhouts added this to the .NET 8 GA milestone Jul 26, 2023
@mattleibow
Copy link
Member Author

The PR broke InputTransparent.

@@ -25,8 +25,20 @@ public partial class WrapperView : PlatformWrapperView

AView _borderView;

WeakReference<IOnTouchListener> _touchListener;
Copy link
Member

Choose a reason for hiding this comment

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

What keeps a strong reference to the IOnTouchListener? It looks like the .NET GC would collect it. Java would then try to call TouchEventInterceptor+OnTouchListener and won't be able to.

Does the event continue working after some GCs occur?

@samhouts
Copy link
Member

samhouts commented Sep 13, 2023

Tests failing?

@samhouts samhouts added the s/pr-needs-author-input PR needs an update from the author label Sep 13, 2023
@ghost
Copy link

ghost commented Sep 13, 2023

Hi @mattleibow. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time.

@ghost
Copy link

ghost commented Oct 9, 2023

Hi @mattleibow.
It seems you haven't touched this PR for the last two weeks. To avoid accumulating old PRs, we're marking it as stale. As a result, it will be closed if no further activity occurs within 4 days of this comment. You can learn more about our Issue Management Policies here.

@ghost ghost added the stale Indicates a stale issue/pr and will be closed soon label Oct 9, 2023
@ghost ghost closed this Oct 16, 2023
@mattleibow mattleibow reopened this Oct 16, 2023
@ghost ghost removed stale Indicates a stale issue/pr and will be closed soon s/pr-needs-author-input PR needs an update from the author labels Oct 16, 2023
@mattleibow mattleibow force-pushed the dev/fix-touch-interception branch 4 times, most recently from 790c5fa to a564221 Compare October 23, 2023 14:02
@mattleibow
Copy link
Member Author

/rebase

@mattleibow
Copy link
Member Author

/rebase

@samhouts samhouts added the stale Indicates a stale issue/pr and will be closed soon label Dec 7, 2023
@Redth Redth modified the milestones: .NET 8 SR2, .NET 8 + Servicing Jan 10, 2024
@samhouts samhouts added platform/android 🤖 and removed stale Indicates a stale issue/pr and will be closed soon labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ScrollView, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/android 🤖
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overlaying a StackLayout on another StackLayout does not block interaction
8 participants