inflateGroup(groupBuilder, context, parser, attrs, targetMap); if (groupBuilderStack.isEmpty()) { builder.child(groupBuilder); } else { groupBuilderStack.peek().child(groupBuilder); inflatePath(pathBuilder, context, parser, attrs, targetMap); if (groupBuilderStack.isEmpty()) { builder.child(pathBuilder); } else { groupBuilderStack.peek().child(pathBuilder); inflateClipPath(clipPathBuilder, context, parser, attrs, targetMap); if (groupBuilderStack.isEmpty()) { builder.child(clipPathBuilder); } else { groupBuilderStack.peek().child(clipPathBuilder);
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(); }
KyrieDrawable.builder() .viewport(409, 280) .child( PathNode.builder() .strokeColor(Color.BLACK)
private KyrieDrawable createVortexDrawable() { final KyrieDrawable.Builder builder = KyrieDrawable.builder().viewport(VIEWPORT_WIDTH, VIEWPORT_HEIGHT); for (Polygon polygon : polygons) { final float length = polygon.length; final float totalLength = length * polygon.laps; builder.child( PathNode.builder() .pathData(PathData.parse(polygon.pathData)) .strokeWidth(4f) .strokeColor(polygon.color) .strokeDashArray( Animation.ofFloatArray(new float[] {0, length}, new float[] {length, 0}) .repeatCount(Animation.INFINITE) .duration(DURATION)) .strokeDashOffset( Animation.ofFloat(0f, 2 * totalLength) .repeatCount(Animation.INFINITE) .duration(DURATION))); } return builder.build(); }
public final Builder child(Node.Builder builder) { return child(builder.build()); }