maui-animations

用于 .NET MAUI 视图动画的库/指南,包含视图动画实现、自定义动画、缓动函数,以及旋转、缩放、平移和淡入/淡出效果。适用于实现视图动画、淡入/淡出、滑动动画、缩放动画、旋转视图、平移视图、缓动函数、自定义动画与动画链式调用(包括 ViewExtensions 动画)。不用于手势识别、自定义绘图或静态布局更改。

仓库最近推送
GitHub Stars
181
Forks
21
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "maui-animations":https://skillpi.com/zh/skills/deepskill-29d0aeb9f6079263dd3fb2f9d41ae1e2faefc56a6cbe522493ce74618b99ebfc。安装前核对上游来源和版本:https://github.com/davidortinau/maui-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于 .NET MAUI 视图动画的库/指南,包含视图动画实现、自定义动画、缓动函数,以及旋转、缩放、平移和淡入/淡出效果。适用于实现视图动画、淡入/淡出、滑动动画、缩放动画、旋转视图、平移视图、缓动函数、自定义动画与动画链式调用(包括 ViewExtensions 动画)。不用于手势识别、自定义绘图或静态布局更改。

0 下载

介绍来源: third_party · davidortinau · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
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

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

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

亮点

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

待提升项

  • description 重复 原报告严重程度:轻微

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

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

亮点

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

亮点

  • 涵盖异常处理机制,如 CancelAnimations 和 AbortAnimation 的正确使用
  • 提供性能优化建议,如使用 Task.WhenAll 实现并行动画
  • 强调无障碍适配,检查 IsAnimationEnabled 以尊重用户偏好
证据可验 (前四项均值)89/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

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

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。