mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-21 23:03:11 +01:00
997b7be4c0
Replace the short video with an animated vector image that shows the swipe gesture. This is much lighter and reliable than the mp4 video, which failed to play on many devices. Source for the image of the key is in inkscape SVG format in srcs/res and is converted to an android drawable when needed. The swipe animation is hand-written.
26 lines
2.0 KiB
XML
26 lines
2.0 KiB
XML
<?xml version="1.0"?>
|
|
<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="35dp" android:height="40dp" android:viewportWidth="35" android:viewportHeight="40">
|
|
<path android:name="trace" android:pathData="M 0 0" android:fillColor="#09b3f1" android:strokeColor="#09b3f1" android:strokeWidth="2" android:strokeLineCap="round"/>
|
|
</vector>
|
|
</aapt:attr>
|
|
<target android:name="trace">
|
|
<aapt:attr name="android:animation">
|
|
<set>
|
|
<objectAnimator android:propertyName="fillAlpha" android:duration="100" android:valueFrom="0" android:valueTo="1" android:valueType="floatType" android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
|
<objectAnimator android:propertyName="strokeAlpha" android:duration="100" android:valueFrom="0" android:valueTo="1" android:valueType="floatType" android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
|
<objectAnimator
|
|
android:propertyName="pathData"
|
|
android:duration="700"
|
|
android:valueFrom="M 17.5 20.0 m 2,0 a 2,2 0 1,1 -4,0 a 2,2 0 1,1 4,0 M 17.5 20.0 L 17.5,20.0"
|
|
android:valueTo=" M 31 4 m 2,0 a 2,2 0 1,1 -4,0 a 2,2 0 1,1 4,0 M 17.5 20.0 L 31 ,4"
|
|
android:valueType="pathType"
|
|
android:interpolator="@android:interpolator/linear_out_slow_in"/>
|
|
<objectAnimator android:propertyName="fillAlpha" android:startOffset="900" android:duration="400" android:valueFrom="1" android:valueTo="0" android:valueType="floatType" android:interpolator="@android:interpolator/linear_out_slow_in"/>
|
|
<objectAnimator android:propertyName="strokeAlpha" android:startOffset="900" android:duration="400" android:valueFrom="1" android:valueTo="0" android:valueType="floatType" android:interpolator="@android:interpolator/linear_out_slow_in"/>
|
|
</set>
|
|
</aapt:attr>
|
|
</target>
|
|
</animated-vector>
|