-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to create a vector drawable working with this library #1
Comments
All vectors should work fine with the library, even the ones created by android studio (the default vectors). There is no special kind of vectors that are required. |
this is my clock vector I'm using
I want to animate like your lighting animation in sample code starts from a dot and reveal. |
You should probably use another vector for clock. The one you are using cannot be animated in the way you want to. You need 2 separate paths, one for the outer circle, and one for the clock hands. I recommend that you use this vector : https://feathericons.com/icons/core/clock.svg (I highly recommend Feather icons for svgs). Just convert the above svg into vector asset using Android Studio. You will get the following vector file : <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
android:strokeLineCap="round"
android:strokeColor="#000"
android:fillColor="#00000000"
android:strokeWidth="2"
android:strokeLineJoin="round"/>
<path
android:pathData="M12,6l0,6l3,3"
android:strokeLineCap="round"
android:strokeColor="#000"
android:fillColor="#00000000"
android:strokeWidth="2"
android:strokeLineJoin="round"/>
</vector> Now you have different paths for the hands and the outer ring. So to animate the clock hands, just use the trim path animation on the path of the clock hands, as shown in the Readme. You may also want to use RichPath library that makes animations of paths very simple. |
Hi, thanks for this exciting library.
I have a question.
I use simple vectors in the android studio to supply this library but my vectors don't animate as I want.
I think that's beacuse of how vectors define in xml.
for seeing my problem you just need set a one of defalut vectors to VectorMasterView.
so my question is how should I create a vector that works with this great library?
I hope best wishes for you.
The text was updated successfully, but these errors were encountered: