Skip to content

[Proposal] TouchEffect #86

@TheCodeTraveler

Description

@TheCodeTraveler

TouchEffect

  • Proposed
  • Prototype
  • Implementation
    • iOS Support
    • Android Support
    • macOS Support
    • Windows Support
  • Unit Tests: Not Started
  • Sample: Not Started
  • Documentation: Not Started

Summary

Adds additional touch events to any VisualElement

Detailed Design

TouchEffect.shared.cs

public class TouchEffect : RoutingEffect
{
  public event EventHandler<TouchStatusChangedEventArgs> StatusChanged;
  public event EventHandler<TouchStateChangedEventArgs> StateChanged;
  public event EventHandler<TouchInteractionStatusChangedEventArgs> InteractionStatusChanged;
  public event EventHandler<HoverStatusChangedEventArgs> HoverStatusChanged;
  public event EventHandler<HoverStateChangedEventArgs> HoverStateChanged;
  public event EventHandler<TouchCompletedEventArgs> Completed;
  public event EventHandler<LongPressCompletedEventArgs> LongPressCompleted;
  
  public static readonly BindableProperty IsAvailableProperty;
  public static readonly BindableProperty ShouldMakeChildrenInputTransparentProperty;
  public static readonly BindableProperty CommandProperty;
  public static readonly BindableProperty LongPressCommandProperty;
  public static readonly BindableProperty CommandParameterProperty;
  public static readonly BindableProperty LongPressCommandParameterProperty;
  public static readonly BindableProperty LongPressDurationProperty;
  public static readonly BindableProperty StatusProperty;
  public static readonly BindableProperty StateProperty;
  public static readonly BindableProperty InteractionStatusProperty;
  public static readonly BindableProperty HoverStatusProperty;
  public static readonly BindableProperty HoverStateProperty;
  public static readonly BindableProperty NormalBackgroundColorProperty;
  public static readonly BindableProperty HoveredBackgroundColorProperty;
  public static readonly BindableProperty PressedBackgroundColorProperty;
  public static readonly BindableProperty NormalOpacityProperty;
  public static readonly BindableProperty HoveredOpacityProperty;
  public static readonly BindableProperty PressedOpacityProperty;
  public static readonly BindableProperty NormalScaleProperty;
  public static readonly BindableProperty HoveredScaleProperty;
  public static readonly BindableProperty PressedScaleProperty;
  public static readonly BindableProperty NormalTranslationXProperty;
  public static readonly BindableProperty HoveredTranslationXProperty;
  public static readonly BindableProperty PressedTranslationXProperty;
  public static readonly BindableProperty NormalTranslationYProperty;
  public static readonly BindableProperty HoveredTranslationYProperty;
  public static readonly BindableProperty PressedTranslationYProperty;
  public static readonly BindableProperty NormalRotationProperty;
  public static readonly BindableProperty HoveredRotationProperty;
  public static readonly BindableProperty PressedRotationProperty;
  public static readonly BindableProperty NormalRotationXProperty;
  public static readonly BindableProperty HoveredRotationXProperty;
  public static readonly BindableProperty PressedRotationXProperty;
  public static readonly BindableProperty NormalRotationYProperty;
  public static readonly BindableProperty HoveredRotationYProperty;
  public static readonly BindableProperty PressedRotationYProperty;
  public static readonly BindableProperty AnimationDurationProperty;
  public static readonly BindableProperty AnimationEasingProperty;
  public static readonly BindableProperty PressedAnimationDurationProperty;
  public static readonly BindableProperty PressedAnimationEasingProperty;
  public static readonly BindableProperty NormalAnimationDurationProperty;
  public static readonly BindableProperty NormalAnimationEasingProperty;
  public static readonly BindableProperty HoveredAnimationEasingProperty;
  public static readonly BindableProperty PulseCountProperty;
  public static readonly BindableProperty IsToggledProperty;
  public static readonly BindableProperty DisallowTouchThresholdProperty;
  public static readonly BindableProperty NativeAnimationProperty;
  public static readonly BindableProperty NativeAnimationColorProperty;
  public static readonly BindableProperty NativeAnimationRadiusProperty;
  public static readonly BindableProperty NativeAnimationShadowRadiusProperty;
  public static readonly BindableProperty NormalBackgroundImageSourceProperty;
  public static readonly BindableProperty HoveredBackgroundImageSourceProperty;
  public static readonly BindableProperty PressedBackgroundImageSourceProperty;
  public static readonly BindableProperty BackgroundImageAspectProperty;
  public static readonly BindableProperty NormalBackgroundImageAspectProperty;
  public static readonly BindableProperty HoveredBackgroundImageAspectProperty;
  public static readonly BindableProperty PressedBackgroundImageAspectProperty;
  public static readonly BindableProperty ShouldSetImageOnAnimationEndProperty;
}

Usage Syntax

<Button TouchEffect.PressedScale="3">
</Button>

C# Usage

var button = new Button();
TouchEffect.SetPressedScale(button, 3);

Metadata

Metadata

Assignees

Labels

approvedThis Proposal has been approved and is ready to be added to the ToolkitchampionA member of the .NET MAUI Toolkit core team has chosen to champion this featurein-progressproposalA fully fleshed out proposal describing a new feature in syntactic and semantic detail

Type

No type

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions