Comments (3)
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.
Please attach the vector xml here and elaborate what kind of animation you want, only then will I be able to help you further.
from vectormaster.
this is my clock vector I'm using
<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:name="path0" android:fillColor="#FF000000" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/> </vector>
I want to animate like your lighting animation in sample code starts from a dot and reveal.
but it doesn't.
please try it yourself.
from vectormaster.
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.
from vectormaster.
Related Issues (20)
- API 16 not visible VectorMasterView, VectorMasterDrawable HOT 4
- Strange vector problems when the VectorMasterView size changes HOT 5
- drawable resources versus xml (suggestion) HOT 1
- how i can path name on vector clicked ? HOT 2
- Multiply path scale problem HOT 1
- Set app:vector_src Programmatically HOT 2
- Vector with multiple paths is drawn with only one
- Gradients not supported?
- Exception during setContentView HOT 3
- Black patch appearing in the middle of the vector.
- Utils.getVectorModel HOT 1
- Performance issue
- Resize Vector
- Support for Gradient Fill Colors
- Question: possible to decode VectorDrawable from byte array?
- Support color resources for fillColor, strokeColor
- Is there a way of using VectorMaster with remote views? HOT 1
- migrate to mavencentral HOT 2
- No option to update vector model
- Bug: VectorDrawable not shown correctly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vectormaster.