MR.Gestures handles ALL touch gestures

1567810

Posts

  • Umar3xUmar3x FRMember ✭✭✭

    Hello all,

    I need to create my own button class for custom rendering needs. But it seems then that command binding is not triggered anymore.

    My class is simple :

    public class ButtonComponent : MR.Gestures.Button
    {

    }
    

    _validateButton.SetBinding(MR.Gestures.TappedCommandProperty,
    "ValidateAddingPinCommand");

    I put ButtonComponent.TappedCommandProperty to test if it would work with but same issue, nothing triggered.

    If you know why it does such a behavior or if I could find a workaround if inheritance is causing the issue, which could be a future problem for me for other controls :/

    Thanks for your response,

    Regards,

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @RyanMorris I try to keep all other gesture event handlers on the controls working in order not to break any native functionality. This includes dragging a map around.

    @aj-ja UWP doesn't check if there are multiple elements above each other and it triggers all elements which are at the touch coordinates. I don't know, which elements are on top and as I wrote above, I don't want to break any native functionality by suppressing any touch gestures.

    @Umar3x I don't understand what you're trying to do and how. Please send me a repro project.

  • Umar3xUmar3x FRMember ✭✭✭
    edited September 2017

    Hello Michael ... I don't try to achieve anything. I'm just having a button class extending MR.Gestures.Button class ... and since I extend it this line do not work anymore, seems that as I extend it, the MR.Gestures.Button.TappedCommandProperty do not work anymore.

    public class ButtonComponent : MR.Gestures.Button
    {
    
    }
    

    private ButtonComponent _validateButton;

    _validateButton.SetBinding(MR.Gestures.Button.TappedCommandProperty, "ValidateAddingPinCommand");

    What I'm saying is that extending the class causes binding not to work.

    Thanks.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    The commands should also work in subclasses.
    Do you have a custom renderer for your ButtonComponent? Then the renderer must inherit from MR.Gestures.platform.Renderers.ButtonRenderer.

  • Umar3xUmar3x FRMember ✭✭✭

    Well it seems that it does not work with the subclass. I don't use a buttonRenderer. The command is simply not triggered.

  • Umar3xUmar3x FRMember ✭✭✭
    edited October 2017

    Hi @MichaelRumpler,

    Still got the prob. When simply extending MR.Gestures.Button (w/o any renderer, nothing) the tappedcommand is not triggered anymore.
    So with only that code :

    public class ButtonComponent : MR.Gestures.Button
        {
    
        }
    

    Thanks.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭
    edited October 2017

    I just released MR.Gestures 1.5.0.

    This version includes support for MacOS and .NET Standard 1.0.

    Of course Apple managed to make MacOS and iOS very different when it comes to gestures. So this was much more effort than I thought. There are also still some bugs in Xamarin.Forms.MacOS.

    Apple still has no multi touch displays for MacOS, so I made the touch gestures on the Mac to work as I would expect them to. If you think anything is awkward or doesn't behave as you would expect, please let me know.

    Down, Up, Tapping, Tapped, DoubleTapped, LongPressing, LongPressed, Panning, Panned and Swiped can be triggered with the mouse.
    For Pinching, Pinched, Rotating and Rotated you need a Trackpad and two or more fingers.
    Panning, Panned and Swiped can also be triggered with the Trackpad with two or more fingers.

    As the Trackpad has coordinates of its own which are not related to the touched view at all, the Points in Touches work a bit different then on the other platforms / using the mouse. Apple recommends to use [NSTouch](https://developer.apple.com/documentation/appkit/nstouch "NSTouch").normalizedPosition * deviceSize as coordinates but this is still very small if you drag and drop an element. So I added MR.Gestures.MacOS.Settings.TrackpadCoordinateRatio and multiply all coordinates by that setting. The default is 5/5, but you can change it however you want to get bigger or smaller values for the Touches.

    Apple also doesn't use the same coordinate system in MacOS as every other computer on earth. They have the 0/0 point at the LOWER left. So keep this in mind when you work with the view, touch or other coordinates.
    Most likely you'll have to do some different logic on the Mac than on the other platforms. Fortunately this is consistent with Xamarin.Forms.VisualElement.TranslationY and other Y coordinates.
    This also means that angles are counter clock wise instead of clock wise on every other platform.

    There's also a bug in Xamarin.Forms.MacOS. Their PageRenderer and ScrollViewRenderer don't have virtual methods OnElementChanged and OnElementPropertyChanged to override. Therefore I cannot hook into those elements' touch handlers. I already submitted a PR to Xamarin and they already merged it into master, but it is not yet included in XF 2.4.0.18342.

    Some elements don't work in the GestureSample. The touch gestures work completely, but the native functionality of the element does not work anymore. I'm still working on that.

    The Cell renderers don't have Touches*WithEvent methods to override, so there multitouch gestures with the Trackpad don't work. But you can still add a ContentView or similar to handle them there.

    More info can be found in my Compatibility section.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭
    edited October 2017

    Initially I wanted to use the very cheap price of EUR 10,- just for the first few weeks. Those weeks now extended to 2.5 years. It's far overdue that I raise it. The effort for MacOS and general support is too high. Some people also seem to think that I could fix all their bugs if they buy a product for €10,-. Well, sorry, I can't do that.

    MR.Gestures now costs EUR 40,-. This is the price for around 30 minutes when you hire me as consultant.

    @Umar3x As you were not able to send me a repro project, I made one for you. I added a test page to the GestureSample in Tests / Custom Button. This uses a CustomButton which inherits from the MR.Gestures.Button. It works just fine.

  • JohnBairdJohnBaird USMember ✭✭

    Thanks so much for version 1.5 which supports .net standard... works like a charm...

  • I have a similar issue on UWP where anything below an Action Sheet is fired as well.

  • RBanseRBanse DEMember

    First of all I'd like to thank you, Michael Rumpler. Your plugin saved me a lot of time.

    Now my problem: My app uses a Master-Detail-Page with 4 detail pages. One of these pages contains a TableView with a MR.Gestures.ViewCell. When this page is opened the first time, everything works fine, but switching to another page and back again crashes the app. I receive a NullReferenceException caused by the renderer in iOS.

    System.NullReferenceException: Object reference not set to an instance of an object
    at MR.Gestures.iOS.iOSGestureHandler.removeGestureRecognizers () [0x0001d] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at MR.Gestures.iOS.iOSGestureHandler.AddGestureRecognizers (MR.Gestures.IGestureAwareControl element, UIKit.UIView view) [0x0000f] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at MR.Gestures.iOS.Renderers.ViewCellRenderer.GetCell (Xamarin.Forms.Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv) [0x0000a] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at Xamarin.Forms.Platform.iOS.CellTableViewCell.GetNativeCell (UIKit.UITableView tableView, Xamarin.Forms.Cell cell, System.Boolean recycleCells, System.String templateId) [0x00080] in <9a5948fff8254b13a3d593c76c73b9b1>:0
    at Xamarin.Forms.Platform.iOS.TableViewModelRenderer.GetCell (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x0001d] in <9a5948fff8254b13a3d593c76c73b9b1>:0
    at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:79
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:63
    at MobilePos.Services.iOS.Application.Main (System.String[] args) [0x00001] in /Users/secret/project/name/iOS/Main.cs:17

    The related xaml is just that simple (sorry, I have to be here for a bit longer, before I can post links...):

    <?xml version="1.0" encoding="UTF-8"?>
    <ContentPage 
       xmlns="..." 
       xmlns:x="..."
       xmlns:i18n="clr-namespace:MobilePos.Localization"
       xmlns:util="clr-namespace:MobilePos.Helpers"
       xmlns:statics="clr-namespace:MobilePos.Statics"
       xmlns:mr="clr-namespace:MR.Gestures;assembly=MR.Gestures"
       x:Class="MobilePos.Pages.InfoPage"
       Title="{i18n:Translate Nav_Info}">
    
       <ContentPage.Resources>
          <ResourceDictionary>
             <util:SendTaskQueueCountNameConverter x:Key="ISendTaskQueueCountNameConverter"/>
          </ResourceDictionary>
       </ContentPage.Resources>
    
        <ContentPage.Content>
          <TableView Intent="Form">
             <TableView.Root>           
                <TableSection Title="{i18n:Translate TableSection_CloudConnection}">
                   <mr:ViewCell TappedCommand="{Binding ShowSendTaskQueueCommand}">
                      <Label Margin="15" Text="{Binding SendTaskQueueCount, Converter={StaticResource ISendTaskQueueCountNameConverter}}" VerticalOptions="CenterAndExpand" />
                   </mr:ViewCell>  
                </TableSection>            
             </TableView.Root>
          </TableView>
        </ContentPage.Content>
    </ContentPage>
    
  • RBanseRBanse DEMember

    First of all I'd like to thank you, Michael Rumpler. Your plugin saved me a lot of time.

    Now my problem: My app uses a Master-Detail-Page with 4 detail pages. One of these pages contains a TableView with a MR.Gestures.ViewCell. When this page is opened the first time, everything works fine, but switching to another page and back again crashes the app. I receive a NullReferenceException caused by the renderer in iOS.

    System.NullReferenceException: Object reference not set to an instance of an object
    at MR.Gestures.iOS.iOSGestureHandler.removeGestureRecognizers () [0x0001d] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at MR.Gestures.iOS.iOSGestureHandler.AddGestureRecognizers (MR.Gestures.IGestureAwareControl element, UIKit.UIView view) [0x0000f] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at MR.Gestures.iOS.Renderers.ViewCellRenderer.GetCell (Xamarin.Forms.Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv) [0x0000a] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at Xamarin.Forms.Platform.iOS.CellTableViewCell.GetNativeCell (UIKit.UITableView tableView, Xamarin.Forms.Cell cell, System.Boolean recycleCells, System.String templateId) [0x00080] in <9a5948fff8254b13a3d593c76c73b9b1>:0
    at Xamarin.Forms.Platform.iOS.TableViewModelRenderer.GetCell (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x0001d] in <9a5948fff8254b13a3d593c76c73b9b1>:0
    at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:79
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:63
    at MobilePos.Services.iOS.Application.Main (System.String[] args) [0x00001] in /Users/secret/project/name/iOS/Main.cs:17

    The related xaml is just that simple (sorry, I cannot post links right now, so I had to remove some xmlns):

    <?xml version="1.0" encoding="UTF-8"?>
    <ContentPage 
       xmlns="..." 
       xmlns:x="..."
       xmlns:i18n="clr-namespace:MobilePos.Localization"
       xmlns:util="clr-namespace:MobilePos.Helpers"
       xmlns:statics="clr-namespace:MobilePos.Statics"
       xmlns:mr="clr-namespace:MR.Gestures;assembly=MR.Gestures"
       x:Class="MobilePos.Pages.InfoPage"
       Title="{i18n:Translate Nav_Info}">
    
       <ContentPage.Resources>
          <ResourceDictionary>
             <util:SendTaskQueueCountNameConverter x:Key="ISendTaskQueueCountNameConverter"/>
          </ResourceDictionary>
       </ContentPage.Resources>
    
        <ContentPage.Content>
          <TableView Intent="Form">
             <TableView.Root>           
                <TableSection Title="{i18n:Translate TableSection_CloudConnection}">
                   <mr:ViewCell TappedCommand="{Binding ShowSendTaskQueueCommand}">
                      <Label Margin="15" Text="{Binding SendTaskQueueCount, Converter={StaticResource ISendTaskQueueCountNameConverter}}" VerticalOptions="CenterAndExpand" />
                   </mr:ViewCell>  
                </TableSection>            
             </TableView.Root>
          </TableView>
        </ContentPage.Content>
    </ContentPage>
    
  • RBanseRBanse DEMember

    First of all I'd like to thank you, Michael Rumpler. Your plugin saved me a lot of time.

    Now my problem: My app uses a Master-Detail-Page with 4 detail pages. One of these pages contains a TableView with a MR.Gestures.ViewCell. When this page is opened the first time, everything works fine, but switching to another page and back again crashes the app. I receive a NullReferenceException caused by the renderer in iOS.

    System.NullReferenceException: Object reference not set to an instance of an object
    at MR.Gestures.iOS.iOSGestureHandler.removeGestureRecognizers () [0x0001d] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at MR.Gestures.iOS.iOSGestureHandler.AddGestureRecognizers (MR.Gestures.IGestureAwareControl element, UIKit.UIView view) [0x0000f] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at MR.Gestures.iOS.Renderers.ViewCellRenderer.GetCell (Xamarin.Forms.Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv) [0x0000a] in <1b0efa77a4694803aaf75c99d82a8b9c>:0
    at Xamarin.Forms.Platform.iOS.CellTableViewCell.GetNativeCell (UIKit.UITableView tableView, Xamarin.Forms.Cell cell, System.Boolean recycleCells, System.String templateId) [0x00080] in <9a5948fff8254b13a3d593c76c73b9b1>:0
    at Xamarin.Forms.Platform.iOS.TableViewModelRenderer.GetCell (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x0001d] in <9a5948fff8254b13a3d593c76c73b9b1>:0
    at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:79
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:63
    at MobilePos.Services.iOS.Application.Main (System.String[] args) [0x00001] in /Users/secret/project/name/iOS/Main.cs:17

    The related xaml is just that simple (sorry, I cannot post links right now, so I had to remove some xmlns):

    <?xml version="1.0" encoding="UTF-8"?>
    <ContentPage 
       xmlns="..." 
       xmlns:x="..."
       xmlns:i18n="clr-namespace:MobilePos.Localization"
       xmlns:util="clr-namespace:MobilePos.Helpers"
       xmlns:statics="clr-namespace:MobilePos.Statics"
       xmlns:mr="clr-namespace:MR.Gestures;assembly=MR.Gestures"
       x:Class="MobilePos.Pages.InfoPage"
       Title="{i18n:Translate Nav_Info}">
    
       <ContentPage.Resources>
          <ResourceDictionary>
             <util:SendTaskQueueCountNameConverter x:Key="ISendTaskQueueCountNameConverter"/>
          </ResourceDictionary>
       </ContentPage.Resources>
    
        <ContentPage.Content>
          <TableView Intent="Form">
             <TableView.Root>           
                <TableSection Title="{i18n:Translate TableSection_CloudConnection}">
                   <mr:ViewCell TappedCommand="{Binding ShowSendTaskQueueCommand}">
                      <Label Margin="15" Text="{Binding SendTaskQueueCount, Converter={StaticResource ISendTaskQueueCountNameConverter}}" VerticalOptions="CenterAndExpand" />
                   </mr:ViewCell>  
                </TableSection>            
             </TableView.Root>
          </TableView>
        </ContentPage.Content>
    </ContentPage>
    
  • JonathanDibbleJonathanDibble GBMember ✭✭

    I have been checking out your Nuget package prior to purchase and I have been using it in demo mode with the app name set at "GestureSample" and the licence key setup like this :

    MR.Gestures.iOS.Settings.LicenseKey = "ALZ9-BPVU-XQ35-CEBG-5ZRR-URJQ-ED5U-TSY8-6THP-3GVU-JW8Z-RZGE-CQW6"; // key for GestureSample

    I am having problems with the LongPressedCommand on iOS firing erratically before I have lifted my finger. It works fine on my android device, but fails on iPhone and the simulator. There are no Xamarin.Forms based gesture recognizers in the page, just ones from this package.

    This is the section of my xaml
    <Frame Grid.Row="2" Grid.Column="{Binding ButtonColumnOnUi}" Padding="2" BackgroundColor="{StaticResource WhiteSmoke}" CornerRadius="6" WidthRequest="48" HeightRequest="48" VerticalOptions="Center" HorizontalOptions="Center" HasShadow="false" > <mr:Image x:Name="ButtonRewind" Source="rewindfilled" BackgroundColor="{StaticResource WhiteSmoke}" VerticalOptions="Center" HorizontalOptions="Center" LongPressingCommand="{Binding RewindCommand}" LongPressedCommand="{Binding RewindFinishedCommand}" /> </Frame>

    Is this something that is not supported in the "demo mode" or is there something else I need to do to achieve this in iOS

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @JonathanDibble That should work. Please send me a repro project so I can have a look.

  • JonathanDibbleJonathanDibble GBMember ✭✭

    @MichaelRumpler That's good to hear it should work. I must be doing something strange in the background with my iOS project. I am not really able to pass on the project without permission from my client ( isn't my intellectual property). I will let you know how I progress. Thanks

  • JonathanDibbleJonathanDibble GBMember ✭✭

    @MichaelMuegel I've got to the bottom of the problem.

    The LongPressingCommand starts a 125ms timer that moves a slider backward to simulate an audio rewind process.

    In the Elapsed event on the timer the code writes a value to the property that is bound to the Value property of the Slider. This seems to cause the LongPressedCommand to be executed, but in iOS only.

    When LongPressedCommand executes the timer is stopped.

    It seems I will need to think of another way to achieve the functionality, so that I can continue to use the MR.Gestures package

  • JonathanDibbleJonathanDibble GBMember ✭✭
    edited November 2017

    @MichaelRumpler I've got to the bottom of the problem.

    The LongPressingCommand starts a 125ms timer that moves a slider backward to simulate an audio rewind process.

    In the Elapsed event on the timer the code writes a value to the property that is bound to the Value property of the Slider. This seems to cause the LongPressedCommand to be executed, but in iOS only. Could you explain how writing to this bound property causes the LongPressedCommand to be executed?

    When LongPressedCommand executes the timer is stopped.

    It seems I will need to think of another way to achieve the functionality, so that I can continue to use the MR.Gestures package

  • Ashok_AAshok_A INMember ✭✭

    Hi MR, MR.Gestures are not working Android 6 or above versions. I am getting below error. please find attachment.

    MR.png 47.4K
  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @Ashok_A
    Your screenshot shows that your app crashed. There is no indication at all why it did that.

    Please read Save time and money by writing useful bug reports.

    You should also watch Diagnostics 101 with Jon Skeet. The video lasts an hour, but it will make you a better developer, so it is well invested time.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    Xamarin.Forms 2.5 changed the way how to access the Android Context. They said, the old code should still work, but this was not true. So I also needed to change my code.

    I released MR.Gestures 1.5.2. This version uses the new constructors in the renderes and thus requires XF 2.5.0.121934.

  • Umar3xUmar3x FRMember ✭✭✭

    @MichaelRumpler said:
    Xamarin.Forms 2.5 changed the way how to access the Android Context. They said, the old code should still work, but this was not true. So I also needed to change my code.

    I released MR.Gestures 1.5.2. This version uses the new constructors in the renderes and thus requires XF 2.5.0.121934.

    I had this prob on first release of XF 2.5. Did not investigate that much but was using frames, but now I can upgrade to XF 2.5.0.121934, thank you for this fast update @MichaelRumpler

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    Some people reported that the gestures did not work in UWP anymore. It seems like this only happens on the root page of a NavigationPage.

    I could narrow it down and found the reason in a known bug in Xamarin.Forms 2.5. Beginning with that version, the root page raises Disappearing shortly after it appeared (and raised Appearing). When I receive a Disappearing event from a page I assume that all elements on it are not visible and don't raise any events.

    Once you navigated to a different page and then back to root, then Appearing is raised again and all events should work as expected.

    So as a workaround you could either PushAsync/PopAsync another page (without animation) or you could stay on Xamarin.Forms 2.4 with MR.Gestures 1.5.0.

    I'll try to work around it in MR.Gestures too and/or fix the bug in XF myself, but this will have to wait until next week.

    The bug is already in GitHub and bugzilla.

    @JamesKennedy.0622 @jameskennedy @DirkKaiser @DirkKaiser.0558 @CarlPhilippBickmeier

  • blazespinnakerblazespinnaker CAMember
    edited January 29

    Looks really awesome, and definitely worth the 40 euros! However, when I run the example GestureSample OOB, a couple of things.

    Using ctrl-pinch doesn't seem do anything in the OOB emulator. I had to run GestureSample.DroidAppCompat as the GestureSample.Droid simply crashed (License key problem?).

    I'm running v15.5.4 of Visual Studio 2017 and Android_Accelerated_x86_Nougat. I'm using the latest GestureSamples from github.

  • blazespinnakerblazespinnaker CAMember

    Also, the lack of "issues" in the github is a tad unnerving.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @blazespinnaker

    I had to run GestureSample.DroidAppCompat as the GestureSample.Droid simply crashed (License key problem?).

    Please pull the changes of the GestureSample. The GestureSample.Droid project should work now too.

    In version 1.5.2 I changed the way how I get the app name. It seems like this does not work in all circumstances. If you have the same problem in your app, then please add the app name (which you configured in your ActivityAttribute) also to the Properties/AndroidManifest.xml. Add the android:label attribute to the application element like I did for the GestureSample. See this commit.

    I will change the code in the next version of MR.Gestures so that this will not be necessary anymore.

    Using ctrl-pinch doesn't seem do anything in the OOB emulator.

    Not all gestures work on all emulators. Please always test them on real devices. I also heard that the Xamarin Live Player has troubles with this too.

    Also, the lack of "issues" in the github is a tad unnerving.

    Only the GestureSample is on GitHub. MR.Gestures is not. So the GitHub issues should not be used for MR.Gestures. However, as this thread has become much too big and some people also opened new threads without notifying me I tend to change that decission and use GitHub in the future.

  • MetodBMetodB USMember

    @MichaelRumpler in my case using android:label is problematic because my activity name is not the same as application label. This means that my licence is no longer valid.
    Changing application label is not an ideal solution for me.

    I am currently using 1.5.0 version to overcome this issue.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    I released version 1.5.3 which uses the old way to retrieve the app name. So you don't need to write the android:label to the AndroidManifest.xml anymore.
    There were no other changes.

  • Ashok_AAshok_A INMember ✭✭

    Hi MR, when I am using MR.Gest I am littlebit confused about Longpressed event, when we longpressed the listitem first itemtapped event fired after that LongPressedEvent Fired. my req is when we click on the Long press event only longpressevents fires. how can archive.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @Ashok_A
    I always strive to keep the original functionality working. So if the respective platform selects an item on longpress, then I won't change that.
    However, you can easily work around that when you remember the old SelectedItem and re-select that after LongPressed. The Cell which has been pressed is the object sender or LongPressEventArgs.Sender in the event handler when you attach it to a Cell.

  • Ashok_AAshok_A INMember ✭✭

    @MichaelRumpler said:
    @Ashok_A
    I always strive to keep the original functionality working. So if the respective platform selects an item on longpress, then I won't change that.
    However, you can easily work around that when you remember the old SelectedItem and re-select that after LongPressed. The Cell which has been pressed is the object sender or LongPressEventArgs.Sender in the event handler when you attach it to a Cell.

    Not understood, provide any sample.

  • Ashok_AAshok_A INMember ✭✭

    @MichaelRumpler said:
    @Ashok_A
    I always strive to keep the original functionality working. So if the respective platform selects an item on longpress, then I won't change that.
    However, you can easily work around that when you remember the old SelectedItem and re-select that after LongPressed. The Cell which has been pressed is the object sender or LongPressEventArgs.Sender in the event handler when you attach it to a Cell.

    not working also, please explain clearly, when I longpress both itemtap and longpress are fired how to stop. and how to get selected item values in longpressevent.

  • LyndonHugheyLyndonHughey USUniversity ✭✭✭

    @MichaelRumpler I'm having an issue with the coordinates within the tapevent not being reported correctly when control is within a parent control whose coordinates can change.

    There are 2 buttons who's coordinates I'm querying. The first button is within a collapsible stacklayout that is manully expanded. This is the button whose Y coordinates is off. The second button is below (and outside) of the collapsible stacklayout. It's coordinates are correct and changes properly when the collapsible stacklayout above it expands.

    I've uploaded an unlisted youtube video illustrating the issue. The video can be seen at

    I've forked the GestureSample and added code so you can reproduce what I experienced in the video. It is located at:https://github.com/lhughey/GestureSample

    Thanks!

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @LyndonHughey Thanks for the repro project. This should make it much easier to find and hopefully fix the bug.

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    @LyndonHughey

    It turns out that the ViewPosition was relative to the container it was in instead of the whole window/screen. It was only correct on Windows, but on Android, iOS and MacOS it was wrong.

    During testing I also found a bug that on UWP the LongPressed event was only raised if you also handled LongPressing. I also fixed that bug.

    MR.Gestures 1.5.4 includes those fixes and is now on NuGet. This is just a small bugfix release which still runs with XF 2.5.

  • LyndonHugheyLyndonHughey USUniversity ✭✭✭

    @MichaelRumpler said:
    @LyndonHughey

    It turns out that the ViewPosition was relative to the container it was in instead of the whole window/screen. It was only correct on Windows, but on Android, iOS and MacOS it was wrong.

    During testing I also found a bug that on UWP the LongPressed event was only raised if you also handled LongPressing. I also fixed that bug.

    MR.Gestures 1.5.4 includes those fixes and is now on NuGet. This is just a small bugfix release which still runs with XF 2.5.

    Thanks for the quick update Michael! I'll be testing things in my app on Monday. Thanks.

  • TimReganTimRegan USMember ✭✭
    edited May 22

    I've bought and added MR.Gestures to my project. It still builds and deploys fine to the emulator but when I try to deploy to Xamarin Live on my Android phone I get the cryptic build error

    Start AsthmaQuestions.Android, Google Pixel 2 Player, .
    Attempting connection to debug address: 10.85.255.11:37847.
    Connected to: 10.85.255.11:37847.
    Deploying C:\Users\timregan\Source\AsthmaApp\Prototypes\AsthmaQuestions\AsthmaQuestions.Android\AsthmaQuestions.Android.csproj...
    Got device info: Google Pixel 2 Player (Android) @ 10.85.255.11:37847
    Synchronizing files...
    Building and running...
    Built with 1 messages.
    (1,1): error: Enum value not found for OneTime
    Failed to debug your app.

    Any guesses what's wrong?

  • TimReganTimRegan USMember ✭✭

    Fixed - I needed to developer enable the phone and not use Xamarin Live

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    I finally released version 2.0.0. This is a big one.

    This version is built with Xamarin.Forms 3.0. So I could upgrade some things at last.

    • build for .NET Standard 2.0

    The old version was already built for 1.0, but some clever people recommend to support both.

    • add support for WPF

    Yet another platform. This also was a lot of work, because WPF doesn't have any built in gesture recognizers. I had to handle all those myself.

    • XF3 removed support for Windows Phone 8.0 Silverlight and WP 8.1 Runtime and Windows 8.1 Runtime, so I did that too.

    This means that I can finally get rid of Visual Studio 2015 and use some features which are only supported by VS2017.

    • use one multi targeting project for all platforms. So you only need to reference one dll.

    This changed almost everything in my code. Hopefully there are no changes for you.
    Visual Studio for Mac still does not support multi targeting projects, so I had to use the old project structure with two dlls for macOS.

    • added MR.Gestures.TabbedPage

    Somebody needed to handle gestures in the tab bar of a TabbedPage. This is now possible. Unfortunately there are some big problems with that. If I attach some gesture handlers to it on iOS, then the TabbedPage doesn't work at all. So this is not available on all platforms. See the Compatibility for details.

    • if a finger is moved after LongPressing, then LongPressed will be raised with Cancelled=true and then Panning will start

    • [iOS] rotate and pinch gestures now work with more than two fingers

    The standard iOS gesture recognizers can't handle that, but as I already recognized those gestures myself for WPF, I could use that code for iOS too.

    • [Android] the elements now use the AppCompat renderers by default

    The AppCompat* controls were made obsolete and new Legacy* controls added which still use the old renderers.

    • [Android] sometimes Panned was raised with a Velocity of 0/0. In this case, I now use the Velocity of the last Panning event.
  • KaranRami93KaranRami93 Member ✭✭

    I need to get commandparameter and eventargs both.

            MR.Gestures.StackLayout stackLayout = new MR.Gestures.StackLayout()
                            {
                                PinchingCommand=PinchingCommand,
                                PinchingCommandParameter=equipmentobj,
                            };
                protected override void OnPinching(PinchEventArgs e)
                        {
                //here i need those commandparameter.
                }
    

    How can i achieve this?

Sign In or Register to comment.