@@ -20,7 +20,7 @@ public class TouchEff : RoutingEffect
2020 public TouchEff ( ) : base ( $ "{ nameof ( TouchEffect ) } .{ nameof ( TouchEff ) } ")
2121 => _visualManager = new TouchVisualManager ( ) ;
2222
23- internal TouchEff ( Func < TouchEff , TouchState , HoverState , int , CancellationToken , Task > animationTaskGetter ) : this ( )
23+ internal TouchEff ( Func < TouchEff , TouchState , HoverState , int , Easing , CancellationToken , Task > animationTaskGetter ) : this ( )
2424 => _visualManager . SetCustomAnimationTask ( animationTaskGetter ) ;
2525
2626 public event TEffectStatusChangedHandler StatusChanged ;
@@ -38,7 +38,7 @@ internal TouchEff(Func<TouchEff, TouchState, HoverState, int, CancellationToken,
3838 public event AnimationStartedHandler AnimationStarted ;
3939
4040 //The backdor for https://github.com/AndreiMisiukevich/TouchEffect/issues/71
41- [ EditorBrowsable ( EditorBrowsableState . Advanced ) ]
41+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
4242 public static bool IsForceUpdateStateAnimatedForIsToggledProperty { get ; set ; }
4343
4444 public static readonly BindableProperty IsAvailableProperty = BindableProperty . CreateAttached (
@@ -80,7 +80,6 @@ internal TouchEff(Func<TouchEff, TouchState, HoverState, int, CancellationToken,
8080 default ( object ) ,
8181 propertyChanged : TryGenerateEffect ) ;
8282
83-
8483 public static readonly BindableProperty LongPressCommandParameterProperty = BindableProperty . CreateAttached (
8584 nameof ( LongPressCommandParameter ) ,
8685 typeof ( object ) ,
@@ -394,6 +393,20 @@ internal TouchEff(Func<TouchEff, TouchState, HoverState, int, CancellationToken,
394393 TryGenerateEffect ( bindable , oldValue , newValue ) ;
395394 } ) ;
396395
396+ public static readonly BindableProperty AnimationDurationProperty = BindableProperty . CreateAttached (
397+ nameof ( AnimationDuration ) ,
398+ typeof ( int ) ,
399+ typeof ( TouchEff ) ,
400+ default ( int ) ,
401+ propertyChanged : TryGenerateEffect ) ;
402+
403+ public static readonly BindableProperty AnimationEasingProperty = BindableProperty . CreateAttached (
404+ nameof ( AnimationEasing ) ,
405+ typeof ( Easing ) ,
406+ typeof ( TouchEff ) ,
407+ null ,
408+ propertyChanged : TryGenerateEffect ) ;
409+
397410 public static readonly BindableProperty PressedAnimationDurationProperty = BindableProperty . CreateAttached (
398411 nameof ( PressedAnimationDuration ) ,
399412 typeof ( int ) ,
@@ -415,20 +428,20 @@ internal TouchEff(Func<TouchEff, TouchState, HoverState, int, CancellationToken,
415428 default ( int ) ,
416429 propertyChanged : TryGenerateEffect ) ;
417430
418- public static readonly BindableProperty HoveredAnimationDurationProperty = BindableProperty . CreateAttached (
419- nameof ( HoveredAnimationDuration ) ,
420- typeof ( int ) ,
421- typeof ( TouchEff ) ,
422- default ( int ) ,
423- propertyChanged : TryGenerateEffect ) ;
424-
425431 public static readonly BindableProperty RegularAnimationEasingProperty = BindableProperty . CreateAttached (
426432 nameof ( RegularAnimationEasing ) ,
427433 typeof ( Easing ) ,
428434 typeof ( TouchEff ) ,
429435 null ,
430436 propertyChanged : TryGenerateEffect ) ;
431437
438+ public static readonly BindableProperty HoveredAnimationDurationProperty = BindableProperty . CreateAttached (
439+ nameof ( HoveredAnimationDuration ) ,
440+ typeof ( int ) ,
441+ typeof ( TouchEff ) ,
442+ default ( int ) ,
443+ propertyChanged : TryGenerateEffect ) ;
444+
432445 public static readonly BindableProperty HoveredAnimationEasingProperty = BindableProperty . CreateAttached (
433446 nameof ( HoveredAnimationEasing ) ,
434447 typeof ( Easing ) ,
@@ -459,9 +472,6 @@ internal TouchEff(Func<TouchEff, TouchState, HoverState, int, CancellationToken,
459472 TryGenerateEffect ( bindable , oldValue , newValue ) ;
460473 } ) ;
461474
462- /// <summary>
463- /// Android only
464- /// </summary>
465475 public static readonly BindableProperty DisallowTouchThresholdProperty = BindableProperty . CreateAttached (
466476 nameof ( DisallowTouchThreshold ) ,
467477 typeof ( int ) ,
@@ -713,42 +723,54 @@ public static double GetPressedRotationY(BindableObject bindable)
713723 public static void SetPressedRotationY ( BindableObject bindable , double value )
714724 => bindable . SetValue ( PressedRotationYProperty , value ) ;
715725
716- public static int GetRegularAnimationDuration ( BindableObject bindable )
717- => ( int ) bindable . GetValue ( RegularAnimationDurationProperty ) ;
726+ public static int GetAnimationDuration ( BindableObject bindable )
727+ => ( int ) bindable . GetValue ( AnimationDurationProperty ) ;
718728
719- public static void SetRegularAnimationDuration ( BindableObject bindable , int value )
720- => bindable . SetValue ( RegularAnimationDurationProperty , value ) ;
729+ public static void SetAnimationDuration ( BindableObject bindable , int value )
730+ => bindable . SetValue ( AnimationDurationProperty , value ) ;
721731
722- public static int GetHoveredAnimationDuration ( BindableObject bindable )
723- => ( int ) bindable . GetValue ( HoveredAnimationDurationProperty ) ;
732+ public static Easing GetAnimationEasing ( BindableObject bindable )
733+ => bindable . GetValue ( AnimationEasingProperty ) as Easing ;
724734
725- public static void SetHoveredAnimationDuration ( BindableObject bindable , int value )
726- => bindable . SetValue ( HoveredAnimationDurationProperty , value ) ;
735+ public static void SetAnimationEasing ( BindableObject bindable , Easing value )
736+ => bindable . SetValue ( AnimationEasingProperty , value ) ;
727737
728738 public static int GetPressedAnimationDuration ( BindableObject bindable )
729- => ( int ) bindable . GetValue ( PressedAnimationDurationProperty ) ;
739+ => ( int ) bindable . GetValue ( PressedAnimationDurationProperty ) ;
730740
731741 public static void SetPressedAnimationDuration ( BindableObject bindable , int value )
732742 => bindable . SetValue ( PressedAnimationDurationProperty , value ) ;
733743
744+ public static Easing GetPressedAnimationEasing ( BindableObject bindable )
745+ => bindable . GetValue ( PressedAnimationEasingProperty ) as Easing ;
746+
747+ public static void SetPressedAnimationEasing ( BindableObject bindable , Easing value )
748+ => bindable . SetValue ( PressedAnimationEasingProperty , value ) ;
749+
750+ public static int GetRegularAnimationDuration ( BindableObject bindable )
751+ => ( int ) bindable . GetValue ( RegularAnimationDurationProperty ) ;
752+
753+ public static void SetRegularAnimationDuration ( BindableObject bindable , int value )
754+ => bindable . SetValue ( RegularAnimationDurationProperty , value ) ;
755+
734756 public static Easing GetRegularAnimationEasing ( BindableObject bindable )
735757 => bindable . GetValue ( RegularAnimationEasingProperty ) as Easing ;
736758
737759 public static void SetRegularAnimationEasing ( BindableObject bindable , Easing value )
738760 => bindable . SetValue ( RegularAnimationEasingProperty , value ) ;
739761
762+ public static int GetHoveredAnimationDuration ( BindableObject bindable )
763+ => ( int ) bindable . GetValue ( HoveredAnimationDurationProperty ) ;
764+
765+ public static void SetHoveredAnimationDuration ( BindableObject bindable , int value )
766+ => bindable . SetValue ( HoveredAnimationDurationProperty , value ) ;
767+
740768 public static Easing GetHoveredAnimationEasing ( BindableObject bindable )
741769 => bindable . GetValue ( HoveredAnimationEasingProperty ) as Easing ;
742770
743771 public static void SetHoveredAnimationEasing ( BindableObject bindable , Easing value )
744772 => bindable . SetValue ( HoveredAnimationEasingProperty , value ) ;
745773
746- public static Easing GetPressedAnimationEasing ( BindableObject bindable )
747- => bindable . GetValue ( PressedAnimationEasingProperty ) as Easing ;
748-
749- public static void SetPressedAnimationEasing ( BindableObject bindable , Easing value )
750- => bindable . SetValue ( PressedAnimationEasingProperty , value ) ;
751-
752774 public static int GetRippleCount ( BindableObject bindable )
753775 => ( int ) bindable . GetValue ( RippleCountProperty ) ;
754776
@@ -909,16 +931,20 @@ public HoverState HoverState
909931
910932 public double PressedRotationY => GetPressedRotationY ( Control ) ;
911933
934+ public int AnimationDuration => GetAnimationDuration ( Control ) ;
935+
936+ public Easing AnimationEasing => GetAnimationEasing ( Control ) ;
937+
912938 public int PressedAnimationDuration => GetPressedAnimationDuration ( Control ) ;
913939
914940 public Easing PressedAnimationEasing => GetPressedAnimationEasing ( Control ) ;
915941
916942 public int RegularAnimationDuration => GetRegularAnimationDuration ( Control ) ;
917943
918- public int HoveredAnimationDuration => GetHoveredAnimationDuration ( Control ) ;
919-
920944 public Easing RegularAnimationEasing => GetRegularAnimationEasing ( Control ) ;
921945
946+ public int HoveredAnimationDuration => GetHoveredAnimationDuration ( Control ) ;
947+
922948 public Easing HoveredAnimationEasing => GetHoveredAnimationEasing ( Control ) ;
923949
924950 public int RippleCount => GetRippleCount ( Control ) ;
0 commit comments