Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBonilla committed Feb 22, 2024
2 parents 36e33c7 + de29139 commit eeea820
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MaterialDesignControls.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.8.1">
<id>Plugin.MaterialDesignControls</id>
<version>3.1.3</version>
<version>3.1.4</version>
<title>MaterialDesignControls Plugin for Xamarin Forms</title>
<authors>Horus</authors>
<owners>AgustinBonillaHorus</owners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Plugin.MaterialDesignControls.Animations
{
public static class TouchAndPressAnimation
{
public static void Animate(View view, EventType gestureType)
public static void Animate(View view, EventType gestureType, bool cancelExecuteAction = true)
{
var touchAndPressEffectConsumer = view as ITouchAndPressEffectConsumer;

Expand All @@ -16,6 +16,11 @@ public static void Animate(View view, EventType gestureType)
SetAnimation(view, touchAndPressEffectConsumer);
break;
case EventType.Cancelled:
if (cancelExecuteAction)
touchAndPressEffectConsumer.ExecuteAction();

RestoreAnimation(view, touchAndPressEffectConsumer);
break;
case EventType.Released:
touchAndPressEffectConsumer.ExecuteAction();
RestoreAnimation(view, touchAndPressEffectConsumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
public virtual void ConsumeEvent(EventType gestureType)
{
if (IsEnabled && (_clickedEvent != null || (Command != null && Command.CanExecute(CommandParameter))))
TouchAndPressAnimation.Animate(this, gestureType);
TouchAndPressAnimation.Animate(this, gestureType, cancelExecuteAction: false);
}

public virtual void ExecuteAction()
Expand Down

0 comments on commit eeea820

Please sign in to comment.