.duration(endTime - startTime) .interpolator(interpolator == null ? DEFAULT_INTERPOLATOR : interpolator) .repeatCount(repeatCount) .repeatMode(repeatMode); if (propertyNameX != null) {
/** * Creates a new animation with original value type <code>T</code> and a new transformed value * type <code>W</code>. * * @param <W> The animation's new transformed value type. * @param transformer The value transformer to use to transform the animation's original type * <code>T</code> to a new transformed value type <code>W</code>. * @return A new animation with the same original value type <code>T</code> and transformed value * type <code>W</code>. */ @NonNull public <W> Animation<T, W> transform(ValueTransformer<T, W> transformer) { return new Animation<>(keyframeSet, transformer) .startDelay(startDelay) .duration(duration) .repeatCount(repeatCount) .repeatMode(repeatMode) .interpolator(interpolator); }
.duration(endTime - startTime) .interpolator(interpolator == null ? DEFAULT_INTERPOLATOR : interpolator) .repeatCount(repeatCount) .repeatMode(repeatMode)); map.put(propertyName, anims);
.duration(endTime - startTime) .interpolator(interpolator == null ? DEFAULT_INTERPOLATOR : interpolator) .repeatCount(repeatCount) .repeatMode(repeatMode)); final Map<String, List<Animation<?, ?>>> map = new ArrayMap<>(1);
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(); }
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(); }