Android Pathview – Library

Published by Kapil Mohan on

You want to animate svg or normal Paths? Change the color, pathWidth or add svg. Animate the “procentage” property to make the animation.

Simple library for animating SVG Paths.

Github Link:- https://github.com/geftimov/android-pathview

compile 'com.eftimoff:android-pathview:1.0.8@aar'

<com.eftimoff.androipathview.PathView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/pathView"
    android:layout_width="150dp"
    android:layout_height="150dp"
    app:pathColor="@android:color/white"
    app:svg="@raw/settings"
    app:pathWidth="5dp"/>

XML Code

<com.eftimoff.androipathview.PathView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/pathView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:pathColor="@android:color/white"
    app:pathWidth="3dp"/>

Java

final Path path = new Path();
        path.moveTo(0.0f, 0.0f);
        path.lineTo(length / 4f, 0.0f);
        path.lineTo(length, height / 2.0f);
        path.lineTo(length / 4f, height);
        path.lineTo(0.0f, height);
	    path.lineTo(length * 3f / 4f, height / 2f);
	    path.lineTo(0.0f, 0.0f);
	    path.close();
	
pathView.setPath(path);

Library Details:

Credits:-

Contents from official GitHub repo.


Kapil Mohan

Like to add color to developers life and apps. Can create smile using Android, iOS, PHP, codeignitor, web technologies, etc... Feel free to contact me at [email protected] .