LongPress, Animations and More with TouchEffects in Xamarin.CommunityToolkit

Поділитися
Вставка
  • Опубліковано 12 жов 2024

КОМЕНТАРІ • 63

  • @drivetrainerYT
    @drivetrainerYT 2 роки тому +1

    You're just tearing me apart between the need to dedicate all my time to backend logic and the burning wish to restyle the ui... Thanks, Gerald.

    • @jfversluis
      @jfversluis  2 роки тому +1

      Haha errr… you’re welcome? 😅

  • @dreamhunter2895
    @dreamhunter2895 3 роки тому +2

    Thanks Sir, The way of explaining of the topic is cool. I always eagerly waiting for your new coming videos.

    • @jfversluis
      @jfversluis  3 роки тому +1

      Thank you so much Shailesh! Really appreciate it!

  • @argonjs
    @argonjs 3 роки тому +6

    Very useful and framework getting really strong.. Good work

  • @DileepKumar-vf5pk
    @DileepKumar-vf5pk 3 роки тому +1

    I like this and waiting for this... Now I'm happy and I'm going to use this for my Image Gallery for Image selection. Right now I'm using the double tap.

    • @jfversluis
      @jfversluis  3 роки тому

      That is an awesome application! Be sure to let us know if you run into anything

  • @anthalia1259
    @anthalia1259 3 роки тому +2

    Hello, different topic, but could you make a video (or several!) about performances tips and best practices (maybe also how to test that in visual studio) for xamarin form?? Thanks a lot for all the videos you made!!

    • @jfversluis
      @jfversluis  3 роки тому

      I'll put it on the list, thanks!

  •  3 роки тому

    Great video! How to combine animations? For example flipping a coin or a card : Flip an image horizontally, bring in another card/icon with animation

  • @kalixthuska8846
    @kalixthuska8846 3 роки тому

    Thank you so much for this, I wish I knew about this in XCT earlier.

    • @jfversluis
      @jfversluis  3 роки тому

      At least you know about it now!

  • @Agredo10
    @Agredo10 3 роки тому +2

    Nice! A good thing would be a optional property for longpressed when using mouse rright mouse button trigger this

    • @jfversluis
      @jfversluis  3 роки тому

      Interesting! I don’t know how that is handled at the moment to be honest :)

  • @UzairAli001
    @UzairAli001 3 роки тому +1

    Great properties to play with :)

  • @LionKing-wh7ur
    @LionKing-wh7ur Рік тому

    Cool thank you. Unfortunately the longtouch doesn't work on a StackLayout inside a collectionview. Can you help me? How I can implement a context menu after the longtouch?

  • @shadmansakib6827
    @shadmansakib6827 3 роки тому

    Useful videos.
    The doc for xamarin toolkit is not complete. Is it possible to link the videos in the doc for reference. I had hard time using some features and might have been useful to find these videos earlier.
    Thanks

    • @jfversluis
      @jfversluis  3 роки тому +1

      Since the docs are more an official thing and this is not I’m afraid that’s not possible :( were aware the docs aren’t complete (yet) being worked on and of course open to contributions!

  • @LobsterHarry
    @LobsterHarry 3 роки тому

    This is very very useful for me ! I am thinking about switching from SwipeView "Menus" to "classic" Context Menus when I need to interact with a Listview-Item for example. Question: I have always trouble to prevent Tap-Commands not firing two times if the user makes a DoubleTap. Can this be solved, too with this functionality ? Can it divide between single and double taps ?

    • @jfversluis
      @jfversluis  3 роки тому

      I think this one only registers a single tap. Of course you would be able to implement code on the command that is executed to increment some count and see if its double (or triple or...) tapped

  • @adamdiment8385
    @adamdiment8385 3 роки тому +1

    Hi Gerald, great video, very useful stuff.
    I'd like the ability to use these animations in styles to set let's say, all my buttons to have a pressed scaling without needing to set on every one
    If I do this




    It complains with "writable property expected" - would the properties be able to have setters as well as getters easily enough, or would that break the whole paradigm?
    Cheers!

    • @jfversluis
      @jfversluis  3 роки тому +1

      That's a good question, I should look into that. I see that I'm a bit late with my answer. Did you figure it out yet? I guess another way to go about this is to create a base Button (or VisualElement if you want it for everything), apply the animation to that and inherit all your things from that object. But that is a lot of work... I'm not sure if this way that you propose is supported.

    • @jfversluis
      @jfversluis  3 роки тому +1

      Looks like you should be able to: docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/effects/passing-parameters/attached-properties#Consuming_the_Effect_with_a_Style
      If you can't get it to work open an issue at aka.ms/xct so more people can chime in

  • @bojanpavlovic5038
    @bojanpavlovic5038 2 роки тому

    Thank you I really appreciate this. I needed it so badly!!! :D

    • @jfversluis
      @jfversluis  2 роки тому +1

      That’s wonderful to hear! Thanks Bojan! Glad it was useful!

    • @bojanpavlovic5038
      @bojanpavlovic5038 2 роки тому

      @@jfversluisI try using these effects. I have created a ContenView that needs to behave as a control. I have applied touch effects directly into the control but they did not work the way I want it sometimes did not even recognize the click event that I had bound to a view where I call the control. But worked only if I click on the very edge of the control or something like that sometimes, somewhere in the middle may be between the labels or so but I'm not sure I'm not quite sure if I did everything correctly but when I remove the touch effect from the ContentView and I place it in the content page where I actually call the control to render, everything worked just fine. I was just trying to avoid duplicating the code but look like we did this effect I cannot I will have two duplicate it on each place I called the control

  • @serdarpinar6186
    @serdarpinar6186 Рік тому

    Hello Gerald.. How can I burn how many times the screen has been touched? do you have an idea.. for example when I clicked 3 times in a row it was clicked 3 times, when I clicked 5 times I want to catch 5 clicks.

  • @moatasemkremed5395
    @moatasemkremed5395 3 роки тому +1

    Great and useful video gelard, thank you.
    Can you make a video, the way to lazy loading a list of items by 10 items , just please explain that using code behind not MVVM 🙏

    • @jfversluis
      @jfversluis  3 роки тому +1

      Thanks for the idea!

    • @moatasemkremed5395
      @moatasemkremed5395 3 роки тому

      @@jfversluis I am waiting that, please let it next video, 🙏😅

  • @LightoMusica
    @LightoMusica 3 роки тому

    Excellent tutorial, thanks! How does animation works in android devices that disable animations?

    • @jfversluis
      @jfversluis  3 роки тому

      I’d have to check! But I remember seeing something in the Forms codebase about that. If that happens then the animations from this are also disabled

  • @taiwantoklip
    @taiwantoklip 2 роки тому

    Dear Gerald:
    Could you please demo how to detect the touch status (touch down/touch up) in command object ?
    Thanks million

    • @jfversluis
      @jfversluis  2 роки тому +1

      Isn't that the pressed and unpressed states in the TouchEffect? What do you have issues with?

    • @taiwantoklip
      @taiwantoklip 2 роки тому

      @@jfversluis just to avoid scrolling listview while rebind data if reach specified interval of seconds
      Never mind
      I found alternative solution
      Thank you

  • @ultrabellok
    @ultrabellok 3 роки тому

    You get to judge me that little bit, but I seem to be stuck chewing on crayons when it comes to using the TouchEffects from a code only composite component. Any ideas on how to accomplish this, other than creating a XAML based component that wraps the functionality, so that I can use that in the code only composite component, which seems a touch hackish.

    • @jfversluis
      @jfversluis  3 роки тому

      I try to judge as less as possible! My default and preference is just XAML :) but I am still friends with people who use code only
      What is it you're stuck on? Everything that is possible in XAML is possible in code, you should be able to hookup the effect in code just as well. Have you seen this? docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/effects/creating#consuming-the-effect-in-c

    • @ultrabellok
      @ultrabellok 3 роки тому +1

      @@jfversluis Thanks for the quick reply and for making these videos. I was overthinking it and never thought to simply try setting element.SetBinding(TouchEffect.LongPressCommandProperty, nameof(LongPressedCommand)). The derp is strong. Thanks for your help though!

    • @jfversluis
      @jfversluis  3 роки тому

      Just glad you figured it out!

  • @mirceamuresan3494
    @mirceamuresan3494 Рік тому

    Is there a TouchEffect for Maui for iOS/Android and Windows platforms? Is there library for Maui doing what the TouchEffect is doing for Xamarin?

    • @jfversluis
      @jfversluis  Рік тому

      You’ve just commented on the issue for the .NET MAUI Community Toolkit 😅 it’s being worked on

    • @kevinqy
      @kevinqy Рік тому

      @@jfversluis when is it going to be released? We've converted our xamarin forms project to Maui, but the non-touch event in Maui is a show stopper right now.

    • @jfversluis
      @jfversluis  Рік тому

      @@kevinqy you can follow the progress here: github.com/CommunityToolkit/Maui/pull/1063
      It should never be a showstopper though. A plugin is work that someone else have done which you could have done yourself. Everything in there you can implement in your own app without having to wait for this plugin.

  • @BlyZeHD
    @BlyZeHD 2 роки тому +1

    The Long Press unfortunately doesn't Work on an Image :(

    • @jfversluis
      @jfversluis  2 роки тому

      If you think something is wrong make sure to check if there is an issue for it or create one!

  • @madhavreddy6724
    @madhavreddy6724 2 роки тому

    how that can work on an item of collectionview

    • @jfversluis
      @jfversluis  2 роки тому

      It doesn’t work now?

    • @SofadconDesarrollo
      @SofadconDesarrollo 2 місяці тому

      @@jfversluis no funciona, en un collection. ni para un frame ni border.

  • @davidmorrow1393
    @davidmorrow1393 2 роки тому

    How can long press android application icon to add actions? Like long press clock icon
    Has
    Start screen saver
    Start stopwatch
    Create new timer
    Create new alarm

    • @jfversluis
      @jfversluis  2 роки тому

      You need Xamarin.Essentials App Actions for that