Giter Site home page Giter Site logo

Comments (3)

harjot-oberai avatar harjot-oberai commented on May 22, 2024

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.

mohamadk avatar mohamadk commented on May 22, 2024

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.

harjot-oberai avatar harjot-oberai commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.