💪 Rich Android Path. 🤡 Draw as you want. 🎉 Animate much as you can.

Overview

CircleCI Release API Twitter URL

💪 Rich Android Path. 🤡 Draw as you want. 🎉 Animate much as you can.

Download sample app:

Features

  • Full Animation Control on Paths and VectorDrawables: Animate any attribute in a specific path in the VectorDrawable

fillColor, strokeColor, strokeAlpha, fillAlpha, size, width, height, scale, scaleX, scaleY, rotation, translationX, translationY, trimPathStart, trimPathEnd, trimPathOffset.

  • Path morphing:

RichPathAnimator.animate(richPath)
       .pathData(pathData1, pathData2, ...)
       .start();

Just 3 Steps to Animate any path.

1. In your layout.

    <com.richpath.RichPathView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:vector="@drawable/vector_drawable" />

2. Find your richPath.

// by path name
RichPath richPath = richPathView.findRichPathByName("path_name");
// or if it contains one path
RichPath richPath = richPathView.findFirstRichPath();
// or by index
RichPath richPath = richPathView.findRichPathByIndex(0);

3. Use the RichPathAnimator to animate your richPath.

RichPathAnimator.animate(richPath)
       .trimPathEnd(value1, value2, ...)
       .fillColor(value1, value2, ...)
       .start();

Example

notification icon vector drawable

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="32dp"
    android:height="32dp"
    android:viewportHeight="32.0"
    android:viewportWidth="32.0">

    <group
        android:pivotX="16"
        android:pivotY="6.25">
        <path
            android:name="top"
            android:fillColor="#FFF7F7F7"
            android:pathData="M22,19.8v-5c0-3.1-1.6-5.6-4.5-6.3V7.8c0-0.8-0.7-1.5-1.5-1.5s-1.5,0.7-1.5,1.5v0.7c-2.9,0.7-4.5,3.2-4.5,6.3v5l-2,2v1h16v-1L22,19.8z" />

        <path
            android:name="bottom"
            android:fillColor="#FFF7F7F7"
            android:pathData="M16,25.8c1.1,0,2-0.9,2-2h-4C14,24.9,14.9,25.8,16,25.8z" />
    </group>
</vector>

XML

    <com.richpath.RichPathView
        android:id="@+id/ic_notifications"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:vector="@drawable/ic_notifications" />

Java

RichPath top = notificationsRichPathView.findRichPathByName("top");
RichPath bottom = notificationsRichPathView.findRichPathByName("bottom");

RichPathAnimator.animate(top)
        .interpolator(new DecelerateInterpolator())
        .rotation(0, 20, -20, 10, -10, 5, -5, 2, -2, 0)
        .duration(4000)
        .andAnimate(bottom)
        .interpolator(new DecelerateInterpolator())
        .rotation(0, 10, -10, 5, -5, 2, -2, 0)
        .startDelay(50)
        .duration(4000)
        .start();

Installation

Add the following dependency to your module build.gradle file:

dependencies {
	...
	implementation 'com.github.tarek360.RichPath:animator:0.1.1'
}

Add this to your root build.gradle file (not your module build.gradle file) :

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

More Control by the RichPathAnimator

  • Animate multiple paths sequentially or at the same time
RichPathAnimator
       .animate(richPath1, richPath2)
       .rotation(value1, value2, ...)

       //Animate the same path or another with different animated attributes.
       .andAnimate(richPath3)
       .scale(value1, value2, ...)

       //Animate after the end of the last animation.
       .thenAnimate(richPath4)
       .strokeColor(value1, value2, ...)

       // start your animation 🎉
       .start();
  • Which one of the paths is clicked?
richPathView.setOnPathClickListener(new RichPath.OnPathClickListener() {
    @Override
    public void onClick(RichPath richPath) {
       if (richPath.getName().equals("path_name")) {
           //TODO do an action when a specific path is clicked.
       }
    }
});

TODO

  • Clickable path (Done)
  • Support clip-path
  • Path animation (animate a RichPath on a path)
  • Reverse animation
  • ...

If you have any suggestion please open an issue for it.

Credits

  • florent37 He is the creator of ViewAnimator which gave me the idea of this project. Some core concepts and ideas were reused, but everything is written from scratch.
  • Android Some code is reused form the android source code and the VectorDrawableCompat support library.
  • Alex Lockwood The paths of the morphing sample is extracted from the Shape Shifter demo.

Developed By

License

Copyright 2017 Tarek360

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Comments
  • Load Original SVG

    Load Original SVG

    Hello, Can we load original svg in richpath view? I have put svg in Raw folder and without convert it into vector drawable file want to load in richpath. is this possible? Looking forward to hearing from you. Thanks

    opened by tulaParekh 10
  • Add other options to find RichPaths in RichPathView

    Add other options to find RichPaths in RichPathView

    Add other ways to find RichPaths :

    • findFirstRichPath() This can be useful if the vector has one path, so no need for searching by name and creating iterator for this.
    • findRichPathByIndex(int index) This can be useful to find the paths in O(1) instead of O(n), This could be messy if the vector has many paths with complex structure, but it could be useful in cases like hamburger icon where the paths can be recognized easily by the index, This method returns null if the index out of bounds instead of throwing exception to match the existent findRichPathByName behavior.

    I also updated couple of examples in the sample app to use them, and updated the code snippet in the readme file to include them.

    opened by AmrElmasry 8
  • [feature/kotlin] Kotlin code in animator module

    [feature/kotlin] Kotlin code in animator module

    Hi, @tarek360 :) As you see in this PR, I added kotlin source set in animator module. I think we can remove java source set after we discuss about changes.

    1. RepeatMode I changed RepeatMode type to sealed class.

    2. @JvmStatic fun animate I think animator module can be called from Java. And, I tested in app module MainActivity.

    3. apply I used many apply inline function in AnimationBuilder class. So, I want to change more like :

    RichPathAnimator.create { paths = allPaths; duration = 800; .... }

    I need your advice. Thanks!

    opened by step4me 7
  • some path do not show  sometime?

    some path do not show sometime?

    <path android:pathData="m81 508 910 -24 6 254 -914 28 -2 -258z" android:strokeColor="#000" android:strokeLineCap="round" android:strokeLineJoin="round" android:strokeWidth="6" />

    opened by WNervous 6
  • Path Morphing - ArrayIndexOutOfBoundsException

    Path Morphing - ArrayIndexOutOfBoundsException

    I am trying to accomplish a path morphing animation. My code is below (written in Kotlin).

    Animation call:

    val waves = holder.settingVibrationOptionRichPath!!.findFirstRichPath()
    val up = context.getString(R.string.icon_vibration_up)
    val down = context.getString(R.string.icon_vibration_down)
    
     RichPathAnimator
         .animate(waves)
         .pathData(down)
         .duration(600)
         .thenAnimate(waves)
         .pathData(up)
         .duration(600)
         .start()
    

    RichPathView assigned vector:

    <vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="40dp"
        android:height="40dp"
        android:viewportWidth="40"
        android:viewportHeight="40">
           <path
                 android:pathData="@string/icon_vibration_up"
                 android:fillColor="#ffffff"/>
    </vector>
    

    String resources:

    <string name="icon_vibration_up">M28.3333,28.3167C26.0833,28.3167 24.6667,29.0167 23.4167,29.65C22.3333,30.2 21.45,30.65 20,30.65C18.5,30.65 17.6667,30.2333 16.5833,29.65C15.3333,29.0167 13.9667,28.3167 11.6667,28.3167C9.3667,28.3167 8,29.0167 6.75,29.65C5.6667,30.2 4.8,30.65 3.3333,30.65L3.3333,33.9C5.5833,33.9 7,33.2 8.25,32.5667C9.3333,32.0167 10.2,31.5667 11.6667,31.5667C13.1333,31.5667 14,31.9833 15.0833,32.5667C16.3333,33.2 17.7,33.9 20,33.9C22.3,33.9 23.6667,33.2 24.9167,32.5667C26,32.0167 26.8833,31.5667 28.3333,31.5667C29.8333,31.5667 30.6667,31.9833 31.75,32.5667C33,33.2 34.3833,33.9 36.6667,33.9V30.65C35.1667,30.65 34.3333,30.2333 33.25,29.65C32,29.0167 30.5833,28.3167 28.3333,28.3167ZM28.3333,20.9C26.0833,20.9 24.6667,21.6167 23.4167,22.2333C22.3333,22.7667 21.45,23.2333 20,23.2333C18.5,23.2333 17.6667,22.8167 16.5833,22.2333C15.3333,21.6 13.9667,20.9 11.6667,20.9C9.3667,20.9 8,21.6167 6.75,22.2333C5.6667,22.7667 4.8,23.2333 3.3333,23.2333L3.3333,26.4833C5.5833,26.4833 7,25.7667 8.25,25.15C9.3333,24.5667 10.1667,24.15 11.6667,24.15C13.1667,24.15 14,24.5667 15.0833,25.15C16.3333,25.7833 17.7,26.4833 20,26.4833C22.3,26.4833 23.6667,25.7667 24.9167,25.15C26,24.5667 26.8333,24.15 28.3333,24.15C29.8333,24.15 30.6667,24.5667 31.75,25.15C33,25.7833 34.3833,26.4833 36.6667,26.4833V23.2333C35.1667,23.2333 34.3333,22.8167 33.25,22.2333C32,21.6 30.5833,20.9 28.3333,20.9ZM33.25,7.4333C32,6.8 30.6167,6.1 28.3333,6.1C26.05,6.1 24.6667,6.8 23.4167,7.4333C22.3333,7.9667 21.45,8.4333 20,8.4333C18.5,8.4333 17.6667,8.0167 16.5833,7.4333C15.3333,6.8167 13.9667,6.1 11.6667,6.1C9.3667,6.1 8,6.8 6.75,7.4333C5.6667,7.9833 4.8,8.4333 3.3333,8.4333L3.3333,11.65C5.5833,11.65 7,10.9333 8.25,10.3167C9.3333,9.7667 10.2,9.3167 11.6667,9.3167C13.1333,9.3167 14,9.7333 15.0833,10.3167C16.3333,10.95 17.7,11.65 20,11.65C22.3,11.65 23.6667,10.9333 24.9167,10.3167C26,9.7833 26.8833,9.3167 28.3333,9.3167C29.8333,9.3167 30.6667,9.7333 31.75,10.3167C33,10.95 34.3833,11.65 36.6667,11.65V8.4C35.1667,8.4 34.3333,7.9833 33.25,7.4333V7.4333ZM28.3333,13.4833C26.0833,13.4833 24.6667,14.2 23.4167,14.8167C22.3333,15.4 21.5,15.8167 20,15.8167C18.5,15.8167 17.6667,15.4 16.5833,14.8167C15.3333,14.1833 13.9667,13.4833 11.6667,13.4833C9.3667,13.4833 8,14.2 6.75,14.8167C5.6667,15.4 4.8333,15.8167 3.3333,15.8167L3.3333,19.0667C5.5833,19.0667 7,18.35 8.25,17.7333C9.3333,17.2 10.2167,16.7333 11.6667,16.7333C13.1167,16.7333 14,17.15 15.0833,17.7333C16.3333,18.3667 17.7,19.0667 20,19.0667C22.3,19.0667 23.6667,18.35 24.9167,17.7333C26,17.2 26.8833,16.7333 28.3333,16.7333C29.8333,16.7333 30.6667,17.15 31.75,17.7333C33,18.3667 34.3833,19.0667 36.6667,19.0667V15.8167C35.1667,15.8167 34.3333,15.4 33.25,14.8167C32,14.1833 30.5833,13.4833 28.3333,13.4833Z</string>
    
    <string name="icon_vibration_down">M11.6667,11.6833C13.9167,11.6833 15.3333,10.9833 16.5833,10.35C17.6667,9.8 18.55,9.35 20,9.35C21.5,9.35 22.3333,9.7667 23.4167,10.35C24.6667,10.9833 26.0333,11.6833 28.3333,11.6833C30.6333,11.6833 32,10.9833 33.25,10.35C34.3333,9.8 35.2,9.35 36.6667,9.35V6.1C34.4167,6.1 33,6.8 31.75,7.4333C30.6667,7.9833 29.8,8.4333 28.3333,8.4333C26.8667,8.4333 26,8.0167 24.9167,7.4333C23.6667,6.8 22.3,6.1 20,6.1C17.7,6.1 16.3333,6.8 15.0833,7.4333C14,7.9833 13.1167,8.4333 11.6667,8.4333C10.1667,8.4333 9.3333,8.0167 8.25,7.4333C7,6.8 5.6167,6.1 3.3333,6.1V9.35C4.8333,9.35 5.6667,9.7667 6.75,10.35C8,10.9833 9.4167,11.6833 11.6667,11.6833ZM11.6667,19.1C13.9167,19.1 15.3333,18.3833 16.5833,17.7667C17.6667,17.2333 18.55,16.7667 20,16.7667C21.5,16.7667 22.3333,17.1833 23.4167,17.7667C24.6667,18.4 26.0333,19.1 28.3333,19.1C30.6333,19.1 32,18.3833 33.25,17.7667C34.3333,17.2333 35.2,16.7667 36.6667,16.7667V13.5167C34.4167,13.5167 33,14.2333 31.75,14.85C30.6667,15.4333 29.8333,15.85 28.3333,15.85C26.8333,15.85 26,15.4333 24.9167,14.85C23.6667,14.2167 22.3,13.5167 20,13.5167C17.7,13.5167 16.3333,14.2333 15.0833,14.85C14,15.4333 13.1667,15.85 11.6667,15.85C10.1667,15.85 9.3333,15.4333 8.25,14.85C7,14.2167 5.6167,13.5167 3.3333,13.5167V16.7667C4.8333,16.7667 5.6667,17.1833 6.75,17.7667C8,18.4 9.4167,19.1 11.6667,19.1ZM6.75,32.5667C8,33.2 9.3833,33.9 11.6667,33.9C13.95,33.9 15.3333,33.2 16.5833,32.5667C17.6667,32.0333 18.55,31.5667 20,31.5667C21.5,31.5667 22.3333,31.9833 23.4167,32.5667C24.6667,33.1833 26.0333,33.9 28.3333,33.9C30.6333,33.9 32,33.2 33.25,32.5667C34.3333,32.0167 35.2,31.5667 36.6667,31.5667V28.35C34.4167,28.35 33,29.0667 31.75,29.6833C30.6667,30.2333 29.8,30.6833 28.3333,30.6833C26.8667,30.6833 26,30.2667 24.9167,29.6833C23.6667,29.05 22.3,28.35 20,28.35C17.7,28.35 16.3333,29.0667 15.0833,29.6833C14,30.2167 13.1167,30.6833 11.6667,30.6833C10.1667,30.6833 9.3333,30.2667 8.25,29.6833C7,29.05 5.6167,28.35 3.3333,28.35V31.6C4.8333,31.6 5.6667,32.0167 6.75,32.5667V32.5667ZM11.6667,26.5167C13.9167,26.5167 15.3333,25.8 16.5833,25.1833C17.6667,24.6 18.5,24.1833 20,24.1833C21.5,24.1833 22.3333,24.6 23.4167,25.1833C24.6667,25.8167 26.0333,26.5167 28.3333,26.5167C30.6333,26.5167 32,25.8 33.25,25.1833C34.3333,24.6 35.1667,24.1833 36.6667,24.1833V20.9333C34.4167,20.9333 33,21.65 31.75,22.2667C30.6667,22.8 29.7833,23.2667 28.3333,23.2667C26.8833,23.2667 26,22.85 24.9167,22.2667C23.6667,21.6333 22.3,20.9333 20,20.9333C17.7,20.9333 16.3333,21.65 15.0833,22.2667C14,22.8 13.1167,23.2667 11.6667,23.2667C10.1667,23.2667 9.3333,22.85 8.25,22.2667C7,21.6333 5.6167,20.9333 3.3333,20.9333V24.1833C4.8333,24.1833 5.6667,24.6 6.75,25.1833C8,25.8167 9.4167,26.5167 11.6667,26.5167Z</string>
    

    Resulting exception:

    java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
            at com.richpathanimator.PathEvaluator.evaluate(PathEvaluator.java:26)
            at com.richpathanimator.PathEvaluator.evaluate(PathEvaluator.java:12)
            at android.animation.KeyframeSet.getValue(KeyframeSet.java:202)
            at android.animation.PropertyValuesHolder.calculateValue(PropertyValuesHolder.java:1017)
            at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1542)
            at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:987)
            at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
            at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
            at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
            at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
            at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
            at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081)
            at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
            at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227)
            at android.animation.AnimatorSet.start(AnimatorSet.java:729)
            at android.animation.AnimatorSet.start(AnimatorSet.java:684)
            at com.richpathanimator.RichPathAnimator.start(RichPathAnimator.java:142)
            at com.richpathanimator.RichPathAnimator.start(RichPathAnimator.java:138)
            at com.richpathanimator.AnimationBuilder.start(AnimationBuilder.java:88)
    

    I would greatly appreciate it if someone could help me. I have tried using the code in the vector paths in the animals example in the sample application, but I can't figure out the difference that is causing this exception.

    One difference I have noticed is the size of the vector paths are different sizes. The vector paths in the animals example are ~9000 character whereas the paths I am using are ~4000 characters.

    Thank you, -Seth

    opened by sethepeterson 4
  • java.lang.IllegalArgumentException: Unknown color

    java.lang.IllegalArgumentException: Unknown color

    Hi when i used this in vector

    problem is in fillColor value. I have error

    Caused by: java.lang.IllegalArgumentException: Unknown color at android.graphics.Color.parseColor(Color.java:154) at com.richpath.util.XmlParser.getAttributeColor(XmlParser.java:134) at com.richpath.RichPath.inflate(RichPath.java:413) at com.richpath.util.XmlParser.parsePathElement(XmlParser.java:89) at com.richpath.util.XmlParser.parseVector(XmlParser.java:56) at com.richpath.RichPathView.setVectorDrawable(RichPathView.java:83) at com.richpath.RichPathView.setupAttributes(RichPathView.java:66) at com.richpath.RichPathView.(RichPathView.java:44) E/AndroidRuntime: at com.richpath.RichPathView.(RichPathView.java:38)

    bug 
    opened by rmasarovic 4
  • Release apk - Proguard - No animations?

    Release apk - Proguard - No animations?

    Hi! First of all, thank you for your work. Excellent library. I have one little problem when exporting a signed apk with proguard. When starting face love, animations are not happening. If turn off the animation, the animations start to work again. Any idea? Thanks in advance

    opened by entiti10 4
  • Detecting which group is clicked

    Detecting which group is clicked

    Hi Tarek

    We are currently investigating the business case to get some metadata from group tag after clicking on specific area in SVG file. So there is nicely done pathClickListener (and there is only vector with paths but not groups). What do u think about adding group field to RichPath class and store data about parental group there on xml parsing stage. And then inside onPathClickListener consumers can get the name of path's group. I can create pr for that, but first would like to know your opinion :)

    Regards, Serhii

    opened by serhiiskyrda 3
  • Does not support Clip-Path?

    Does not support Clip-Path?

    I have clipped my Vector in a circle clip-path and when I am using ImageView the vector is clipped and shown the way I want, but when using RichPathVew the clipping is gone. Any idea why?

    opened by YuganshT79 3
  • Editor. Render error

    Editor. Render error

    Upgrade to Android Studio 2.3 and then the editor displays this error: The following classes could not be instantiated: - com.richpath.RichPathView (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE.

    opened by mgleonsc 3
  • ArrayIndexOutOfBoundsException

    ArrayIndexOutOfBoundsException

    When try to animate below code

    String scanPath = getString(R.string.scan_path1);
            String qrPath = getString(R.string.qr_path1);
            final RichPath richPath = qrAnim.findFirstRichPath();
            RichPathAnimator
                    .animate(richPath)
                    .pathData(scanPath)
                    .duration(600)
                    .thenAnimate(richPath)
                    .pathData(qrPath)
                    .duration(600)
                    .start();
    

    and two concerned strings

     <string name="qr_path1">M 0 224 L 192 224 L 192 32 L 0 32 L 0 224 Z M 64 96 L 128 96 L 128 160 L 64 160 L 64 96 Z M 256 32 L 256 224 L 448 224 L 448 32 L 256 32 Z M 384 160 L 320 160 L 320 96 L 384 96 L 384 160 Z M 0 480 L 192 480 L 192 288 L 0 288 L 0 480 Z M 64 352 L 128 352 L 128 416 L 64 416 L 64 352 Z M 416 288 L 448 288 L 448 416 L 352 416 L 352 384 L 320 384 L 320 480 L 256 480 L 256 288 L 352 288 L 352 320 L 416 320 L 416 288 Z M 416 448 L 448 448 L 448 480 L 416 480 L 416 448 Z M 352 448 L 384 448 L 384 480 L 352 480 L 352 448 Z</string>
        <string name="scan_path1">M 3 5 L 3 9 L 5 9 L 5 5 L 9 5 L 9 3 L 5 3 C 3.9 3 3 3.9 3 5 Z M 5 15 L 3 15 L 3 19 C 3 20.1 3.9 21 5 21 L 9 21 L 9 19 L 5 19 L 5 15 Z M 19 19 L 15 19 L 15 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 15 L 19 15 L 19 19 Z M 19 3 L 15 3 L 15 5 L 19 5 L 19 9 L 21 9 L 21 5 C 21 3.9 20.1 3 19 3 Z</string>
    

    Got below error

    java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
            at com.richpathanimator.PathEvaluator.evaluate(PathEvaluator.java:26)
            at com.richpathanimator.PathEvaluator.evaluate(PathEvaluator.java:12)
            at android.animation.KeyframeSet.getValue(KeyframeSet.java:202)
            at android.animation.PropertyValuesHolder.calculateValue(PropertyValuesHolder.java:1017)
            at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1531)
            at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:987)
            at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:668)
            at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:631)
            at android.animation.ValueAnimator.start(ValueAnimator.java:1060)
            at android.animation.ValueAnimator.start(ValueAnimator.java:1079)
            at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
            at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1072)
            at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
            at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227)
    
    opened by farhanlatheef 2
  • Working with large size SVG images

    Working with large size SVG images

    Hi @tarek360, Thank you for this great project. I have a doubt can you please help me..

    I am trying to use a large size svg image with Richpath, when i run the app, the image is not being displayed. I tried to run it with a smaller svg image and it worked fine. I want to use svg images of size 4000dp x4000dp. I tried adding scroll views but no use.

    Can someone please tell me how to use a large svg image with Richpath also how to make them scrollable.

    Thank you.

    opened by saivineethkumar 0
  • Use androidx.core.graphics.PathParser instead of accessing a non-SDK interface via reflection

    Use androidx.core.graphics.PathParser instead of accessing a non-SDK interface via reflection

    Fixes #76

    Instead of calling android.util.PathParser.createPathFromPathData (which is prohibited when targeting API level 31), we can use androidx.core.graphics.PathParser.

    I also removed the following check Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP since this is always true given that minSdkVersion is 21.

    opened by tomdug 0
  • Non-SDK usage causing RichPathView.setVectorDrawable to throw an exception when targeting API Level 31

    Non-SDK usage causing RichPathView.setVectorDrawable to throw an exception when targeting API Level 31

    With the release of Android 12, a bunch of non-SDK interfaces were removed (see this).

    And this library uses reflection to call this non-SDK method with is now blocked in Android 12: Landroid/util/PathParser;->createPathFromPathData(Ljava/lang/String;)Landroid/graphics/Path;

    Trying to call RichPathView.setVectorDrawable thus causes this exception to be thrown:

    W/ Accessing hidden method Landroid/util/PathParser;->createPathFromPathData(Ljava/lang/String;)Landroid/graphics/Path; (max-target-r, reflection, denied)
    W/System.err: java.lang.NoSuchMethodException: android.util.PathParser.createPathFromPathData [class java.lang.String]
            at java.lang.Class.getMethod(Class.java:2103)
            at java.lang.Class.getDeclaredMethod(Class.java:2081)
            at com.richpath.pathparser.PathParserCompatApi21.getCreatePathFromPathDataMethod(PathParserCompatApi21.java:37)
            at com.richpath.pathparser.PathParserCompatApi21.createPathFromPathData(PathParserCompatApi21.java:21)
            at com.richpath.pathparser.PathParser.createPathFromPathData(PathParser.java:18)
            at com.richpath.RichPath.<init>(RichPath.java:71)
            at com.richpath.util.XmlParser.parsePathElement(XmlParser.java:87)
            at com.richpath.util.XmlParser.parseVector(XmlParser.java:55)
            at com.richpath.RichPathView.setVectorDrawable(RichPathView.java:84)
    
    opened by tomdug 1
  • Stop animation

    Stop animation

    Hello!

    Thank you for this awesome lib. I have a (maybe dumb) question. How can I stop a started (infinte) animation?

    I temporarily found that if I set the repeatCount field to 0 the animation stops, but I don't know if this is the right solution.

    var pulseAnimation = RichPathAnimator.animate(pathName)
    	.interpolator(LinearInterpolator())
    	.scale(1f, 2f)
    	.fillColor(0xFF00A951.toInt(), 0x0000A951)
    	.repeatMode(RichPathAnimator.RESTART)
    	.repeatCount(RichPathAnimator.INFINITE)
    	.duration(1500)
    
    pulseAnimation?.start()
    

    Thank you for your help.

    opened by wyzard 0
  • Double/Long click path listener

    Double/Long click path listener

    Is there solution for handle double/long click on path like setOnPathClickListener ? I want to use method like setOnPathDoubleClickListener or setOnPathLongClickListener

    p.s thx for your amazing library <3

    feaure 
    opened by davayd 2
Releases(0.0.9)
Owner
Ahmed Tarek
I enjoy pushing the limits of the Android development. I write to learn, I learn to share and I share to learn more. Twitter: a_tarek360
Ahmed Tarek
POC of how you can animate LazyColumn insertions/deletions/moving

Animated LazyColumn/LazyRow POC of how you can animate LazyColumn/LazyRow insertions/deletions/moving Note, this is not production ready or a library,

Roudi Korkis Kanaan 33 Dec 24, 2022
You don’t want your apps look and feel boring, do you? Add some bubbles!

#BubbleAnimationLayout Say hello to Bubble Animation Layout for Android by Cleveroad You don’t want your apps look and feel boring, do you? Add some b

Cleveroad 576 Nov 23, 2022
Android library to animate Floating Action Button to Bottom Sheet Dialog and vice-versa

FabulousFilter Show some ❤️ and star the repo to support the project This library is the implementation of filter-concept posted on MaterialUp.com. It

Krupen Ghetiya 2.6k Jan 3, 2023
Simple way to animate your views on Android with Rx 🚀

This is an Android library to make a simple way to animate your views on Android with Rx.

Lopez Mikhael 583 Dec 9, 2022
Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.

StrikedImageView Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines. Gradle allprojects { repositories

null 9 Sep 21, 2022
Animated-splash-screen - Animate your Splash Screen using Lottie files.

Animated Splash Screen This small project shows how you can add animation into your android projects or create beautiful looking Splash Screen or Laun

Aashish Ace 0 Jan 2, 2022
Backarrow-animation-example - Animate back arrow to close button in Compose using animated drawables

Animate Back Arrow to Close Icon in Compose This is a simple demo for animated v

Jose Mateo 3 Feb 17, 2022
Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs.

ComposeSimpleAnimation Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs that I needed in another project.

Mustafa Ibrahim 39 Dec 10, 2022
Introduction your app to the user , Easy to use and set Items as you want

Introduction App This lib helps to introduce the App-by view page based on Kotlin. Features Easy Set up Items: Title, Describe, Background, Buttons Ap

S.M.Zendehbad 0 May 6, 2022
DrawBox: a multi-purpose tool to draw anything on canvas, written completely on jetpack compose

DrawBox DrawBox is a multi-purpose tool to draw anything on canvas, written comp

Akshay Sharma 172 Dec 30, 2022
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 1, 2023
You can easily access the top of the screen in Android. Like a iPhone 6 & 6 Plus.

Reachability on Android Easy access on top. Like a iPhone 6 & 6 Plus. demo apk Usage Add dependencies compile 'com.github.sakebook:Reachability:0.2.0@

sakebook 258 Nov 12, 2022
An android project presenting some transitions you can use between activities

ActivityTransition An android project presenting some transitions you can use between activities #Integration Add the anim folder to your Android proj

null 260 Nov 29, 2022
💳 A quick and easy flip view through which you can create views with two sides like credit cards, poker cards etc.

The article on how this library was created is now published. You can read it on this link here. →. ?? EasyFlipView Built with ❤︎ by Wajahat Karim and

Wajahat Karim 1.3k Dec 14, 2022
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
The lib can make the ActivityOptions animations use in Android api3.1+

ActivityOptionsICS 本项目停止维护 =========== f you are thinking on customizing the animation of Activity transition then probably you would look for Activit

Kale 591 Nov 18, 2022
Wrapper of the ObjectAnimator that can be used similarly to ViewPropertyAnimator

ViewPropertyObjectAnimator Wrapper of the ObjectAnimator that can be used similarly to ViewPropertyAnimator. ViewPropertyObjectAnimator is as easy to

Bartek Lipinski 313 Dec 19, 2022
It's a cool animation which can use in splash or somewhere else.

What's Particle ? It's a cool animation which can use in splash or anywhere else. Demo Article 手摸手教你用Canvas实现简单粒子动画 Attributes name format description

巴掌 1.4k Dec 12, 2022
Road Runner is a library for android which allow you to make your own loading animation using a SVG image

Road Runner Road Runner is a library for android which allow you to make your own loading animation using a SVG image Sample video View in Youtube Dem

Adrián Lomas 1.2k Nov 18, 2022