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

网站清理通知哈尔滨seo推广

网站清理通知,哈尔滨seo推广,wordpress盒子,网站的外部链接建设图片最终效果如下 ValueAnimator类API 简介 ofFloat(float… values) 构建ValueAnimator#xff0c;设置动画的浮点值#xff0c;需要设置2个以上的值setDuration(long duration) 设置动画时长#xff0c;默认的持续时间为300毫秒。setInterpolator(TimeInterpolator value) 设…最终效果如下 ValueAnimator类API 简介 ofFloat(float… values) 构建ValueAnimator设置动画的浮点值需要设置2个以上的值setDuration(long duration) 设置动画时长默认的持续时间为300毫秒。setInterpolator(TimeInterpolator value) 设置动画的线性非线性运动默认AccelerateDecelerateInterpolatoraddUpdateListener(ValueAnimator.AnimatorUpdateListener listener) 监听动画属性每一帧的变化 分解步骤计算一下总共需要的角度: 1、一个笑脸x轴下方的圆弧旋转135°覆盖2个点此过程中圆弧增加45° 2、画布旋转135°此过程中圆弧增加45° 3、画布旋转360°此过程中圆弧减少360/5度 4、画布旋转90°此过程中圆弧减少90/5度 5、画布旋转135°释放覆盖的2个点 实现 package com.zj.test;import android.animation.TimeInterpolator; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RectF; import android.util.AttributeSet; import android.view.View; import android.view.animation.DecelerateInterpolator;/*** Created by jjx on 2016/5/28.*/ public class customView extends View{// public customView(Context context, AttributeSet attrs, int defStyleAttr) { // super(context, attrs, defStyleAttr); // // initAnimator(animatorDuration); // mPaintnew Paint(); // mPaint.setStyle(Paint.Style.STROKE);//设置画笔样式为描边如果已经设置可以忽略 // mPaint.setColor(Color.GREEN); // mPaint.setStrokeWidth(10); // }float Width;float Height;public customView(Context context, AttributeSet attrs) {super(context, attrs);initAnimator(animatorDuration);mPaintnew Paint();mPaint.setStyle(Paint.Style.STROKE);//设置画笔样式为描边如果已经设置可以忽略mPaint.setColor(Color.GREEN);mPaint.setStrokeWidth(10);}Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {super.onMeasure(widthMeasureSpec, heightMeasureSpec);WidthMeasureSpec.getSize(widthMeasureSpec);mViewWidthWidth;HeightMeasureSpec.getSize(heightMeasureSpec);}Paint mPaint;float mViewWidth;Overrideprotected void onDraw(Canvas canvas) {super.onDraw(canvas);canvas.translate(Width/2,Height/2);doubanAnimator(canvas, mPaint);}private ValueAnimator animator;private float animatedValue;private long animatorDuration 5000;private TimeInterpolator timeInterpolator new DecelerateInterpolator();private void initAnimator(long duration){if (animator !null animator.isRunning()){animator.cancel();animator.start();}else {animatorValueAnimator.ofFloat(0,855).setDuration(duration);animator.setInterpolator(timeInterpolator);animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {Overridepublic void onAnimationUpdate(ValueAnimator animation) {animatedValue (float) animation.getAnimatedValue();invalidate();}});animator.start();}}private void doubanAnimator(Canvas canvas, Paint mPaint){mPaint.setStyle(Paint.Style.STROKE);//描边mPaint.setStrokeCap(Paint.Cap.ROUND);//圆角笔触mPaint.setColor(Color.rgb(97, 195, 109));mPaint.setStrokeWidth(15);float point Math.min(mViewWidth,mViewWidth)*0.06f/2;float r point*(float) Math.sqrt(2);RectF rectF new RectF(-r,-r,r,r);canvas.save();// rotateif (animatedValue135){canvas.rotate(animatedValue-135);}// draw mouthfloat startAngle0, sweepAngle0;if (animatedValue135){startAngle animatedValue 5;sweepAngle 170animatedValue/3;}else if (animatedValue270){startAngle 1355;sweepAngle 170animatedValue/3;}else if (animatedValue630){startAngle 1355;sweepAngle 260-(animatedValue-270)/5;}else if (animatedValue720){startAngle 135-(animatedValue-630)/25;sweepAngle 260-(animatedValue-270)/5;}else{startAngle 135-(animatedValue-630)/2-(animatedValue-720)/65;sweepAngle 170;}canvas.drawArc(rectF,startAngle,sweepAngle,false,mPaint);// draw eyecanvas.drawPoints(new float[]{-point,-point,point,-point},mPaint);canvas.restore();}} 布局文件 ?xml version1.0 encodingutf-8? RelativeLayout xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:toolshttp://schemas.android.com/toolsandroid:layout_widthmatch_parentandroid:layout_heightmatch_parenttools:contextcom.zj.test.MainActivitycom.zj.test.customViewandroid:layout_widthmatch_parentandroid:layout_heightmatch_parent/com.zj.test.customView /RelativeLayout 参考链接 自定义View——Canvas与ValueAnimator – Idtk
http://www.yutouwan.com/news/491766/

相关文章:

  • 外贸社交网站排名施工员证书查询网站
  • 网站建设与管理说课稿如何做vip视频网站
  • 东莞微信网站建设怎样宁德市公共资源交易中心
  • 做网站的步骤现在找个网站这么难的吗
  • 网站编程语言有哪些怎么修改wordpress绑定的域名
  • 电子商务网站建设培训小结长期做网站应该购买稳定的空间
  • 曲靖网站设计公司互联网营销师报名入口
  • 班级网站建设的内容大连学网站制作
  • 专业集团门户网站建设服务商织梦网站模板响应式
  • 网站备案 写共享可以吗建设网站赚的是什么钱
  • 常州公司建站模板有没有推广app的平台
  • 网站访问工具网站建设合同书下载
  • 石家庄市建设局质监站网站做网站导航cms
  • 景区门户网站建设大数据分析假发外贸网站模板
  • 如何给网站添加cnzz站长统计功能代码的常用办法百度招商加盟推广
  • 扬中市建设局网站wordpress萌主题
  • 赣州网站建设新闻一键wordpress 伪静态
  • 商用营销型网站建设优化建站百度搜索引擎优化的推广计划
  • 做网站怎么切片自助建站的软件
  • 河南省鹤壁市住房和城乡建设局网站北京网站建设认
  • 自己做网站帮公司出认证证书违法吗网站建设网站需要什么
  • 泰州北京网站建设好品质高端网站设计新感觉建站
  • 哪些网站可以做画赚钱焦作做网站
  • 英国购物网站排名房地产市场最新动态
  • 网站平台建设什么意思器材管理网站开发
  • 西安网站建设 中讯创赢青岛网站建设铭盛信息
  • 在哪个网站里下载的图片可以做展架外贸平台是做什么的
  • 衡阳做网站程序员给别人做的网站违法
  • 网站开发员的工资营销推广方案
  • 国内最好的旅游网站网站设计公司有哪些