Animated recents tab icon

This commit is contained in:
Jays2Kings 2021-04-23 19:41:50 -04:00
parent 5b6463c823
commit ba86aec35e
7 changed files with 266 additions and 6 deletions

View File

@ -0,0 +1,92 @@
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:name="group_3"
android:pivotX="12"
android:pivotY="12">
<path
android:name="path_5"
android:pathData="M 11.2 12.3 L 11.2 6.1 L 12.8 6.1 L 12.8 12.4 Z"
android:fillColor="#000"
android:fillAlpha="0"
android:strokeWidth="1"/>
<group
android:name="group_2"
android:pivotX="12"
android:pivotY="12"
android:rotation="125">
<path
android:name="path_6"
android:pathData="M 11.2 12.3 L 11.2 6.1 L 12.8 6.1 L 12.8 12.4 Z"
android:fillColor="#000000"
android:fillAlpha="0"/>
</group>
</group>
<group
android:name="group_1"
android:pivotX="12"
android:pivotY="12">
<clip-path
android:name="mask_1"
android:pathData="M 12 2 C 6.5 2 2 6.5 2 12 C 2 17.5 6.5 22 12 22 C 17.5 22 22 17.5 22 12 C 22 6.5 17.5 2 12 2 M 11.2 12.3 L 11.2 6.1 L 12.7 6.1 L 12.7 12.4 L 11.2 12.3 Z"/>
<group
android:name="group"
android:pivotX="12"
android:pivotY="12"
android:rotation="125">
<clip-path
android:name="mask"
android:pathData="M 12 2 C 6.5 2 2 6.5 2 12 C 2 17.5 6.5 22 12 22 C 17.5 22 22 17.5 22 12 C 22 6.5 17.5 2 12 2 M 11.2 12.3 L 11.2 6.1 L 12.7 6.1 L 12.7 12.4 L 11.2 12.3 Z"/>
<path
android:name="path"
android:pathData="M 12 2 C 9.349 2 6.804 3.054 4.929 4.929 C 3.054 6.804 2 9.349 2 12 C 2 14.651 3.054 17.196 4.929 19.071 C 6.804 20.946 9.349 22 12 22 C 13.755 22 15.48 21.538 17 20.66 C 18.52 19.783 19.783 18.52 20.66 17 C 21.538 15.48 22 13.755 22 12 C 22 10.245 21.538 8.52 20.66 7 C 19.783 5.48 18.52 4.217 17 3.34 C 15.48 2.462 13.755 2 12 2 Z M 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12"
android:fillColor="#000"
android:strokeWidth="1"/>
</group>
</group>
</vector>
</aapt:attr>
<target android:name="path">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="pathData"
android:startOffset="75"
android:duration="350"
android:valueFrom="M 12 2 C 9.349 2 6.804 3.054 4.929 4.929 C 3.054 6.804 2 9.349 2 12 C 2 14.651 3.054 17.196 4.929 19.071 C 6.804 20.946 9.349 22 12 22 C 13.755 22 15.48 21.538 17 20.66 C 18.52 19.783 19.783 18.52 20.66 17 C 21.538 15.48 22 13.755 22 12 C 22 10.245 21.538 8.52 20.66 7 C 19.783 5.48 18.52 4.217 17 3.34 C 15.48 2.462 13.755 2 12 2 Z M 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12"
android:valueTo="M 12 2 C 9.349 2 6.804 3.054 4.929 4.929 C 3.054 6.804 2 9.349 2 12 C 2 14.651 3.054 17.196 4.929 19.071 C 6.804 20.946 9.349 22 12 22 C 13.755 22 15.48 21.538 17 20.66 C 18.52 19.783 19.783 18.52 20.66 17 C 21.538 15.48 22 13.755 22 12 C 22 10.245 21.538 8.52 20.66 7 C 19.783 5.48 18.52 4.217 17 3.34 C 15.48 2.462 13.755 2 12 2 Z M 12 20 C 9.879 20 7.843 19.157 6.343 17.657 C 4.843 16.157 4 14.121 4 12 C 4 9.879 4.843 7.843 6.343 6.343 C 7.843 4.843 9.879 4 12 4 C 14.121 4 16.157 4.843 17.657 6.343 C 19.157 7.843 20 9.879 20 12 C 20 14.121 19.157 16.157 17.657 17.657 C 16.157 19.157 14.121 20 12 20"
android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path_5">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillAlpha"
android:startOffset="75"
android:duration="350"
android:valueFrom="0"
android:valueTo="1"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path_6">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillAlpha"
android:duration="350"
android:valueFrom="0"
android:valueTo="1"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
</animated-vector>

View File

@ -0,0 +1,139 @@
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:name="group_3"
android:pivotX="12"
android:pivotY="12">
<path
android:name="path_5"
android:pathData="M 11.2 12.3 L 11.2 6.1 L 12.8 6.1 L 12.8 12.4 Z"
android:fillColor="#000"
android:strokeWidth="1"/>
<group
android:name="group_2"
android:pivotX="12"
android:pivotY="12"
android:rotation="125">
<path
android:name="path_6"
android:pathData="M 11.2 12.3 L 11.2 6.1 L 12.8 6.1 L 12.8 12.4 Z"
android:fillColor="#000000"/>
</group>
</group>
<group
android:name="group_1"
android:pivotX="12"
android:pivotY="12">
<clip-path
android:name="mask_1"
android:pathData="M 12 2 C 6.5 2 2 6.5 2 12 C 2 17.5 6.5 22 12 22 C 17.5 22 22 17.5 22 12 C 22 6.5 17.5 2 12 2 M 11.2 12.3 L 11.2 6.1 L 12.7 6.1 L 12.7 12.4 L 11.2 12.3 Z"/>
<group
android:name="group"
android:pivotX="12"
android:pivotY="12"
android:rotation="125">
<clip-path
android:name="mask"
android:pathData="M 12 2 C 6.5 2 2 6.5 2 12 C 2 17.5 6.5 22 12 22 C 17.5 22 22 17.5 22 12 C 22 6.5 17.5 2 12 2 M 11.2 12.3 L 11.2 6.1 L 12.7 6.1 L 12.7 12.4 L 11.2 12.3 Z"/>
<path
android:name="path"
android:pathData="M 12 2 C 9.349 2 6.804 3.054 4.929 4.929 C 3.054 6.804 2 9.349 2 12 C 2 14.651 3.054 17.196 4.929 19.071 C 6.804 20.946 9.349 22 12 22 C 13.755 22 15.48 21.538 17 20.66 C 18.52 19.783 19.783 18.52 20.66 17 C 21.538 15.48 22 13.755 22 12 C 22 10.245 21.538 8.52 20.66 7 C 19.783 5.48 18.52 4.217 17 3.34 C 15.48 2.462 13.755 2 12 2 Z M 12 20 C 9.879 20 7.843 19.157 6.343 17.657 C 4.843 16.157 4 14.121 4 12 C 4 9.879 4.843 7.843 6.343 6.343 C 7.843 4.843 9.879 4 12 4 C 14.121 4 16.157 4.843 17.657 6.343 C 19.157 7.843 20 9.879 20 12 C 20 14.121 19.157 16.157 17.657 17.657 C 16.157 19.157 14.121 20 12 20"
android:fillColor="#000"
android:strokeWidth="1"/>
</group>
</group>
</vector>
</aapt:attr>
<target android:name="group_1">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="rotation"
android:startOffset="75"
android:duration="400"
android:valueFrom="0"
android:valueTo="125"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="group">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="rotation"
android:startOffset="75"
android:duration="400"
android:valueFrom="125"
android:valueTo="235"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="pathData"
android:startOffset="175"
android:duration="350"
android:valueFrom="M 12 2 C 9.349 2 6.804 3.054 4.929 4.929 C 3.054 6.804 2 9.349 2 12 C 2 14.651 3.054 17.196 4.929 19.071 C 6.804 20.946 9.349 22 12 22 C 13.755 22 15.48 21.538 17 20.66 C 18.52 19.783 19.783 18.52 20.66 17 C 21.538 15.48 22 13.755 22 12 C 22 10.245 21.538 8.52 20.66 7 C 19.783 5.48 18.52 4.217 17 3.34 C 15.48 2.462 13.755 2 12 2 Z M 12 20 C 9.879 20 7.843 19.157 6.343 17.657 C 4.843 16.157 4 14.121 4 12 C 4 9.879 4.843 7.843 6.343 6.343 C 7.843 4.843 9.879 4 12 4 C 14.121 4 16.157 4.843 17.657 6.343 C 19.157 7.843 20 9.879 20 12 C 20 14.121 19.157 16.157 17.657 17.657 C 16.157 19.157 14.121 20 12 20"
android:valueTo="M 12 2 C 9.349 2 6.804 3.054 4.929 4.929 C 3.054 6.804 2 9.349 2 12 C 2 14.651 3.054 17.196 4.929 19.071 C 6.804 20.946 9.349 22 12 22 C 13.755 22 15.48 21.538 17 20.66 C 18.52 19.783 19.783 18.52 20.66 17 C 21.538 15.48 22 13.755 22 12 C 22 10.245 21.538 8.52 20.66 7 C 19.783 5.48 18.52 4.217 17 3.34 C 15.48 2.462 13.755 2 12 2 Z M 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12 C 12 12 12 12 12 12"
android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="group_2">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="rotation"
android:startOffset="75"
android:duration="400"
android:valueFrom="125"
android:valueTo="235"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="group_3">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="rotation"
android:startOffset="75"
android:duration="400"
android:valueFrom="0"
android:valueTo="125"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path_5">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillAlpha"
android:startOffset="175"
android:duration="350"
android:valueFrom="1"
android:valueTo="0"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path_6">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillAlpha"
android:startOffset="175"
android:duration="350"
android:valueFrom="1"
android:valueTo="0"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
</animated-vector>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_recent_read_32dp" android:state_checked="true" />
<item android:drawable="@drawable/ic_recent_read_outline_24dp" android:state_checked="false" />
</selector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C9.3,2 6.8,3.1 4.9,4.9S2,9.3 2,12s1.1,5.2 2.9,7.1S9.3,22 12,22c1.8,0 3.5,-0.5 5,-1.3c1.5,-0.9 2.8,-2.1 3.7,-3.7c0.9,-1.5 1.3,-3.2 1.3,-5s-0.5,-3.5 -1.3,-5c-0.9,-1.5 -2.1,-2.8 -3.7,-3.7C15.5,2.5 13.8,2 12,2zM12.8,6.1v5.5l4.5,3.1L16.4,16l-5.2,-3.6v-0.1V6.1H12.8z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M20.2,17.7c1.5,-2.2 2.1,-4.9 1.7,-7.5c-0.5,-2.6 -1.9,-4.9 -4.1,-6.5s-4.9,-2.1 -7.5,-1.7S5.3,4.1 3.8,6.3c-1,1.4 -1.6,3.1 -1.8,4.9c-0.2,1.7 0.2,3.5 0.9,5.1c0.7,1.6 1.9,3 3.3,4s3.1,1.6 4.9,1.8c1.7,0.2 3.5,-0.2 5.1,-0.9C17.8,20.3 19.2,19.2 20.2,17.7zM5.4,7.4c1.2,-1.7 3.1,-2.9 5.2,-3.3c2.1,-0.4 4.2,0.1 6,1.3s2.9,3.1 3.3,5.2c0.4,2.1 -0.1,4.2 -1.3,6c-1.2,1.7 -3.1,2.9 -5.2,3.3c-2.1,0.4 -4.2,-0.1 -6,-1.3c-1.7,-1.2 -2.9,-3.1 -3.3,-5.2S4.2,9.1 5.4,7.4M12.8,6.1v5.5l4.5,3.1L16.4,16l-5.2,-3.6l0,-0.1V6.1H12.8z"/>
</vector>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/checked" android:drawable="@drawable/ic_recents_filled_24dp" android:state_checked="true" />
<item android:id="@id/normal" android:drawable="@drawable/ic_recents_outline_24dp" android:state_checked="false" />
<transition
android:fromId="@id/checked"
android:toId="@id/normal"
android:drawable="@drawable/anim_recents_filled_to_outline"/>
<transition
android:fromId="@id/normal"
android:toId="@id/checked"
android:drawable="@drawable/anim_recents_outline_to_filled"/>
</animated-selector>

View File

@ -8,7 +8,7 @@
android:title="@string/library" />
<item
android:id="@+id/nav_recents"
android:icon="@drawable/ic_recent_read_selector_24dp"
android:icon="@drawable/ic_recents_selector_24dp"
android:title="@string/recents" />
<item
android:id="@+id/nav_browse"