通过FancyView提供 Android 酷炫的开屏动画实例代码
时间:2021-06-19 08:16:33|栏目:Android代码|点击: 次
效果
使用
compile 'site.gemus:openingstartanimation:1.0.0' //在gradle中导入项目 OpeningStartAnimation openingStartAnimation = new OpeningStartAnimation.Builder(this) .setDrawStategy(new NormalDrawStrategy()) //设置动画效果 .create(); openingStartAnimation.show(this);
除此之外,还可以设置文字、图标、一句话描述、动画时间等等,也可以自定义开屏动画,开放了策略接口,像这样
OpeningStartAnimation openingStartAnimation = new OpeningStartAnimation.Builder(this) .setDrawStategy(new DrawStrategy() { @Override public void drawAppName(Canvas canvas, float fraction, String name, int colorOfAppName, WidthAndHeightOfView widthAndHeightOfView) { } @Override public void drawAppIcon(Canvas canvas, float fraction, Drawable icon, int colorOfIcon, WidthAndHeightOfView widthAndHeightOfView) { } @Override public void drawAppStatement(Canvas canvas, float fraction, String statement, int colorOfStatement, WidthAndHeightOfView widthAndHeightOfView) { } }) .create();
总结
栏 目:Android代码
本文标题:通过FancyView提供 Android 酷炫的开屏动画实例代码
本文地址:http://www.codeinn.net/misctech/144390.html