Skip to content

Instantly share code, notes, and snippets.

@DaviesDominic DaviesDominic/avd_bezier
Last active Feb 13, 2017

Embed
What would you like to do?
Sharon Correa's Bezier Curve
<?xml version="1.0" encoding="utf-8"?>
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingPrefix">
<aapt:attr name="android:drawable">
<vector
android:width="105dp"
android:height="150dp"
android:viewportWidth="105"
android:viewportHeight="150">
<path
android:name="rectangle_horizontal"
android:strokeColor="@color/white"
android:strokeWidth="1.5"
android:strokeLineJoin="round"
android:pathData="M-1,47l0,56l108,0l0,-56z" />
<path
android:name="rectangle_vertical"
android:strokeColor="@color/white"
android:strokeWidth="1.5"
android:strokeLineJoin="round"
android:pathData="M24,-3l0,77.21l0,80.79l57,0l0,-158z" />
<path
android:name="curve"
android:strokeColor="#4A86BD"
android:strokeWidth="1.5"
android:pathData="M24,47 C65,47 78,71.5 80.5,103" />
<group
android:name="handle_top"
android:translateX="21"
android:translateY="44">
<path
android:strokeColor="#3E88D1"
android:strokeWidth="1.5"
android:pathData="M3,3 L45.5,3 L3,3 Z" />
<path
android:fillColor="#3E88D1"
android:strokeColor="#3E88D1"
android:strokeWidth="1"
android:pathData="M 45.5 0.5 C 46.8807118746 0.5 48 1.61928812542 48 3 C 48 4.38071187458 46.8807118746 5.5 45.5 5.5 C 44.1192881254 5.5 43 4.38071187458 43 3 C 43 1.61928812542 44.1192881254 0.5 45.5 0.5 Z" />
<path
android:fillColor="#FFFFFF"
android:strokeColor="#3E88D1"
android:strokeWidth="1"
android:pathData="M 3 0.5 C 4.38071187458 0.5 5.5 1.61928812542 5.5 3 C 5.5 4.38071187458 4.38071187458 5.5 3 5.5 C 1.61928812542 5.5 0.5 4.38071187458 0.5 3 C 0.5 1.61928812542 1.61928812542 0.5 3 0.5 Z" />
</group>
<group
android:name="handle_bottom"
android:translateX="46"
android:translateY="100"
android:pivotX="35"
android:pivotY="3"
android:rotation="83">
<group
android:name="handle_end"
android:translateX="0" >
<path
android:name="handle_path"
android:strokeColor="#4A86BD"
android:strokeWidth="1.5"
android:pathData="M2.5,3 L35,3 L2.5,3 Z" />
<path
android:fillColor="#4A86BD"
android:strokeColor="#4A86BD"
android:strokeWidth="1"
android:pathData="M 2.5 0.5 C 3.88071187458 0.5 5 1.61928812542 5 3 C 5 4.38071187458 3.88071187458 5.5 2.5 5.5 C 1.11928812542 5.5 0 4.38071187458 0 3 C 0 1.61928812542 1.11928812542 0.5 2.5 0.5 Z" />
</group>
<path
android:fillColor="#FFFFFF"
android:strokeColor="#4A86BD"
android:strokeWidth="1"
android:pathData="M 35 0.5 C 36.3807118746 0.5 37.5 1.61928812542 37.5 3 C 37.5 4.38071187458 36.3807118746 5.5 35 5.5 C 33.6192881254 5.5 32.5 4.38071187458 32.5 3 C 32.5 1.61928812542 33.6192881254 0.5 35 0.5 Z" />
</group>
</vector>
</aapt:attr>
<target
android:name="rectangle_vertical" >
<aapt:attr name="android:animation">
<set>
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="pathData"
android:interpolator="@anim/file_interpolator"
android:valueFrom="M24,-3l0,77.21l0,80.79l57,0l0,-158z"
android:valueTo="M14,-1l0,74.28l0,77.72l77,0l0,-152z"
android:valueType="pathType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="1400"
android:propertyName="pathData"
android:interpolator="@anim/file_interpolator"
android:valueFrom="M14,-1l0,74.28l0,77.72l77,0l0,-152z"
android:valueTo="M24,-3l0,77.21l0,80.79l57,0l0,-158z"
android:valueType="pathType" />
</set>
</aapt:attr>
</target>
<target
android:name="rectangle_horizontal" >
<aapt:attr name="android:animation">
<set>
<objectAnimator
android:duration="@integer/duration_long"
android:propertyName="pathData"
android:interpolator="@anim/file_interpolator"
android:valueFrom="M-1,47l0,56l108,0l0,-56z"
android:valueTo="M-1,57l0,36l107,0l0,-36z"
android:valueType="pathType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="pathData"
android:interpolator="@anim/file_interpolator"
android:valueFrom="M-1,57l0,36l107,0l0,-36z"
android:valueTo="M-1,47l0,56l108,0l0,-56z"
android:valueType="pathType" />
</set>
</aapt:attr>
</target>
<target
android:name="curve" >
<aapt:attr name="android:animation">
<set>
<objectAnimator
android:duration="@integer/duration_long"
android:propertyName="pathData"
android:interpolator="@anim/file_interpolator"
android:valueFrom="M24,47 C65,47 78,71.5 80.5,103"
android:valueTo="M24,57 C50,57 71.5,75.5 80.5,93"
android:valueType="pathType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="pathData"
android:interpolator="@anim/file_interpolator"
android:valueFrom="M24,57 C50,57 71.5,75.5 80.5,93"
android:valueTo="M14,47 C55,47 42,104.5 90.5,103"
android:valueType="pathType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="1400"
android:propertyName="pathData"
android:interpolator="@anim/file_interpolator"
android:valueFrom="M14,47 C55,47 42,104.5 90.5,103"
android:valueTo="M24,47 C65,47 78,71.5 80.5,103"
android:valueType="pathType" />
</set>
</aapt:attr>
</target>
<target
android:name="handle_top" >
<aapt:attr name="android:animation">
<set>
<objectAnimator
android:duration="@integer/duration_long"
android:propertyName="translateY"
android:interpolator="@anim/file_interpolator"
android:valueFrom="44"
android:valueTo="54"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="translateX"
android:interpolator="@anim/file_interpolator"
android:valueFrom="21"
android:valueTo="11"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="translateY"
android:interpolator="@anim/file_interpolator"
android:valueFrom="54"
android:valueTo="44"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="1400"
android:propertyName="translateX"
android:interpolator="@anim/file_interpolator"
android:valueFrom="11"
android:valueTo="21"
android:valueType="floatType" />
</set>
</aapt:attr>
</target>
<target
android:name="handle_bottom" >
<aapt:attr name="android:animation">
<set>
<objectAnimator
android:duration="@integer/duration_long"
android:propertyName="translateY"
android:interpolator="@anim/file_interpolator"
android:valueFrom="100"
android:valueTo="90"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:propertyName="rotation"
android:interpolator="@anim/file_interpolator"
android:valueFrom="83"
android:valueTo="60"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="translateX"
android:interpolator="@anim/file_interpolator"
android:valueFrom="46"
android:valueTo="56"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="translateY"
android:interpolator="@anim/file_interpolator"
android:valueFrom="90"
android:valueTo="100"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="rotation"
android:interpolator="@anim/file_interpolator"
android:valueFrom="59"
android:valueTo="0"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="1400"
android:propertyName="translateX"
android:interpolator="@anim/file_interpolator"
android:valueFrom="56"
android:valueTo="46"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="1400"
android:propertyName="rotation"
android:interpolator="@anim/file_interpolator"
android:valueFrom="0"
android:valueTo="83"
android:valueType="floatType" />
</set>
</aapt:attr>
</target>
<target
android:name="handle_end" >
<aapt:attr name="android:animation">
<set>
<objectAnimator
android:duration="@integer/duration_long"
android:propertyName="translateX"
android:interpolator="@anim/file_interpolator"
android:valueFrom="0"
android:valueTo="10"
android:valueType="floatType" />
<objectAnimator
android:duration="@integer/duration_long"
android:startOffset="700"
android:propertyName="translateX"
android:interpolator="@anim/file_interpolator"
android:valueFrom="10"
android:valueTo="0"
android:valueType="floatType" />
</set>
</aapt:attr>
</target>
<target
android:name="handle_path" >
<aapt:attr name="android:animation">
<set>
<objectAnimator
android:duration="@integer/duration_medium"
android:propertyName="trimPathEnd"
android:interpolator="@anim/file_interpolator"
android:valueFrom="1"
android:valueTo="0.35"
android:valueType="floatType" />
<objectAnimator
android:duration="1100"
android:startOffset="700"
android:propertyName="trimPathEnd"
android:interpolator="@anim/file_interpolator"
android:valueFrom="0.35"
android:valueTo="1"
android:valueType="floatType" />
</set>
</aapt:attr>
</target>
</animated-vector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.