@NonNull public CircleNode build() { return new CircleNode( rotation, pivotX, pivotY, scaleX, scaleY, translateX, translateY, fillColor, fillAlpha, strokeColor, strokeAlpha, strokeWidth, trimPathStart, trimPathEnd, trimPathOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, strokeDashArray, strokeDashOffset, fillType, isScalingStroke, centerX, centerY, radius); } }
public CircleLayer(PropertyTimeline timeline, CircleNode node) { super(timeline, node); centerX = registerAnimatableProperty(node.getCenterX()); centerY = registerAnimatableProperty(node.getCenterY()); radius = registerAnimatableProperty(node.getRadius()); }
private KyrieDrawable createLapsDrawable() { final KyrieDrawable.Builder builder = KyrieDrawable.builder().viewport(VIEWPORT_WIDTH, VIEWPORT_HEIGHT); for (Polygon polygon : polygons) { builder.child( PathNode.builder() .pathData(PathData.parse(polygon.pathData)) .strokeWidth(4f) .strokeColor(polygon.color)); } for (Polygon polygon : polygons) { final PathData pathData = PathData.parse(TextUtils.join(" ", Collections.nCopies(polygon.laps, polygon.pathData))); final Animation<PointF, PointF> pathMotion = Animation.ofPathMotion(PathData.toPath(pathData)) .repeatCount(Animation.INFINITE) .duration(DURATION); builder.child( CircleNode.builder() .fillColor(Color.BLACK) .radius(8) .centerX(pathMotion.transform(p -> p.x)) .centerY(pathMotion.transform(p -> p.y))); } return builder.build(); }