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

Commit adc16a13 authored by Kevin Chyn's avatar Kevin Chyn Committed by Automerger Merge Worker
Browse files

Merge "Add progressbar to UdfpsView" into sc-dev am: 5423a75e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13482788

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5a03d04c94feedd023d55630b32d7914bcd050bc
parents ebdab615 5423a75e
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 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.
  -->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background">
        <shape
            android:innerRadiusRatio="2.2"
            android:shape="ring"
            android:thickness="@dimen/udfps_enroll_progress_thickness"
            android:useLevel="false"
            android:tint="?android:colorControlNormal">
            <solid android:color="@*android:color/white_disabled_material" />
        </shape>
    </item>
    <item android:id="@android:id/progress">
        <rotate
            android:fromDegrees="270"
            android:pivotX="50%"
            android:pivotY="50%"
            android:toDegrees="270">
            <shape
                android:innerRadiusRatio="2.2"
                android:shape="ring"
                android:thickness="@dimen/udfps_enroll_progress_thickness"
                android:tint="?android:attr/colorControlActivated">
                <solid android:color="@android:color/white" />
            </shape>
        </rotate>
    </item>
</layer-list>
 No newline at end of file
+14 −1
Original line number Diff line number Diff line
@@ -20,4 +20,17 @@
    android:id="@+id/udfps_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    systemui:sensorTouchAreaCoefficient="0.5"/>
    systemui:sensorTouchAreaCoefficient="0.5">

    <!-- Enrollment progress bar-->
    <com.android.systemui.biometrics.UdfpsProgressBar
        android:id="@+id/progress_bar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:max="100"
        android:padding="@dimen/udfps_enroll_progress_thickness"
        android:progress="0"
        android:layout_gravity="center"
        android:visibility="gone"/>

</com.android.systemui.biometrics.UdfpsView>
+3 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,9 @@
    <!-- Y translation for credential contents when animating in -->
    <dimen name="biometric_dialog_credential_translation_offset">60dp</dimen>

    <!-- UDFPS enrollment progress bar thickness -->
    <dimen name="udfps_enroll_progress_thickness">12dp</dimen>

    <!-- Wireless Charging Animation values -->
    <dimen name="wireless_charging_dots_radius_start">0dp</dimen>
    <dimen name="wireless_charging_dots_radius_end">4dp</dimen>
+8 −0
Original line number Diff line number Diff line
@@ -765,4 +765,12 @@
        <item name="android:textSize">14sp</item>
        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
    </style>

    <style name="UdfpsProgressBarStyle"
        parent="android:style/Widget.Material.ProgressBar.Horizontal">
        <item name="android:indeterminate">false</item>
        <item name="android:max">10000</item>
        <item name="android:mirrorForRtl">false</item>
        <item name="android:progressDrawable">@drawable/udfps_progress_bar</item>
    </style>
</resources>
+3 −10
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation {
    private static final String TAG = "UdfpsAnimationEnroll";

    private static final float SHADOW_RADIUS = 5.f;
    private static final float PROGRESS_BAR_RADIUS = 140.f;

    @Nullable private RectF mSensorRect;
    @NonNull private final Paint mSensorPaint;
@@ -81,12 +82,12 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation {

    @Override
    public int getPaddingX() {
        return (int) Math.ceil(SHADOW_RADIUS);
        return (int) Math.ceil(PROGRESS_BAR_RADIUS);
    }

    @Override
    public int getPaddingY() {
        return (int) Math.ceil(SHADOW_RADIUS);
        return (int) Math.ceil(PROGRESS_BAR_RADIUS);
    }

    @Override
@@ -104,12 +105,4 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation {
    public int getOpacity() {
        return 0;
    }

    public void onEnrollmentProgress(int remaining) {
        Log.d(TAG, "Remaining: " + remaining);
    }

    public void onEnrollmentHelp() {
        Log.d(TAG, "onEnrollmentHelp");
    }
}
Loading