Fix alignment of finger animation with progress bar

Makes progress bar opaque and fixes color codes accordingly, and adjusts
values to shift finger animation and progress bar for proper alignment

Test: Enroll finger in light and dark theme and observe alignment of
finger with progress bar
Fixes: 245819077
Change-Id: I26bea8e1870f08b413a4ec2a9e6e83015facd004
Merged-In: I26bea8e1870f08b413a4ec2a9e6e83015facd004
This commit is contained in:
Grace Cheng
2022-09-16 17:13:18 +00:00
parent 74a748ece8
commit 76902f4b7c
5 changed files with 15 additions and 6 deletions

View File

@@ -43,30 +43,32 @@
android:id="@+id/illustration_lottie"
android:layout_width="@dimen/fingerprint_progress_bar_max_size"
android:layout_height="@dimen/fingerprint_progress_bar_max_size"
android:layout_marginTop="@dimen/udfps_lottie_translate_y"
android:layout_marginRight="@dimen/sfps_lottie_translate_x"
android:layout_marginBottom="@dimen/sfps_lottie_translate_y"
android:scaleType="centerInside"
android:visibility="gone"
app:lottie_autoPlay="true"
app:lottie_loop="true"
android:clipChildren="false"
android:clipToPadding="false"
app:lottie_speed=".85"
android:layout_marginVertical="24dp" />
app:lottie_speed=".85" />
<com.google.android.setupdesign.view.FillContentLayout
android:layout_width="@dimen/fingerprint_progress_bar_max_size"
android:layout_height="@dimen/fingerprint_progress_bar_max_size"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_marginVertical="24dp">
android:paddingBottom="0dp">
<com.android.settings.widget.RingProgressBar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fingerprint_progress_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/sfps_progress_bar_translate_x"
android:layout_marginTop="@dimen/sfps_progress_bar_translate_y"
android:layout_gravity="center"
android:minHeight="@dimen/fingerprint_progress_bar_min_size"
android:progressBackgroundTint="@color/sfps_enrollment_progress_bar_bg_color"
android:progress="0" />
</com.google.android.setupdesign.view.FillContentLayout>

View File

@@ -53,6 +53,7 @@
<!-- Side fingerprint sensor enrollment animation colors -->
<color name="sfps_enrollment_fp_captured_color">#d2e3fc</color> <!-- Blue 100 -->
<color name="sfps_enrollment_fp_error_color">#fad2cf</color> <!-- Red 100 -->
<color name="sfps_enrollment_progress_bar_bg_color">#3C4043</color> <!-- Gray 800 -->
<color name="sfps_enrollment_progress_bar_fill_color">#669df6</color> <!-- Blue 400 -->
<color name="sfps_enrollment_progress_bar_error_color">#ee675c</color> <!-- Red 400 -->

View File

@@ -204,6 +204,7 @@
<!-- Side fingerprint sensor guided enrollment fill colors -->
<color name="sfps_enrollment_fp_captured_color">#d2e3fc</color> <!-- Blue 100 -->
<color name="sfps_enrollment_fp_error_color">#fad2cf</color> <!-- Red 100 -->
<color name="sfps_enrollment_progress_bar_bg_color">#E8EAED</color> <!-- Gray 200 -->
<color name="sfps_enrollment_progress_bar_fill_color">#1a73e8</color> <!-- Blue 600 -->
<color name="sfps_enrollment_progress_bar_error_color">#d93025</color> <!-- Red 600 -->

View File

@@ -230,6 +230,10 @@
fingerprint_finish_max_size = fingerprint_progress_bar_max_size
+ (fingerprint_enrolling_content_margin_vertical x 2) -->
<dimen name="fingerprint_finish_max_size">288dp</dimen>
<dimen name="sfps_progress_bar_translate_x">2dp</dimen>
<dimen name="sfps_progress_bar_translate_y">2dp</dimen>
<dimen name="sfps_lottie_translate_x">12dp</dimen>
<dimen name="sfps_lottie_translate_y">12dp</dimen>
<dimen name="udfps_lottie_translate_y">0dp</dimen>
<!-- Face -->

View File

@@ -316,6 +316,7 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
mFastOutLinearInInterpolator = AnimationUtils.loadInterpolator(
this, android.R.interpolator.fast_out_linear_in);
if (mProgressBar != null) {
mProgressBar.setProgressBackgroundTintMode(PorterDuff.Mode.SRC);
mProgressBar.setOnTouchListener((v, event) -> {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
mIconTouchCount++;
@@ -889,7 +890,7 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
ColorStateList fillColor = ColorStateList.valueOf(
isError ? error_color : progress_bar_fill_color);
mProgressBar.setProgressTintList(fillColor);
mProgressBar.setProgressTintMode(PorterDuff.Mode.SRC_ATOP);
mProgressBar.setProgressTintMode(PorterDuff.Mode.SRC);
mProgressBar.invalidate();
}
}