-
Notifications
You must be signed in to change notification settings - Fork 469
TouchEffect (Press & Hover visual handling) + LongPress #566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dude, this is huge work, well done! I didn't run the code, since it's a Draft PR, but I did a look into the code and suggest some modifications. Please let me know what do you think.
XamarinCommunityToolkit/Effects/Touch/PlatformTouchEffect.tizen.cs
Outdated
Show resolved
Hide resolved
34dab77
to
3a59f02
Compare
A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here |
Haha wow that bot has been crazy here 😆 sorry about that! |
C'monnnnn GitHub! Not all those delete entries. Then I might as well just left them there 🤦 |
A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here |
@AndreiMisiukevich we merged a huge change, can you solve the conflicts? |
8a03b4f
to
9d8699c
Compare
A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here |
3182b84
to
02861b7
Compare
A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here |
A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here |
A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here |
@AndreiMisiukevich I'm not criticizing, I wanted this from long time, but is this good in terms of performance as well? |
I think it's not bad (I have never received any complaints) :) |
Love this project. Great work! Quick question.. I'm using an old version of TouchView (4.0.21). I'm using the Completed event to detect when the touch stops. Is there an event that fires now when the view is first touched or some way for me to do that? |
Hello, yes it exists) You still can add TouchEffect as a regular effect and use its Completed event. |
Andrei.. The completed event fires at the end of the touch. How do I detected when touch starts? There's not "Started" or "Pressed" counterpart to Completed event that I am able to find. |
You can use StateChanged event e.g. |
Thanks.. |
Really nice work❤ I have a question: When you add a touch effect on a item of a list, the item's touch effect reacts when I scroll the list. This feels unnatural as I didn't really mean to "tap" it, but I tapped it to be able to scroll. Is there a way to turn this off somehow? 🤔 |
@haavamoa I can imagine only one possible solution. Add a new property that will manage delay before animation start... |
Hm, yeah. But won't that also delay the tap when I want to tap it and not scroll? 🤔 |
reasonable) Well, I think that's impossible ( |
Maybe subscribe to scrolled event and detach / disable the touch effect for the items only when it's scrolled would work. 🤔 |
Hi @haavamoa , @AndreiMisiukevich |
Hey @AlleSchonWeg |
tested the setting, but nothing changed: <BindableLayout.ItemTemplate>
<DataTemplate>
<frames:myFrame xct:TouchEffect.DisallowTouchThreshold="1" xct:TouchEffect.NativeAnimation="True">
<frames:myFrame.GestureRecognizers>
<TapGestureRecognizer x:DataType="viewmodels:model"
Tapped="abcde"
CommandParameter="{Binding .}" />
</frames:myFrame.GestureRecognizers>
</frames:myFrame>
</DataTemplate>
</BindableLayout.ItemTemplate> |
@AlleSchonWeg hm, I guess you should fill a ticket. |
@AndreiMisiukevich if (gestureDetector.OnTouchEvent(e.Event) && e.Event?.ActionMasked != MotionEventActions.Down)
{
//you have detected the gesture you were looking for
//Do something about it
System.Diagnostics.Debug.WriteLine("sdsadad");
return;
//return true; //because you want to notify that you handled the event so it won't propogare further (optional, depending on what behavior you want)
} internal class YourGestureDetector : GestureDetector.SimpleOnGestureListener
{
//always return true in OnDown
public override bool OnDown(MotionEvent? e)
{
return true;
}
public override bool OnScroll(MotionEvent? e1, MotionEvent? e2, float distanceX, float distanceY)
{
return true;
}
public override bool OnFling(MotionEvent? e1, MotionEvent? e2, float velocityX, float velocityY)
{
return true;
}
} If i use my test scrollview: <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="AUTO" />
</Grid.ColumnDefinitions>
<ScrollView Orientation="Both"
Grid.Column="0"
Grid.Row="0">
<StackLayout Orientation="Horizontal"
Spacing="10">
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
<Label Text="TITLE"
TextColor="Black"
xct:TouchEffect.NativeAnimation="True"
FontSize="Large" />
</StackLayout>
</ScrollView>
</Grid> The scroll gesture is detected. But i have no plan, how your effect works. Perhaps you could take my sample and modify it for your effect? |
Can you raise a separate ticket with the described problem @AlleSchonWeg ? |
@AndreiMisiukevich |
Description of Change
Moving TouchEffect from https://github.com/AndreiMisiukevich/TouchEffect to XCT
Bugs Fixed
API Changes
https://github.com/AndreiMisiukevich/TouchEffect/blob/master/README.md
Behavioral Changes
None
PR Checklist