Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Pan gesture on android updating two value #13863

Open
kdbhalala opened this issue Feb 25, 2021 · 3 comments
Open

[Bug] Pan gesture on android updating two value #13863

kdbhalala opened this issue Feb 25, 2021 · 3 comments

Comments

@kdbhalala
Copy link

kdbhalala commented Feb 25, 2021

Description

PanGesture On android Updating Two Value On the same point

Steps to Reproduce

  1. Pan Gesture On Frame
  2. Update Height As pan gesture updates value

##Code

<Grid>

        <!-- Any Content -->

        <Frame BackgroundColor="Purple"
        x:Name="BottomSheet"
        HeightRequest="65"
        HorizontalOptions="FillAndExpand"
        VerticalOptions="End">

        <Frame.GestureRecognizers>
            <PanGestureRecognizer PanUpdated="PanGestureRecognizer_PanUpdated" />
        </Frame.GestureRecognizers>

    </Frame>

</Grid>

code Behind

    bool up;
    bool down;
    bool isTurnY;
    int ScreenHeight = 400;
    double valueY = 2;
    void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
    {
        Debug.WriteLine("Y --> " + e.TotalY);
        switch (e.StatusType)
        {
            case GestureStatus.Running:
                if (e.TotalY >= 5 || e.TotalY <= -5 && !isTurnY)
                {
                    isTurnY = true;
                }
                if (isTurnY)
                {
                    if (e.TotalY <= valueY)
                    {
                        up = true;
                    }
                    if (e.TotalY >= valueY)
                    {
                        down = true;
                    }
                }
                if (up)
                {
                    var height = ScreenHeight - Math.Abs(e.TotalY) < 65 ? 65 : ScreenHeight - Math.Abs(e.TotalY);
                    BottomSheet.HeightRequest = height;
                }
                else
                {
                    var height = Math.Abs(e.TotalY) > ScreenHeight ? ScreenHeight : Math.Abs(e.TotalY);
                    BottomSheet.HeightRequest = height;
                }

                break;
            case GestureStatus.Completed:


                break;
        }
    }
}

Debug Value e.TotalY

Expected Behavior

Y --> 314.999993172559
Y --> 314.999993172559
Y --> 314.999993172559
Y --> 314.999993172559
Y --> 314.999993172559
Y --> 314.999993172559
Y --> 314.999993172559
Y --> 314.999993172559

Actual Behavior

Y --> 277.272721263003
Y --> 314.999993172559
Y --> 277.727266707696
Y --> 316.569373465248
Y --> 278.387556110999
Y --> 318.387555244022
Y --> 279.751192445079
Y --> 319.545447619493

Basic Information

  • Version with issue: Not Tested below 4.8
  • Last known good version: None
  • Platform Target Frameworks:
    • iOS: 14.4 work as expected
    • Android: All
@kdbhalala kdbhalala added s/unverified New report that has yet to be verified t/bug 🐛 labels Feb 25, 2021
@samhouts samhouts added this to New in Triage Feb 25, 2021
@kdbhalala kdbhalala changed the title [Bug] Pan gesture on android updating two value [Bug] Pan gesture on android updating two value p/android Feb 25, 2021
@kdbhalala kdbhalala changed the title [Bug] Pan gesture on android updating two value p/android [Bug] Pan gesture on android updating two value Feb 25, 2021
@StephaneDelcroix
Copy link
Member

Thanks for the code sample, but I'm not sure I understand the problem. could you please explain a bit more in the description ? thanks

@StephaneDelcroix StephaneDelcroix moved this from New to Needs Info in Triage Mar 1, 2021
@kdbhalala
Copy link
Author

Thanks for the code sample, but I'm not sure I understand the problem. could you please explain a bit more in the description? thanks

If We pan On android up to bottom or bottom to up at any point we stop but not lift finger from a screen then it gives me multiple values not one single value where i stopped pan

@Redth Redth moved this from Needs Info to New in Triage Mar 4, 2021
@PureWeen PureWeen added e/5 🕔 5 a/gestures 🖖 a/layout p/Android and removed s/unverified New report that has yet to be verified labels Mar 4, 2021
@PureWeen PureWeen moved this from New to Ready For Work in Triage Mar 4, 2021
@MichaelNovikov
Copy link

Any updates? I have the same problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Triage
  
Ready For Work
Development

No branches or pull requests

4 participants