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

PanGestureRecognizer is not working in Android #16978

Open
VishalOmprasad opened this issue Aug 24, 2023 · 6 comments · May be fixed by #25239
Open

PanGestureRecognizer is not working in Android #16978

VishalOmprasad opened this issue Aug 24, 2023 · 6 comments · May be fixed by #25239
Labels
area-gestures Gesture types delighter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@VishalOmprasad
Copy link

VishalOmprasad commented Aug 24, 2023

Description

We have added a simple Grid layout in the MainPage with PanGestureRecognizer. We have added Frame as the Grid's child element. Upon panning the PanUpdated event is not getting triggered.

  • Windows (Working)
PanGesture-Windows.mp4
  • Android (not working)
PanGesture-Android.mp4

Steps to Reproduce

  1. Add a Grid layout to your MainPage’s content.
  2. Add PanGestureRecognizer to the Grid layout.
  3. Hook the PanGestureRecognizer.PanUpdated event.
  4. Run the sample and do swipe/pan action.
  5. Notice that the PanUpdated event will not be called.

[XAML]

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="GridTouchTest.MainPage">

    <Grid BackgroundColor="Red">
        <Grid.GestureRecognizers>
            <PanGestureRecognizer PanUpdated="PanGestureRecognizer_PanUpdated" />
        </Grid.GestureRecognizers>
        <Frame x:Name="getStartedFrame"
               Margin="0"
               Padding="0"
               Background="#10556C"
               BorderColor="Transparent"
               CornerRadius="10"
               HorizontalOptions="FillAndExpand"
               Opacity="0.7"
               VerticalOptions="FillAndExpand"
               HasShadow="False" />
    </Grid>
</ContentPage>

[C#]

public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
        {

        }
    }

Link to public reproduction project repository

No response

Version with bug

7.0.92

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

@VishalOmprasad VishalOmprasad added the t/bug Something isn't working label Aug 24, 2023
@Eilon Eilon added the area-gestures Gesture types label Aug 24, 2023
@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Aug 24, 2023
@ghost
Copy link

ghost commented Aug 24, 2023

Hi @VishalOmprasad. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Aug 28, 2023
@ghost
Copy link

ghost commented Aug 28, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback to reproduce the issue but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@ghost ghost closed this as completed Aug 31, 2023
@adamzucchi
Copy link

adamzucchi commented Sep 1, 2023

@PureWeen @Eilon - Can this be re-opened? Or do I have to create a new bug/issue?

I just created a repro project here which seems to be what was missing from this logged bug:
MauiPanGestureBugSample

@ghost ghost removed the s/no-recent-activity Issue has had no recent activity label Sep 1, 2023
@Eilon Eilon reopened this Sep 1, 2023
@Eilon Eilon removed the s/needs-repro Attach a solution or code which reproduces the issue label Sep 1, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Dec 4, 2023
@XamlTest
Copy link

XamlTest commented Dec 4, 2023

Verified this on Visual Studio Enterprise 17.9.0 Preview 1(8.0.3). Repro on Android 14.0-API34, not repro on Windows 11 with below Project:
16978.zip

@RuddyOne

This comment was marked as off-topic.

@mfranc28
Copy link

mfranc28 commented Jul 2, 2024

Any news about this bug?

@samhouts samhouts added delighter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-gestures Gesture types delighter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants