Making checkbox animations closer to how the native checkbox animation is

+ rename of one anim
This commit is contained in:
Jays2Kings 2021-07-11 13:43:44 -04:00
parent c4ebc6b58e
commit 074321865e
6 changed files with 26 additions and 26 deletions

View File

@ -100,7 +100,7 @@ class TriStateCheckBox constructor(context: Context, attrs: AttributeSet?) :
setAnimVectorCompat( setAnimVectorCompat(
when (oldState) { when (oldState) {
State.INVERSED -> R.drawable.anim_check_box_x_to_blank_24dp State.INVERSED -> R.drawable.anim_check_box_x_to_blank_24dp
else -> R.drawable.anim_checkbox_checked_to_blank_24dp else -> R.drawable.anim_check_box_checked_to_blank_24dp
}, },
R.attr.colorControlNormal R.attr.colorControlNormal
) )

View File

@ -18,7 +18,7 @@ class QuadStateCheckBox @JvmOverloads constructor(context: Context, attrs: Attri
State.UNCHECKED -> setAnimVectorCompat( State.UNCHECKED -> setAnimVectorCompat(
when (this.state) { when (this.state) {
State.INVERSED -> R.drawable.anim_check_box_x_to_blank_24dp State.INVERSED -> R.drawable.anim_check_box_x_to_blank_24dp
else -> R.drawable.anim_checkbox_checked_to_blank_24dp else -> R.drawable.anim_check_box_checked_to_blank_24dp
}, },
R.attr.colorControlNormal R.attr.colorControlNormal
) )

View File

@ -33,11 +33,11 @@
<objectAnimator <objectAnimator
android:propertyName="pathData" android:propertyName="pathData"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.913 20.122 3.022 19.04 3 C 19.027 3 19.013 3 19 3 M 12.7 12.7 L 11.3 12.7 L 11.3 11.3 L 12.7 11.3 L 12.7 11.3 L 12.7 12.7" android:valueFrom="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.913 20.122 3.022 19.04 3 C 19.027 3 19.013 3 19 3 M 12.7 12.7 L 11.3 12.7 L 11.3 11.3 L 12.7 11.3 L 12.7 11.3 L 12.7 12.7"
android:valueTo="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.9 20.1 3 19 3 C 19 3 19 3 19 3 M 10 17 L 5 12 L 6.4 10.6 L 10 14.2 L 17.6 6.6 L 19 8" android:valueTo="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.9 20.1 3 19 3 C 19 3 19 3 19 3 M 10 17 L 5 12 L 6.4 10.6 L 10 14.2 L 17.6 6.6 L 19 8"
android:valueType="pathType" android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>
@ -61,19 +61,19 @@
<objectAnimator <objectAnimator
android:propertyName="scaleX" android:propertyName="scaleX"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
<objectAnimator <objectAnimator
android:propertyName="scaleY" android:propertyName="scaleY"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>

View File

@ -33,11 +33,11 @@
<objectAnimator <objectAnimator
android:propertyName="pathData" android:propertyName="pathData"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 19.559 3.232 20.066 3.605 20.43 C 3.966 20.782 4.459 21 5 21 L 19 21 C 19.507 21 19.971 20.809 20.324 20.496 C 20.738 20.128 21 19.593 21 19 L 21 5 C 21 3.9 20.1 3 19 3 M 12.7 11.3 L 12.7 12.7 L 11.3 12.7 L 11.3 11.3 L 12.7 11.3 Z" android:valueFrom="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 19.559 3.232 20.066 3.605 20.43 C 3.966 20.782 4.459 21 5 21 L 19 21 C 19.507 21 19.971 20.809 20.324 20.496 C 20.738 20.128 21 19.593 21 19 L 21 5 C 21 3.9 20.1 3 19 3 M 12.7 11.3 L 12.7 12.7 L 11.3 12.7 L 11.3 11.3 L 12.7 11.3 Z"
android:valueTo="M 19 3 L 5 3 C 3.89 3 3 3.89 3 5 L 3 19 C 3 19.53 3.211 20.039 3.586 20.414 C 3.961 20.789 4.47 21 5 21 L 19 21 C 19.53 21 20.039 20.789 20.414 20.414 C 20.789 20.039 21 19.53 21 19 L 21 5 C 21 3.89 20.1 3 19 3 M 19 5 L 19 19 L 5 19 L 5 5 L 19 5 Z" android:valueTo="M 19 3 L 5 3 C 3.89 3 3 3.89 3 5 L 3 19 C 3 19.53 3.211 20.039 3.586 20.414 C 3.961 20.789 4.47 21 5 21 L 19 21 C 19.53 21 20.039 20.789 20.414 20.414 C 20.789 20.039 21 19.53 21 19 L 21 5 C 21 3.89 20.1 3 19 3 M 19 5 L 19 19 L 5 19 L 5 5 L 19 5 Z"
android:valueType="pathType" android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>
@ -61,19 +61,19 @@
<objectAnimator <objectAnimator
android:propertyName="scaleX" android:propertyName="scaleX"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
<objectAnimator <objectAnimator
android:propertyName="scaleY" android:propertyName="scaleY"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>

View File

@ -33,11 +33,11 @@
<objectAnimator <objectAnimator
android:propertyName="pathData" android:propertyName="pathData"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="M 19.04 3 C 19.027 3 19.013 3 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.913 20.122 3.022 19.04 3 M 12.654 12.7 L 12.031 12.7 L 11.3 12.7 L 11.3 12.7 L 11.3 12 L 11.3 11.3 L 11.331 11.3 L 12.031 11.3 L 12.7 11.3 L 12.7 11.3 L 12.7 12.078 L 12.7 12.7 L 12.7 12.7 L 12.654 12.7" android:valueFrom="M 19.04 3 C 19.027 3 19.013 3 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.913 20.122 3.022 19.04 3 M 12.654 12.7 L 12.031 12.7 L 11.3 12.7 L 11.3 12.7 L 11.3 12 L 11.3 11.3 L 11.331 11.3 L 12.031 11.3 L 12.7 11.3 L 12.7 11.3 L 12.7 12.078 L 12.7 12.7 L 12.7 12.7 L 12.654 12.7"
android:valueTo="M 19 3 C 18.991 3 18.982 3 18.973 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.9 20.1 3 19 3 M 15.6 17 L 12 13.4 L 8.4 17 L 7 15.6 L 10.6 12 L 7 8.4 L 8.4 7 L 12 10.6 L 15.6 7 L 17 8.4 L 13.4 12 L 17 15.6 L 15.6 17 L 15.6 17" android:valueTo="M 19 3 C 18.991 3 18.982 3 18.973 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 20.1 3.9 21 5 21 L 19 21 C 20.1 21 21 20.1 21 19 L 21 5 C 21 3.9 20.1 3 19 3 M 15.6 17 L 12 13.4 L 8.4 17 L 7 15.6 L 10.6 12 L 7 8.4 L 8.4 7 L 12 10.6 L 15.6 7 L 17 8.4 L 13.4 12 L 17 15.6 L 15.6 17 L 15.6 17"
android:valueType="pathType" android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>
@ -61,19 +61,19 @@
<objectAnimator <objectAnimator
android:propertyName="scaleX" android:propertyName="scaleX"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
<objectAnimator <objectAnimator
android:propertyName="scaleY" android:propertyName="scaleY"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>

View File

@ -33,11 +33,11 @@
<objectAnimator <objectAnimator
android:propertyName="pathData" android:propertyName="pathData"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 19.559 3.232 20.066 3.605 20.43 C 3.966 20.782 4.459 21 5 21 L 19 21 C 19.507 21 19.971 20.809 20.324 20.496 C 20.738 20.128 21 19.593 21 19 L 21 5 C 21 3.9 20.1 3 19 3 M 12.7 11.3 L 12.7 12.7 L 11.3 12.7 L 11.3 11.3 L 12.7 11.3 Z" android:valueFrom="M 19 3 L 5 3 C 3.9 3 3 3.9 3 5 L 3 19 C 3 19.559 3.232 20.066 3.605 20.43 C 3.966 20.782 4.459 21 5 21 L 19 21 C 19.507 21 19.971 20.809 20.324 20.496 C 20.738 20.128 21 19.593 21 19 L 21 5 C 21 3.9 20.1 3 19 3 M 12.7 11.3 L 12.7 12.7 L 11.3 12.7 L 11.3 11.3 L 12.7 11.3 Z"
android:valueTo="M 19 3 L 5 3 C 3.89 3 3 3.89 3 5 L 3 19 C 3 19.53 3.211 20.039 3.586 20.414 C 3.961 20.789 4.47 21 5 21 L 19 21 C 19.53 21 20.039 20.789 20.414 20.414 C 20.789 20.039 21 19.53 21 19 L 21 5 C 21 3.89 20.1 3 19 3 M 19 5 L 19 19 L 5 19 L 5 5 L 19 5 Z" android:valueTo="M 19 3 L 5 3 C 3.89 3 3 3.89 3 5 L 3 19 C 3 19.53 3.211 20.039 3.586 20.414 C 3.961 20.789 4.47 21 5 21 L 19 21 C 19.53 21 20.039 20.789 20.414 20.414 C 20.789 20.039 21 19.53 21 19 L 21 5 C 21 3.89 20.1 3 19 3 M 19 5 L 19 19 L 5 19 L 5 5 L 19 5 Z"
android:valueType="pathType" android:valueType="pathType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>
@ -61,19 +61,19 @@
<objectAnimator <objectAnimator
android:propertyName="scaleX" android:propertyName="scaleX"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
<objectAnimator <objectAnimator
android:propertyName="scaleY" android:propertyName="scaleY"
android:startOffset="150" android:startOffset="150"
android:duration="150" android:duration="1300"
android:valueFrom="0.9" android:valueFrom="0.9"
android:valueTo="1" android:valueTo="1"
android:valueType="floatType" android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in"/> android:interpolator="@android:interpolator/linear_out_slow_in"/>
</set> </set>
</aapt:attr> </aapt:attr>
</target> </target>