Skip to content

Commit

Permalink
Cleaned up heart fill/break animation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbutcher committed Oct 18, 2016
1 parent e566161 commit 2a44aad
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 104 deletions.
25 changes: 0 additions & 25 deletions app/src/main/res/animator/heart_fill.xml

This file was deleted.

48 changes: 44 additions & 4 deletions app/src/main/res/drawable/avd_heart_fill.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,50 @@

<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/heart_anim">
xmlns:aapt="http://schemas.android.com/aapt">

<target
android:name="clip"
android:animation="@animator/heart_fill" />
<aapt:attr name="android:drawable">

<vector
android:width="56dp"
android:height="56dp"
android:viewportWidth="56"
android:viewportHeight="56">

<path
android:pathData="@string/heart_empty_path_56dp"
android:fillColor="@color/fab_heart_empty" />

<group android:name="filled">

<clip-path
android:name="clip"
android:pathData="@string/heart_clip_hidden" />

<path
android:pathData="@string/heart_full_path_56dp"
android:fillColor="@color/fab_heart_full" />

</group>

</vector>

</aapt:attr>

<target android:name="clip">

<aapt:attr name="android:animation">

<objectAnimator
android:propertyName="pathData"
android:valueFrom="@string/heart_clip_hidden"
android:valueTo="@string/heart_clip_shown"
android:valueType="pathType"
android:duration="@integer/heart_fill_time"
android:interpolator="@android:interpolator/fast_out_slow_in" />

</aapt:attr>

</target>

</animated-vector>
73 changes: 0 additions & 73 deletions app/src/main/res/drawable/heart_anim.xml

This file was deleted.

4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_heart_break.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="56dp"
android:height="56dp"
android:viewportHeight="56"
android:viewportWidth="56">
android:viewportWidth="56"
android:viewportHeight="56">

<!-- Stroked heart, 2 paths so can 'draw' them concurrently by animating trim.
Initially hidden -->
Expand Down

0 comments on commit 2a44aad

Please sign in to comment.