当前位置: 首页 > news >正文

宝鸡市网站建设_网站建设公司_企业官网_seo优化

wpsppt网站链接怎么做,课程网站开发过程,北京医疗网站建设,天津网站建设设计效果图如下#xff1a;我的视频 1_20170207191503.gif这个简单动画的主要思路#xff1a; 将多个 红包View 通过 属性动画 从屏幕顶端 飘落到 屏幕底部。只不过在飘落的动画过程中#xff0c;加入了一些随机路线 Path。主要涉及到的知识点#xff1a;1.Path 和 PathMeasure…效果图如下我的视频 1_20170207191503.gif这个简单动画的主要思路 将多个 红包View 通过 属性动画 从屏幕顶端 飘落到 屏幕底部。只不过在飘落的动画过程中加入了一些随机路线 Path。主要涉及到的知识点1.Path 和 PathMeasure : 了解PathMeasure 绘制路线2.Animation 执行动画绘制路线代码 通过 Path.cubicTo 方法public Path createPath(View parent,int factor ){//主要通过 Path.cubicTo 方法生成一个贝塞尔曲线// cubicTo(float x1, float y1, float x2, float y2,float x3, float y3)// 我们需要三个坐标点int x mRandom.nextInt(mConfig.initX);int x1 mRandom.nextInt(mConfig.xRand);x1 mRandom.nextBoolean() ? x1 x : Math.abs(x - x1);int x2 mRandom.nextInt(mConfig.xRand);x2 mRandom.nextBoolean() ? x2 x1 : Math.abs(x1 - x2);x1 x1 (mRandom.nextBoolean() ? 0 : mConfig.xPointFactor);x2 x2 ( mRandom.nextBoolean() ? mConfig.xPointFactor:0);int y mConfig.initY;int y2 mCounter.intValue() * 15 mConfig.animLength * factor mRandom.nextInt(mConfig.animLengthRand);factor y2 / mConfig.bezierFactor;int y3 parent.getHeight();y2 y2/2;Path p new Path();p.moveTo(x,y);//贝塞尔曲线p.cubicTo(x,y ,x1,y2 - factor , x1,y2);p.moveTo(x1,y2);p.cubicTo(x1,y2 factor,x2,y3 - factor,x2,y3);return p;}执行动画 路径长度 PathMeasure.getLength() 与 坐标点 PathMeasure.getPosTan()static class FloatAnimation extends Animation{private PathMeasure mPm; //计算路径距离private View mChildView;private float mDistance;private float mRotation;public FloatAnimation(Path path, float rotation, View parent, View child){//路劲计算mPm new PathMeasure(path,false);//获取漂移路径的长度mDistance mPm.getLength();mChildView child;mRotation rotation;parent.setLayerType(View.LAYER_TYPE_HARDWARE,null);}Overrideprotected void applyTransformation(float interpolatedTime, Transformation t) {// 第一种方式 View动画不可点击// Matrix matrix t.getMatrix();// mPm.getMatrix(mDistance * interpolatedTime,matrix,PathMeasure.POSITION_MATRIX_FLAG);// 第二种方式 属性动画修改View的坐标才能点击float[] pos {0,0};float[] tan {0,0};//通过getPosTan()方法获得当前 mChildView 的坐标mPm.getPosTan(mDistance * interpolatedTime,pos,tan);Log.d(FallingPathAnimation,pos (pos[0] ,pos[1]));//通过改变 mChildView 的x,y坐标才能点击mChildView.setX(pos[0]);mChildView.setY(pos[1]);mChildView.setRotation(mRotation * interpolatedTime);//缩放float scale 1F;if (3000.0F * interpolatedTime 200.0F) {scale scale(interpolatedTime, 0.0D, 0.06666667014360428D, 0.20000000298023224D, 1.100000023841858D);} else if (3000.0F * interpolatedTime 300.0F) {scale scale(interpolatedTime, 0.06666667014360428D, 0.10000000149011612D, 1.100000023841858D, 1.0D);}mChildView.setScaleX(scale);mChildView.setScaleY(scale);//渐变// t.setAlpha(1.0F - interpolatedTime);}}“红包雨”主要就是上面两个步骤很简单上面已经注释的很清楚了。主要还是对 Path 与 PathMeasure 类的 熟悉和使用。源码在这里 : https://github.com/LuoboDcom/ApiDemo欢迎大家留言和展示更多酷炫动画我在这里做个抛砖引玉的作用哈哈
http://www.ihoyoo.com/news/87300.html

相关文章:

  • 合肥企业网站建设公司哪家好有没有做网站
  • phpcms 网站打不开wordpress 导入xml
  • 淄博建网站哪家好做网站的有哪些
  • 广州建设h5网站做网站卖菜刀需要什么手续
  • 织梦网站提示保存目录数据时报用wordpress搭建博客
  • 网站建设在淘宝上以后让还让发布吗电子商务专业有什么用
  • 网站后台制作表格网站开发jquery
  • 德州网站开发人员oa系统运维
  • 深圳网站建设公司推荐免费软件英文
  • 做视频网站的挣钱吗微信小程序开发教程
  • 建外贸网站有效果吗网络工程师培训学校
  • 简述网站建设评估的指标有哪些wordpress 导航制作
  • 建设公司网站怎么弄张家港市建设局网站
  • 桂林出网站库存管理系统软件哪个好
  • 网站首页锚文本wordpress更改固定连接
  • 做网站推广的公司好做吗深圳市龙华区有哪些街道
  • php站点搭建做网站一定需要icp么
  • 懂福溶州做戒网站常熟网站建设都找聚尚网络
  • 库尔勒 网站建设附近装修公司电话和地址
  • 深圳手机商城网站设计电话wordpress无法升级
  • 教育中介公司网站建设费用马鞍山建设局网站
  • 软件定制开发 报价搜索引擎简称seo
  • 2018年做淘宝客网站还能挣钱吗6seo优化技术厂家
  • 高端网站建站公司信息网站 cms
  • 廊坊建手机网站洛阳做网站汉狮网络
  • 建设网站的准备工作分为微信商城分销系统方案
  • 网站接入变更网站建设的实际价值
  • 中国空间站合作的17个国家电脑网络连接正常但是上不了网
  • 北京企业网站定制临沂网站设计制作
  • 乐清网站设计公司哪家好asp网站安全吗