| | |
| | | } |
| | | |
| | | private void startAnimation() { |
| | | anim = ValueAnimator.ofFloat((float) percent, percent2); |
| | | anim = ValueAnimator.ofFloat(percent, percent2); |
| | | anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { |
| | | @Override |
| | | public void onAnimationUpdate(ValueAnimator animation) { |
| | |
| | | anim.setDuration(500L); |
| | | anim.start(); |
| | | } |
| | | // |
| | | // private class CustomPointEvaluator implements TypeEvaluator<Float> { |
| | | // @Override |
| | | // public Float evaluate(float fraction, Float startValue, Float endValue) { |
| | | // System.out.println("chenqi2 rotato " + fraction + " all -> " + endValue); |
| | | // float y = fraction * endValue; |
| | | // return y; |
| | | // } |
| | | // } |
| | | |
| | | |
| | | @Override |
| | |
| | | canvas.save(); |
| | | canvas.rotate(percent * 300 - 150, mWidth / 2, mWidth / 2); |
| | | RectF btmRect = new RectF((float) (cirlcleRect.left + bitH - bitW * 0.535), (float) (cirlcleRect.top + mCircleWidth * 0.68), (float) (cirlcleRect.left + bitH + bitW * 0.465), (float) (cirlcleRect.top + bitH + mCircleWidth * 0.68)); |
| | | // Log.d("haijiang","left="+btmRect.left); |
| | | // Log.d("haijiang","right="+btmRect.right); |
| | | // Log.d("haijiang","top="+btmRect.top); |
| | | // Log.d("haijiang","bottom="+btmRect.bottom); |
| | | // Log.d("haijiang","宽高比例="+(btmRect.right-btmRect.left)/(btmRect.bottom-btmRect.top)); |
| | | canvas.drawBitmap(mBitmap, null, btmRect, mBitPaint); |
| | | canvas.restore(); |
| | | |