I currently have two vector paths in a VectorDrawable
and I am morphing one to another using AnimatedVectorDrawable
:
First path:
M 1890.8582,2192.6484 L 505.06434,1392.5588 C 169.4833,2023.6601 168.2137,2777.0708 503.79469,3408.1721 L 1891.1961,2607.1555 C 1836.8977,2474.0145 1836.5598,2325.7894 1890.8582,2192.6484 Z
and my second path:
M 2300,200 L 200,200 C 200,1666.6667 200,3133.3333 200,4600 L 2300,4600 C 2300,3133.3333 2300,1666.6667 2300,200 Z
The catch is that the second path is dependent on the size of the screen, so some math has to go into those figures and I have to set them dynamically.
As it stands, it seems there doesn't seem to be a way to do that. So I have decided to use the Path
class and draw it on a Canvas
. The problem is that doesn't seem to be to be a way to morph paths when drawing with Path
.
So my question is, is there some way to morph paths that have been set dynamically?
I have been looking at the accepted answer to this question and if all else fails, I'm going to take their suggestion and move the points of the path as the animation draws frame-by-frame on a Canvas
.
Is there a better way to do this?