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

Commit 937ff332 authored by Curtis Belmonte's avatar Curtis Belmonte
Browse files

Update face/fingerprint consent screen UIs

Makes the following UI changes to the consent screens for face and
fingerprint enrollment:
- Sets description text in XML rather than in Java
- Highlight both primary and secondary buttons
- Use extracted highlight color for all icons

Test: Manually tested SUW flow

Bug: 188922185
Bug: 187458628
Bug: 183710943
Change-Id: I39d9b990dcbb82f443515a2175766dc51ca1180c
parent 7ca749e3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@
    style="?attr/face_layout_theme"
    android:id="@+id/setup_wizard_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    android:layout_height="match_parent"
    app:sudDescriptionText="@string/security_settings_face_enroll_introduction_message">

    <LinearLayout
        style="@style/SudContentFrame"
@@ -74,6 +75,7 @@
                android:paddingTop="24dp">

                <ImageView
                    android:id="@+id/icon_glasses"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_face_enroll_introduction_glasses"/>
@@ -99,6 +101,7 @@
                android:paddingTop="24dp">

                <ImageView
                    android:id="@+id/icon_looking"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_face_enroll_introduction_visibility"/>
@@ -124,6 +127,7 @@
                android:paddingTop="24dp">

                <ImageView
                    android:id="@+id/icon_security"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_face_enroll_introduction_shield"/>
+8 −1
Original line number Diff line number Diff line
@@ -17,10 +17,12 @@

<com.google.android.setupdesign.GlifLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    style="?attr/fingerprint_layout_theme"
    android:id="@+id/setup_wizard_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    android:layout_height="match_parent"
    app:sudDescriptionText="@string/security_settings_fingerprint_enroll_introduction_message">

    <LinearLayout
        style="@style/SudContentFrame"
@@ -71,6 +73,7 @@
                android:paddingTop="12dp">

                <ImageView
                    android:id="@+id/icon_fingerprint"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:contentDescription="@null"
@@ -91,6 +94,7 @@
                android:paddingTop="12dp">

                <ImageView
                    android:id="@+id/icon_locked"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:contentDescription="@null"
@@ -120,6 +124,7 @@
                android:paddingTop="12dp">

                <ImageView
                    android:id="@+id/icon_delete"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:contentDescription="@null"
@@ -151,6 +156,7 @@
            android:paddingTop="12dp">

            <ImageView
                android:id="@+id/icon_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@null"
@@ -171,6 +177,7 @@
            android:paddingTop="12dp">

            <ImageView
                android:id="@+id/icon_link"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@null"
+18 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.settings.biometrics;

import android.app.admin.DevicePolicyManager;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
@@ -25,6 +27,9 @@ import android.util.Log;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
@@ -34,6 +39,7 @@ import com.android.settings.password.ChooseLockSettingsHelper;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupcompat.util.WizardManagerHelper;
import com.google.android.setupdesign.span.LinkSpan;
import com.google.android.setupdesign.util.DynamicColorPalette;

/**
 * Abstract base class for the intro onboarding activity for biometric enrollment.
@@ -52,6 +58,8 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
    protected boolean mConfirmingCredentials;
    protected boolean mNextClicked;

    @Nullable private PorterDuffColorFilter mIconColorFilter;

    /**
     * @return true if the biometric is disabled by a device administrator
     */
@@ -317,4 +325,14 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
            setDescriptionText(getDescriptionResDisabledByAdmin());
        }
    }

    @NonNull
    protected PorterDuffColorFilter getIconColorFilter() {
        if (mIconColorFilter == null) {
            mIconColorFilter = new PorterDuffColorFilter(
                    DynamicColorPalette.getColor(this, DynamicColorPalette.ColorType.ACCENT),
                    PorterDuff.Mode.SRC_IN);
        }
        return mIconColorFilter;
    }
}
+11 −6
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.hardware.face.FaceManager;
import android.hardware.face.FaceSensorPropertiesInternal;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.settings.R;
@@ -69,8 +70,12 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        getLayout().setDescriptionText(getString(
                R.string.security_settings_face_enroll_introduction_message));
        final ImageView iconGlasses = findViewById(R.id.icon_glasses);
        final ImageView iconLooking = findViewById(R.id.icon_looking);
        final ImageView iconSecurity = findViewById(R.id.icon_security);
        iconGlasses.getBackground().setColorFilter(getIconColorFilter());
        iconLooking.getBackground().setColorFilter(getIconColorFilter());
        iconSecurity.getBackground().setColorFilter(getIconColorFilter());

        mFaceManager = Utils.getFaceManagerOrNull(this);
        mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
@@ -81,10 +86,10 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
                new FooterButton.Builder(this)
                        .setText(R.string.security_settings_face_enroll_introduction_no_thanks)
                        .setListener(this::onSkipButtonClick)
                        .setButtonType(FooterButton.ButtonType.SKIP)
                        .setTheme(R.style.SudGlifButton_Secondary)
                        .build()
        );
                        .setButtonType(FooterButton.ButtonType.NEXT)
                        .setTheme(R.style.SudGlifButton_Primary)
                        .build(),
                true /* usePrimaryStyle */);

        FooterButton.Builder nextButtonBuilder = new FooterButton.Builder(this)
                .setText(R.string.security_settings_face_enroll_introduction_agree)
+16 −6
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.settings.R;
@@ -58,22 +59,31 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {

        super.onCreate(savedInstanceState);

        setDescriptionText(R.string.security_settings_fingerprint_enroll_introduction_message);
        final ImageView iconFingerprint = findViewById(R.id.icon_fingerprint);
        final ImageView iconLocked = findViewById(R.id.icon_locked);
        final ImageView iconDelete = findViewById(R.id.icon_delete);
        final ImageView iconInfo = findViewById(R.id.icon_info);
        final ImageView iconLink = findViewById(R.id.icon_link);
        iconFingerprint.getDrawable().setColorFilter(getIconColorFilter());
        iconLocked.getDrawable().setColorFilter(getIconColorFilter());
        iconDelete.getDrawable().setColorFilter(getIconColorFilter());
        iconInfo.getDrawable().setColorFilter(getIconColorFilter());
        iconLink.getDrawable().setColorFilter(getIconColorFilter());

        mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
        mFooterBarMixin.setSecondaryButton(
                new FooterButton.Builder(this)
                        .setText(getNegativeButtonTextId())
                        .setListener(this::onSkipButtonClick)
                        .setButtonType(FooterButton.ButtonType.SKIP)
                        .setTheme(R.style.SudGlifButton_Secondary)
                        .build()
        );
                        .setButtonType(FooterButton.ButtonType.NEXT)
                        .setTheme(R.style.SudGlifButton_Primary)
                        .build(),
                true /* usePrimaryStyle */);

        final FooterButton nextButton = new FooterButton.Builder(this)
                .setText(R.string.security_settings_fingerprint_enroll_introduction_agree)
                .setListener(this::onNextButtonClick)
                .setButtonType(FooterButton.ButtonType.NEXT)
                .setButtonType(FooterButton.ButtonType.OPT_IN)
                .setTheme(R.style.SudGlifButton_Primary)
                .build();