Xui.ToolKit.UI.Layer
Assembly: Xui.ToolKit.UI · C# declarations · Assembly overview
Types
struct PressFeedbackLayer<TView>
Delayed press feedback and bounded, overlapping ripples. The host owns gesture capture and calls Begin/End when a press starts, commits or is cancelled. One layer can paint many logical cells by selecting a Target before arranging/rendering; it never allocates per-cell state.
public struct PressFeedbackLayer<TView> : ILayer<TView> where TView : class, ILayerHost
{
public int Target;
public Color Background;
public Color RippleColor;
public CornerRadius CornerRadius;
public static bool ShouldDelay(TView view, ref PointerEventRef e);
public void Begin(TView view, Point position, bool delay);
public void End(TView view, bool tapped);
public void HoldReleasedFeedback();
public void Activate(TView view);
public readonly bool IsPressVisible { get; }
public nfloat FeedbackOpacity { get; }
public Size Measure(TView view, Size availableSize, IMeasureContext context);
public void Arrange(TView view, Rect rect, IMeasureContext context);
public void SetBounds(Rect rect);
public void Render(TView view, IContext context);
public void Animate(TView view, TimeSpan previousTime, TimeSpan currentTime);
public void OnPointerEvent(TView view, ref PointerEventRef e, EventPhase phase);
public void OnKeyDown(TView view, ref KeyEventRef e);
public void OnChar(TView view, ref KeyEventRef e);
public void OnFocus(TView view);
public void OnBlur(TView view);
}
void PressFeedbackLayer<TView>.Activate(TView view)
public void Activate(TView view);
Resumes completed feedback after reparenting, or clears it if the clock changed.
void PressFeedbackLayer<TView>.Animate(TView view, TimeSpan previousTime, TimeSpan currentTime)
public void Animate(TView view, TimeSpan previousTime, TimeSpan currentTime);
Advances time-based state (animations, blinking cursors, etc.).
void PressFeedbackLayer<TView>.Arrange(TView view, Rect rect, IMeasureContext context)
public void Arrange(TView view, Rect rect, IMeasureContext context);
Finalises position and size within rect.
Color PressFeedbackLayer<TView>.Background
public Color Background;
Optional pressed background; transparent by default.
void PressFeedbackLayer<TView>.Begin(TView view, Point position, bool delay)
public void Begin(TView view, Point position, bool delay);
Starts feedback at a point in the same coordinate space as the arranged bounds.
CornerRadius PressFeedbackLayer<TView>.CornerRadius
public CornerRadius CornerRadius;
Outline used to clip feedback to the arranged bounds.
void PressFeedbackLayer<TView>.End(TView view, bool tapped)
public void End(TView view, bool tapped);
Quick taps show immediately and hold for 200ms; early scroll cancellation stays invisible.
NFloat PressFeedbackLayer<TView>.FeedbackOpacity
public nfloat FeedbackOpacity { get; }
Current background strength for Target, for hosts that blend their own themed fill.
void PressFeedbackLayer<TView>.HoldReleasedFeedback()
public void HoldReleasedFeedback();
Keeps the most recently committed tap visible while its host awaits the first highlighted render.
readonly bool PressFeedbackLayer<TView>.IsPressVisible
public readonly bool IsPressVisible { get; }
Whether the current press has reached its highlight recognition time.
Size PressFeedbackLayer<TView>.Measure(TView view, Size availableSize, IMeasureContext context)
public Size Measure(TView view, Size availableSize, IMeasureContext context);
Returns the desired border-edge size given the available space.
void PressFeedbackLayer<TView>.OnBlur(TView view)
public void OnBlur(TView view);
Called when the host view loses keyboard focus.
void PressFeedbackLayer<TView>.OnChar(TView view, ref KeyEventRef e)
public void OnChar(TView view, ref KeyEventRef e);
Handles a character input event while the host view has focus.
void PressFeedbackLayer<TView>.OnFocus(TView view)
public void OnFocus(TView view);
Called when the host view gains keyboard focus.
void PressFeedbackLayer<TView>.OnKeyDown(TView view, ref KeyEventRef e)
public void OnKeyDown(TView view, ref KeyEventRef e);
Handles a key-down event while the host view has focus.
void PressFeedbackLayer<TView>.OnPointerEvent(TView view, ref PointerEventRef e, EventPhase phase)
public void OnPointerEvent(TView view, ref PointerEventRef e, EventPhase phase);
Handles a pointer event in the given dispatch phase.
void PressFeedbackLayer<TView>.Render(TView view, IContext context)
public void Render(TView view, IContext context);
Draws content. Called after Arrange.
Color PressFeedbackLayer<TView>.RippleColor
public Color RippleColor;
Ripple color, rendered at twelve percent opacity.
void PressFeedbackLayer<TView>.SetBounds(Rect rect)
public void SetBounds(Rect rect);
Sets bounds before input, without requiring a drawing/measurement context.
bool PressFeedbackLayer<TView>.ShouldDelay(TView view, ref PointerEventRef e)
public static bool ShouldDelay(TView view, ref PointerEventRef e);
Whether a competing ancestor drag gesture warrants a touch recognition delay.
int PressFeedbackLayer<TView>.Target
public int Target;
Logical cell to begin or render. Leave at zero for a single button.