@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
rimRadius = Math.min(bounds.width(), bounds.height()) / 2f - rimPaint.getStrokeWidth();
faceRadius = rimRadius - rimPaint.getStrokeWidth();
screwRadius = rimPaint.getStrokeWidth() * 2;
float hourHandLength = (float) (0.5 * faceRadius);
float minuteHandLength = (float) (0.7 * faceRadius);
float top = bounds.centerY() - screwRadius;
hourHandPath.reset();
hourHandPath.moveTo(bounds.centerX(), bounds.centerY());
hourHandPath.addRect(bounds.centerX(), top, bounds.centerX(), top - hourHandLength, Direction.CCW);
hourHandPath.close();
minuteHandPath.reset();
minuteHandPath.moveTo(bounds.centerX(), bounds.centerY());
minuteHandPath.addRect(bounds.centerX(), top, bounds.centerX(), top - minuteHandLength, Direction.CCW);
minuteHandPath.close();
}
ClockDrawable.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:ClockDrawableAnimation
作者:
评论列表
文章目录