【开源】LLMAnimator 60多种动画让你的应用动起来
2016-03-21 09:50
197 查看
github: https://github.com/brookshi/LLMAnimator ,欢迎star/fork
之前做android的时候需要给应用加些动画效果,在github上找到这个库:
https://github.com/daimajia/AndroidViewAnimations,用起来挺方便,效果也不错。
现在做uwp,想要加些动画就想到这个库,于是开发了LLMAnimator,算是上面android库的uwp移植版本。
先看效果:
View Code
如果有其他动画需求,也可以留言。
实现也很简单,以Bounce为例:
和大家平常创建动画的过程一样,这个库只是把常用的动画都集合在一起,这样用起来很方便,希望大家喜欢。
之前做android的时候需要给应用加些动画效果,在github上找到这个库:
https://github.com/daimajia/AndroidViewAnimations,用起来挺方便,效果也不错。
现在做uwp,想要加些动画就想到这个库,于是开发了LLMAnimator,算是上面android库的uwp移植版本。
先看效果:
public enum AnimationType { Bounce, Flash, Pulse, RubberBand, Shake, StandUp, Swing, Tada, Wave, Wobble, BounceIn, BounceInDown, BounceInUp, BounceInLeft, BounceInRight, FadeIn, FadeInDown, FadeInUp, FadeInLeft, FadeInRight, FadeOut, FadeOutDown, FadeOutUp, FadeOutLeft, FadeOutRight, FlipInX, FlipInY, FlipOutX, FlipOutY, RotateIn, RotateInDownLeft, RotateInDownRight, RotateInUpLeft, RotateInUpRight, RotateOut, RotateOutDownLeft, RotateOutDownRight, RotateOutUpLeft, RotateOutUpRight, SlideInDown, SlideInUp, SlideInLeft, SlideInRight, SlideOutDown, SlideOutUp, SlideOutLeft, SlideOutRight, ZoomIn, ZoomInDown, ZoomInUp, ZoomInLeft, ZoomInRight, ZoomOut, ZoomOutDown, ZoomOutUp, ZoomOutLeft, ZoomOutRight, Hinge, RollIn, RollOut, DropOut, Landing, TakingOff, }
View Code
如果有其他动画需求,也可以留言。
实现也很简单,以Bounce为例:
public class BounceAnimation : AnimationBase { public BounceAnimation() { Duration = TimeSpan.FromMilliseconds(800); } public override IAnimation PlayOn(UIElement target, Action continueWith) { var transform = Utils.PrepareTransform(target, typeof(CompositeTransform)); var storyboard = PrepareStoryboard(continueWith); AddAnimationToStoryboard(storyboard, transform, CreateAnimation(), "TranslateY"); storyboard.Begin(); return this; } Timeline CreateAnimation() { DoubleAnimationUsingKeyFrames frames = new DoubleAnimationUsingKeyFrames(); var firstTimeSpan = TimeSpan.FromMilliseconds(Duration.TotalMilliseconds / 8); frames.KeyFrames.Add(new EasingDoubleKeyFrame() { EasingFunction = new SineEase() { EasingMode = EasingMode.EaseIn }, KeyTime = KeyTime.FromTimeSpan(firstTimeSpan), Value = -8, }); frames.KeyFrames.Add(new EasingDoubleKeyFrame() { EasingFunction = new BounceEase() { Bounces = 2, Bounciness = 1.3, EasingMode = EasingMode.EaseOut }, KeyTime = KeyTime.FromTimeSpan(Duration), Value = 0, }); return frames; } }
和大家平常创建动画的过程一样,这个库只是把常用的动画都集合在一起,这样用起来很方便,希望大家喜欢。
相关文章推荐
- 互联网的网络地址分类
- [leetcode] 100 Same Tree
- Block
- shader学习
- Linux基础优化
- 【转】渗透测试工具sqlmap基础教程
- 安装activiti流程设计器插件失败最终解决方案
- 关于URI
- Android RSA加密解密
- xcode环境变量设置(转载)
- apk,task,android:process与android:sharedUserId的区别
- Gradle依赖的统一管理
- iOS中文件的上传下载功能
- React传递props
- PHP PSR-4 基本代码规范(中文版)
- .net平台 基于 XMPP协议的即时消息服务端简单实现
- RxJava例子
- 网络通信中的错误处理(记录)
- 获取手机参数
- 夺命雷公狗---DEDECMS----15dedecms首页栏目列表页导航部分完成