Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46817e12 authored by Beverly's avatar Beverly
Browse files

Update udfps icon on lockscreen and AOD

Use lottie to render udfps icons on AOD and lockscreen. On AOD, this
allows us to step through a dashed pattern to decrease burn-in.

On lockscreen, we use the lottie to animate the stroke width of the
icon.

Test: manual, atest SystemUITest
Bug: 178418596

Change-Id: Ie74c460c23b4283b9c6029b29b17ec9d0dd9b09f
parent d6910eff
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ android_library {
        "SystemUI-proto",
        "dagger2",
        "jsr330",
        "lottie",
    ],
    manifest: "AndroidManifest.xml",

+24 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
  -->
<com.android.systemui.biometrics.UdfpsKeyguardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/udfps_animation_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
@@ -29,8 +30,28 @@
        android:visibility="gone"/>

    <!-- Fingerprint -->
    <ImageView
        android:id="@+id/udfps_keyguard_animation_fp_view"

    <!-- AOD dashed fingerprint icon with moving dashes -->
    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/udfps_aod_fp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:scaleType="centerCrop"
        app:lottie_autoPlay="false"
        android:padding="16dp"
        app:lottie_loop="true"
        app:lottie_rawRes="@raw/udfps_aod_fp"/>

    <!-- LockScreen fingerprint icon from 0 stroke width to full width -->
    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/udfps_lockscreen_fp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:scaleType="centerCrop"
        app:lottie_autoPlay="false"
        app:lottie_loop="false"
        android:padding="16dp"
        app:lottie_rawRes="@raw/udfps_lockscreen_fp"/>
</com.android.systemui.biometrics.UdfpsKeyguardView>
+2445 −0

File added.

Preview size limit exceeded, changes collapsed.

+1017 −0

File added.

Preview size limit exceeded, changes collapsed.

+6 −1
Original line number Diff line number Diff line
@@ -74,7 +74,10 @@ abstract class UdfpsAnimationView extends FrameLayout {
        return false;
    }

    protected void updateAlpha() {
    /**
     * @return current alpha
     */
    protected int updateAlpha() {
        int alpha = calculateAlpha();
        getDrawable().setAlpha(alpha);

@@ -84,6 +87,8 @@ abstract class UdfpsAnimationView extends FrameLayout {
        } else {
            ((ViewGroup) getParent()).setVisibility(View.VISIBLE);
        }

        return alpha;
    }

    int calculateAlpha() {
Loading