예제 #1
0
        public override void apply(Path path, float progress)
        {
            float dx = 0f, dy = 0f;

            AnimatedIconUtils._interpolateOffset(points, progress, ref dx, ref dy);
            path.lineTo(dx, dy);
        }
        public override void apply(Path path, float progress)
        {
            Offset controlPoint1 = AnimatedIconUtils._interpolate <Offset>(this.controlPoints1, progress, Offset.lerp);
            Offset controlPoint2 = AnimatedIconUtils._interpolate <Offset>(this.controlPoints2, progress, Offset.lerp);
            Offset targetPoint   = AnimatedIconUtils._interpolate <Offset>(this.targetPoints, progress, Offset.lerp);

            path.cubicTo(
                controlPoint1.dx, controlPoint1.dy,
                controlPoint2.dx, controlPoint2.dy,
                targetPoint.dx, targetPoint.dy
                );
        }
예제 #3
0
        public override void apply(Path path, float progress)
        {
            float dx1 = 0f, dy1 = 0f, dx2 = 0f, dy2 = 0f, dx = 0f, dy = 0f;

            AnimatedIconUtils._interpolateOffset(controlPoints1, progress, ref dx1, ref dy1);
            AnimatedIconUtils._interpolateOffset(controlPoints2, progress, ref dx2, ref dy2);
            AnimatedIconUtils._interpolateOffset(targetPoints, progress, ref dx, ref dy);
            path.cubicTo(
                dx1, dy1,
                dx2, dy2,
                dx, dy
                );
        }
예제 #4
0
        public void paint(Canvas canvas, Color color, _UiPathFactory uiPathFactory, float progress)
        {
            float opacity = AnimatedIconUtils._interpolate(opacities, progress);
            Paint paint   = new Paint();

            paint.style = PaintingStyle.fill;
            paint.color = color.withOpacity(color.opacity * opacity);
            Path path = uiPathFactory();

            foreach (_PathCommand command in commands)
            {
                command.apply(path, progress);
            }

            canvas.drawPath(path, paint);
        }
        public override void apply(Path path, float progress)
        {
            Offset point = AnimatedIconUtils._interpolate <Offset>(this.points, progress, Offset.lerp);

            path.lineTo(point.dx, point.dy);
        }