Skip to content

Commit

Permalink
Add animation for fingerprint icon
Browse files Browse the repository at this point in the history
Also show the "Whoops" dialog when the finger is resting on the icon,
in addition to show it after clicking it for 3 times.

Bug: 20495507
Change-Id: I771da0671f61c13065b011d613f508827cb3b54f
  • Loading branch information
XSJoJo committed Apr 27, 2015
1 parent 64e9c4c commit 2c2a416
Show file tree
Hide file tree
Showing 12 changed files with 498 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="233"
android:propertyName="trimPathEnd"
android:valueFrom="0.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="566"
android:propertyName="trimPathEnd"
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="700"
android:propertyName="trimPathStart"
android:valueFrom="0.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="433"
android:propertyName="trimPathStart"
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@interpolator/enrollment_fingerprint_isolated_animation_interpolator_1" />
</set>
</set>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="733"
android:propertyName="trimPathEnd"
android:valueFrom="1.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="533"
android:propertyName="trimPathEnd"
android:valueFrom="1.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@interpolator/enrollment_fingerprint_isolated_animation_interpolator_2" />
</set>
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="366"
android:propertyName="trimPathStart"
android:valueFrom="1.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="633"
android:propertyName="trimPathStart"
android:valueFrom="1.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@interpolator/enrollment_fingerprint_isolated_animation_interpolator_2" />
</set>
</set>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="166"
android:propertyName="trimPathEnd"
android:valueFrom="0.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="900"
android:propertyName="trimPathEnd"
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="600"
android:propertyName="trimPathStart"
android:valueFrom="0.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="833"
android:propertyName="trimPathStart"
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@interpolator/enrollment_fingerprint_isolated_animation_interpolator_1" />
</set>
</set>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="400"
android:propertyName="trimPathEnd"
android:valueFrom="1.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="900"
android:propertyName="trimPathEnd"
android:valueFrom="1.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@interpolator/enrollment_fingerprint_isolated_animation_interpolator_0" />
</set>
<objectAnimator
android:duration="866"
android:propertyName="trimPathStart"
android:valueFrom="1.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@interpolator/enrollment_fingerprint_isolated_animation_interpolator_2" />
</set>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<set
xmlns:android="http://schemas.android.com/apk/res/android" >
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="100"
android:propertyName="trimPathEnd"
android:valueFrom="0.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="966"
android:propertyName="trimPathEnd"
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
<set
android:ordering="sequentially" >
<objectAnimator
android:duration="533"
android:propertyName="trimPathStart"
android:valueFrom="0.0"
android:valueTo="0.0"
android:valueType="floatType"
android:interpolator="@android:interpolator/linear" />
<objectAnimator
android:duration="900"
android:propertyName="trimPathStart"
android:valueFrom="0.0"
android:valueTo="1.0"
android:valueType="floatType"
android:interpolator="@interpolator/enrollment_fingerprint_isolated_animation_interpolator_1" />
</set>
</set>
81 changes: 81 additions & 0 deletions res/drawable/enrollment_fingerprint_isolated.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="enrollment_fingerprint_isolated"
android:width="75dp"
android:viewportWidth="75"
android:height="88dp"
android:viewportHeight="88" >
<group
android:name="fingerprint_ridges_2"
android:translateX="37.5835"
android:translateY="43.66685" >
<group
android:name="ridge_5" >
<path
android:name="ridge_5_path"
android:pathData="M 24.9488677979,32.3508300781 c -1.81059265137,0.338500976562 -3.58520507812,0.447387695312 -4.62879943848,0.447387695312 c -4.12730407715,0.0 -8.05894470215,-0.96842956543 -11.5207061768,-3.45275878906 c -5.33699035645,-3.830078125 -8.56369018555,-10.0885009766 -8.56369018555,-17.1589355469"
android:strokeColor="#10000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathEnd="0" />
</group>
<group
android:name="ridge_4" >
<path
android:name="ridge_7_path"
android:pathData="M -9.23379516602,40.8356933594 c -3.24549865723,-3.46032714844 -5.1540222168,-5.77195739746 -7.87710571289,-10.9068603516 c -2.76379394531,-5.21166992188 -4.04838562012,-11.3482666016 -4.04838562012,-17.6915283203 c 0.0,-11.6563720703 9.44940185547,-21.1059570312 21.1058959961,-21.1059570312 c 11.6564941406,0.0 21.1058959961,9.44958496094 21.1058959961,21.1059570312"
android:strokeColor="#10000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathEnd="0" />
</group>
<group
android:name="ridge_3" >
<path
android:name="ridge_6_path"
android:pathData="M -28.8249053955,28.5169677734 c -2.41259765625,-6.82202148438 -2.85319519043,-12.3121337891 -2.85319519043,-16.3226318359 c 0.0,-4.64868164062 0.792999267578,-9.06323242188 2.59269714355,-13.0396728516 c 4.96929931641,-10.9801025391 16.0211029053,-18.619140625 28.857208252,-18.619140625 c 17.4846954346,0.0 31.6587982178,14.1740722656 31.6587982178,31.6588134766 c 0.0,5.82824707031 -4.72470092773,10.5529785156 -10.5529022217,10.5529785156 c -5.82820129395,0.0 -10.5529937744,-4.72473144531 -10.5529937744,-10.5529785156 c 0.0,-5.82824707031 -4.72470092773,-10.5529785156 -10.5529022217,-10.5529785156 c -5.82820129395,0.0 -10.5529022217,4.72473144531 -10.5529022217,10.5529785156 c 0.0,8.17932128906 3.10879516602,15.5925292969 8.25030517578,21.0004882812 c 3.88919067383,4.09069824219 7.77758789062,6.64123535156 14.2838897705,8.52136230469"
android:strokeColor="#10000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathStart="1" />
</group>
<group
android:name="ridge_2" >
<path
android:name="ridge_2_path"
android:pathData="M -34.4861907959,-11.6943359375 c 3.78790283203,-5.64636230469 8.36389160156,-9.94665527344 14.3594970703,-13.2164306641 c 5.99560546875,-3.26977539062 12.8716125488,-5.1279296875 20.1817016602,-5.1279296875 c 7.27980041504,0.0 14.129196167,1.84289550781 20.1071014404,5.08740234375 c 5.97790527344,3.24450683594 10.7957000732,7.759765625 14.5897064209,13.3666992188"
android:strokeColor="#10000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathStart="1" />
</group>
<group
android:name="ridge_1"
android:translateX="-97.5"
android:translateY="-142.5" >
<path
android:name="ridge_1_path"
android:pathData="M 121.472564697,107.859741211 c -7.39790344238,-4.03979492188 -15.2462921143,-6.34167480469 -24.3116912842,-6.34167480469 c -9.06539916992,0.0 -16.2951049805,2.40405273438 -23.12550354,6.34167480469"
android:strokeColor="#10000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathEnd="0" />
</group>
</group>
</vector>
35 changes: 35 additions & 0 deletions res/drawable/enrollment_fingerprint_isolated_animation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/enrollment_fingerprint_isolated" >
<target
android:name="ridge_5_path"
android:animation="@anim/enrollment_fingerprint_isolated_ridge_5_path_animation" />
<target
android:name="ridge_7_path"
android:animation="@anim/enrollment_fingerprint_isolated_ridge_7_path_animation" />
<target
android:name="ridge_6_path"
android:animation="@anim/enrollment_fingerprint_isolated_ridge_6_path_animation" />
<target
android:name="ridge_2_path"
android:animation="@anim/enrollment_fingerprint_isolated_ridge_2_path_animation" />
<target
android:name="ridge_1_path"
android:animation="@anim/enrollment_fingerprint_isolated_ridge_1_path_animation" />
</animated-vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<pathInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:pathData="M 0.0,0.0 c 0.4,0.0 0.5,1.0 1.0,1.0" />
Loading

0 comments on commit 2c2a416

Please sign in to comment.