question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android: AppShell prevents gestures on native control

See original GitHub issue

Description

When using our native Android map control that uses motion events to detect and act on drag and pinch to navigate the control, the AppShell view intercepts these events and prevents dragging and pinching beyond the first few pixels (if appears that if you drag or pinch very slowly you can get a little further before this event gets intercepted and stops responding). The control works fine outside an AppShell.

The native control is relying on GestureDetector, ScaleGestureDector and MotionEvents/Touch to react to user input. It returns true on these event handlers to mark them as handled when reacting to user input.

It was suggested by @PureWeen that locking the flyout behavior could address it based on, but that didn’t help. ie in AppShell constructor:

        this.FlyoutBehavior = FlyoutBehavior.Locked;

When doing this though, I do notice that the touch events does go through the flyout and down into the map control (but still with the limited interaction). Setting InputTransparent=true or IsEnabled=false on the appshell also doesn’t have any effect.

The same control wrapped in Xamarin.Forms AppShell does not exhibit this behavior.

Steps to Reproduce

  1. Open the following project: MauiApp21.zip
  2. Run the project.
  3. On the presented world map, attempt to pan an zoom
  4. Notice that the map will stop responding to pan and zoom interactions after a few pixels of finger movement.
  5. In App.xaml.cs, change the app to launch MainPage instead of AppShell, and observe interactions now work fine.

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

Don’t use AppShell, but that’s hardly a workaround.

Relevant log output

No response

Update

As noted below looks like only horizontal gestures are getting blocked. Vertical pan and zoom/pinch works (but as soon as a horizontal threshold is performed all interaction stops)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
beto-rodriguezcommented, Oct 5, 2022

Same issue here.

In my case, the pinch gesture fires the zoom feature in a chart, notice how it is only working when the pinch is vertical, and ignored when horizontal (3 MB gif):

maui-gesture-bug

1reaction
Sasikumar3595commented, Apr 29, 2022

@jfversluis,

We are also facing the same issue after the VS update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Behavior changes: all apps
Learn about changes in Android 12 that will affect all apps. ... For more information, see the guide to animating scroll gestures.
Read more >
Getting Started | React Native Gesture Handler
A way to use a platform's native touch handling system for recognizing pinch, rotation and pan (besides a few other gestures). The ability...
Read more >
Native-like Navigation of Web apps
The animation appears to double-play, since the Safari back gesture implements the reveal animation in native code, then once it sends the back ......
Read more >
Pages and Navigation - Xamarin.Forms Succinctly Ebook
Facilitates using the swipe gesture among child pages. FlyoutPage. Manages two separate panes, and includes a flyout control. NavigationPage.
Read more >
Configure mobile monitoring settings
Enable or disable recording of native runtime crashes, exceptions and Application Not Responding (ANR) conditions, which appear on the Crash Analysis page.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found