maui-animations

Library/guide for .NET MAUI view animations, covering view animations, custom animations, easing functions, and rotate/scale/translate/fade effects. Suitable for implementing view animations, fade in/out, slide animations, scale animations, rotating views, translating views, easing functions, custom animations, and animation chaining (including ViewExtensions animations). Not for gesture recognition, custom drawing, or static layout changes.

Last repository push
GitHub Stars
181
Forks
21
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "maui-animations" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-29d0aeb9f6079263dd3fb2f9d41ae1e2faefc56a6cbe522493ce74618b99ebfc. Verify the upstream source and version against https://github.com/davidortinau/maui-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Library/guide for .NET MAUI view animations, covering view animations, custom animations, easing functions, and rotate/scale/translate/fade effects. Suitable for implementing view animations, fade in/out, slide animations, scale animations, rotating views, translating views, easing functions, custom animations, and animation chaining (including ViewExtensions animations). Not for gesture recognition, custom drawing, or static layout changes.

0 Downloads

Introduction source: third_party · davidortinau · 0.0.1 Reference

SkillPi interpretation

Tasks
Running multiple animations on the same property causes visual glitches.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: maui-animations
description: >
  .NET MAUI view animations, custom animations, easing functions,
  rotation, scale, translation, and fade effects.
  USE FOR: "animate view", "fade in", "fade out", "slide animation", "scale animation",
  "rotate view", "translate view", "easing function", "custom animation", "animation chaining",
  "ViewExtensions animation".
  DO NOT USE FOR: gesture recognition (use maui-gestures), custom drawing (use maui-graphics-drawing),
  or static layout changes (use maui-data-binding).

.NET MAUI Animations

Common Mistakes

❌ Forgetting to cancel before starting new animations

Running multiple animations on the same property causes visual glitches.

// ❌ If called rapidly, animations queue and overlap
async void OnButtonClicked()
{
    await view.FadeTo(0, 500);
    await view.FadeTo(1, 500);
}

// ✅ Cancel first, then animate
async void OnButtonClicked()
{
    view.CancelAnimations();
    await view.FadeTo(0, 500);
    await view.FadeTo(1, 500);
}

❌ Custom Animation repeat callback misconception

Returning true from a child animation's repeat callback does NOT repeat the parent. Only the repeat callback passed to Commit on the parent controls parent repetition.

// ❌ This does NOT loop the parent animation
parent.Add(0.0, 1.0, new Animation(v => view.Scale = v, 1, 2));
parent.Commit(view, "MyAnim", length: 1000,
    repeat: () => false);  // Parent won't loop

// ✅ Loop the parent by passing repeat to Commit
parent.Commit(view, "MyAnim", length: 1000,
    repeat: () => true);  // This loops the entire animation

❌ AbortAnimation name mismatch

AbortAnimation("name") must match the exact string passed to Commit. A mismatch silently does nothing.

// ❌ Name mismatch — animation keeps running
parent.Commit(view, name: "MyAnimation", length: 1000);
view.AbortAnimation("myAnimation");  // Wrong case!

// ✅ Use a constant for the name
const string AnimName = "MyAnimation";
parent.Commit(view, name: AnimName, length: 1000);
view.AbortAnimation(AnimName);

Accessibility: Respect Reduced Motion

Always check IsAnimationEnabled before running animations. It is false when the OS power-save / reduced-motion mode is active.

// ❌ Ignores user's accessibility preference
await view.FadeTo(1, 500);

// ✅ Respects reduced-motion settings
if (view.IsAnimationEnabled)
    await view.FadeTo(1, 500);
else
    view.Opacity = 1;  // Jump to final state instantly

Performance Tips

  • Keep animation callbacks under 16ms — the default rate: 16 in Commit is one frame at 60fps. Complex callbacks cause jank.
  • Avoid animating layout-triggering properties (WidthRequest, HeightRequest) — use TranslationX/Y and Scale instead.
  • Use Task.WhenAll for parallel animations — sequential await chains are slower.
// ❌ Sequential — takes 1500ms total
await view.FadeTo(1, 500);
await view.ScaleTo(1.5, 500);
await view.RotateTo(360, 500);

// ✅ Parallel — takes 500ms total
await Task.WhenAll(
    view.FadeTo(1, 500),
    view.ScaleTo(1.5, 500),
    view.RotateTo(360, 500));

Easing Selection Guide

Goal Easing Why
Button feedback CubicOut Quick deceleration feels responsive
Page transitions CubicInOut Smooth start and end
Bouncing elements BounceOut Playful, attention-grabbing
Spring effects SpringOut Natural, elastic feel
Loading indicators Linear Constant speed for continuous motion
Entry/exit SinIn / SinOut Subtle, non-distracting

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供 .NET MAUI 动画开发的全面指导,涵盖常见错误、性能优化和无障碍适配
  • 面向开发者解决实际开发痛点,具有明确的实用价值
Trigger Precision92/100

Highlights

  • 触发词覆盖全面,包括 animate view、fade in、scale animation 等常见场景
  • 明确列出不适用场景,边界清晰,避免误触
Structure and Standards95/100

Areas to improve

  • description 重复 Reported severity: Minor

    description 内容在 frontmatter 和 skill_body 中重复出现

    Recommendation: 建议统一 description 位置,避免冗余

Highlights

  • 文档结构清晰,分章节组织内容,便于查阅
  • 提供大量代码示例和正误对比,增强可读性
Execution Reliability90/100

Highlights

  • 涵盖异常处理机制,如 CancelAnimations 和 AbortAnimation 的正确使用
  • 提供性能优化建议,如使用 Task.WhenAll 实现并行动画
  • 强调无障碍适配,检查 IsAnimationEnabled 以尊重用户偏好
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.