├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── martin │ │ └── pathdraw │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── martin │ │ │ └── pathdraw │ │ │ ├── AfterFillAct.java │ │ │ ├── FillAct.java │ │ │ ├── MainActivity.java │ │ │ └── NormalAct.java │ └── res │ │ ├── drawable │ │ └── nancy.png │ │ ├── layout │ │ ├── activity_after_fill.xml │ │ ├── activity_fill.xml │ │ ├── activity_main.xml │ │ └── activity_normal.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── raw │ │ ├── ironman.svg │ │ ├── monitor.svg │ │ ├── nancy.svg │ │ ├── nancypath1.svg │ │ ├── nancypath2.svg │ │ ├── nancypath3.svg │ │ ├── woman1.svg │ │ └── woman2.svg │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── martin │ └── pathdraw │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pdmaster ├── .gitignore ├── build.gradle ├── libs │ └── androidsvg-1.2.1.jar ├── pathview.md ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── martin │ │ └── pdmaster │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── martin │ │ │ └── pdmaster │ │ │ ├── PathDrawingView.java │ │ │ └── PathUtils.java │ └── res │ │ ├── drawable │ │ └── mypaint.png │ │ └── values │ │ ├── strings.xml │ │ └── sttr.xml │ └── test │ └── java │ └── com │ └── martin │ └── pdmaster │ └── ExampleUnitTest.java ├── resources ├── afterfill.gif ├── ironman.gif ├── nancy.gif └── woman.gif └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | PathDraw -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 25 | 26 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PathDraw 2 | It`s a android animation that drawing with svg . 3 | 4 | **Thanks [https://github.com/geftimov/android-pathview](https://github.com/geftimov/android-pathview)** 5 | 6 | this library is base on [android-pathview](https://github.com/geftimov/android-pathview) 7 | 8 | I removed the parallel animation and modified the fill animation .it will be like that: 9 | 10 | ![woman](https://github.com/MartinBZDQSM/PathDraw/blob/master/resources/woman.gif) 11 | 12 | ## **sttr:** 13 | ``` 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ``` 22 | ## **Three modes** 23 | 24 | ### 1.NORMAL 25 | 26 | ![ironman](https://github.com/MartinBZDQSM/PathDraw/blob/master/resources/ironman.gif) 27 | 28 | add the code in your xml: 29 | ``` 30 | 36 | ``` 37 | ### 2.FILL 38 | 39 | ![nancy](https://github.com/MartinBZDQSM/PathDraw/blob/master/resources/nancy.gif) 40 | 41 | add the code in your xml: 42 | ``` 43 | 52 | ``` 53 | ### 3.AFTER FILL 54 | 55 | ![afterfill](https://github.com/MartinBZDQSM/PathDraw/blob/master/resources/afterfill.gif) 56 | 57 | add the code in your xml: 58 | ``` 59 | 67 | ``` 68 | 69 | ## There is only sequential animation in this library 70 | ``` 71 | pathDrawingView.getSequentialPathAnimator().delay(200).duration(5000).start(); 72 | ``` 73 | 74 | ## **ADD THE LIBRARY ** 75 | 76 | Add it in your root build.gradle at the end of repositories: 77 | 78 | allprojects { 79 | repositories { 80 | ... 81 | maven { url "https://jitpack.io" } 82 | } 83 | } 84 | Step 2. Add the dependency 85 | 86 | dependencies { 87 | compile 'com.github.MartinBZDQSM:PathDraw:1.1' 88 | } 89 | 90 | ##[BLOG](http://www.jianshu.com/p/75a83ad1ab7e) 91 | 92 | ##**License** 93 | 94 | ```license 95 | Copyright [2016] [MartinBZDQSM of copyright owner] 96 | 97 | Licensed under the Apache License, Version 2.0 (the "License"); 98 | you may not use this file except in compliance with the License. 99 | You may obtain a copy of the License at 100 | 101 | http://www.apache.org/licenses/LICENSE-2.0 102 | 103 | Unless required by applicable law or agreed to in writing, software 104 | distributed under the License is distributed on an "AS IS" BASIS, 105 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 106 | See the License for the specific language governing permissions and 107 | limitations under the License. 108 | ``` 109 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "24.0.0" 6 | 7 | defaultConfig { 8 | applicationId "com.martin.pathdraw" 9 | minSdkVersion 15 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.4.0' 26 | compile project(':pdmaster') 27 | } 28 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/martin/pathdraw/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.martin.pathdraw; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/martin/pathdraw/AfterFillAct.java: -------------------------------------------------------------------------------- 1 | package com.martin.pathdraw; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | 7 | import com.martin.pdmaster.PathDrawingView; 8 | 9 | public class AfterFillAct extends AppCompatActivity { 10 | private PathDrawingView pathDrawingView; 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_after_fill); 16 | pathDrawingView = (PathDrawingView) findViewById(R.id.pathdrawing); 17 | pathDrawingView.setOnClickListener(new View.OnClickListener() { 18 | @Override 19 | public void onClick(View v) { 20 | pathDrawingView.getSequentialPathAnimator().delay(200).duration(5000).start(); 21 | } 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/martin/pathdraw/FillAct.java: -------------------------------------------------------------------------------- 1 | package com.martin.pathdraw; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | 7 | import com.martin.pdmaster.PathDrawingView; 8 | 9 | public class FillAct extends AppCompatActivity { 10 | private PathDrawingView pathDrawingView; 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.activity_fill); 15 | pathDrawingView = (PathDrawingView) findViewById(R.id.pathdrawing); 16 | pathDrawingView.setOnClickListener(new View.OnClickListener() { 17 | @Override 18 | public void onClick(View v) { 19 | pathDrawingView.getSequentialPathAnimator().delay(200).duration(10000).start(); 20 | } 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/martin/pathdraw/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.martin.pathdraw; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | 8 | public class MainActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_main); 14 | findViewById(R.id.button).setOnClickListener(onClickListener); 15 | findViewById(R.id.button2).setOnClickListener(onClickListener); 16 | findViewById(R.id.button3).setOnClickListener(onClickListener); 17 | } 18 | 19 | 20 | View.OnClickListener onClickListener = new View.OnClickListener() { 21 | @Override 22 | public void onClick(View v) { 23 | Intent intent = null; 24 | switch (v.getId()) { 25 | case R.id.button: 26 | intent = new Intent(MainActivity.this, NormalAct.class); 27 | break; 28 | case R.id.button2: 29 | intent = new Intent(MainActivity.this, FillAct.class); 30 | break; 31 | case R.id.button3: 32 | intent = new Intent(MainActivity.this, AfterFillAct.class); 33 | break; 34 | } 35 | if (intent != null) 36 | MainActivity.this.startActivity(intent); 37 | } 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/martin/pathdraw/NormalAct.java: -------------------------------------------------------------------------------- 1 | package com.martin.pathdraw; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | 7 | import com.martin.pdmaster.PathDrawingView; 8 | 9 | public class NormalAct extends AppCompatActivity { 10 | private PathDrawingView pathDrawingView; 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_normal); 16 | pathDrawingView = (PathDrawingView) findViewById(R.id.pathdrawing); 17 | pathDrawingView.setOnClickListener(new View.OnClickListener() { 18 | @Override 19 | public void onClick(View v) { 20 | pathDrawingView.getSequentialPathAnimator().delay(200).duration(5000).start(); 21 | } 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/nancy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartinHY/PathDraw/bbc3e3d1ab05982aa6d3c8d9532fe624543c4563/app/src/main/res/drawable/nancy.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_after_fill.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_fill.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 |