Merge "Update face/fingerprint consent screen UIs" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
aa5ae60a37
@@ -21,7 +21,8 @@
|
|||||||
style="?attr/face_layout_theme"
|
style="?attr/face_layout_theme"
|
||||||
android:id="@+id/setup_wizard_layout"
|
android:id="@+id/setup_wizard_layout"
|
||||||
android:layout_width="match_parent"
|
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
|
<LinearLayout
|
||||||
style="@style/SudContentFrame"
|
style="@style/SudContentFrame"
|
||||||
@@ -74,6 +75,7 @@
|
|||||||
android:paddingTop="24dp">
|
android:paddingTop="24dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_glasses"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_face_enroll_introduction_glasses"/>
|
android:background="@drawable/ic_face_enroll_introduction_glasses"/>
|
||||||
@@ -99,6 +101,7 @@
|
|||||||
android:paddingTop="24dp">
|
android:paddingTop="24dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_looking"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_face_enroll_introduction_visibility"/>
|
android:background="@drawable/ic_face_enroll_introduction_visibility"/>
|
||||||
@@ -124,6 +127,7 @@
|
|||||||
android:paddingTop="24dp">
|
android:paddingTop="24dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_security"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/ic_face_enroll_introduction_shield"/>
|
android:background="@drawable/ic_face_enroll_introduction_shield"/>
|
||||||
|
@@ -17,10 +17,12 @@
|
|||||||
|
|
||||||
<com.google.android.setupdesign.GlifLayout
|
<com.google.android.setupdesign.GlifLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
style="?attr/fingerprint_layout_theme"
|
style="?attr/fingerprint_layout_theme"
|
||||||
android:id="@+id/setup_wizard_layout"
|
android:id="@+id/setup_wizard_layout"
|
||||||
android:layout_width="match_parent"
|
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
|
<LinearLayout
|
||||||
style="@style/SudContentFrame"
|
style="@style/SudContentFrame"
|
||||||
@@ -71,6 +73,7 @@
|
|||||||
android:paddingTop="12dp">
|
android:paddingTop="12dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_fingerprint"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
@@ -91,6 +94,7 @@
|
|||||||
android:paddingTop="12dp">
|
android:paddingTop="12dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_locked"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
@@ -120,6 +124,7 @@
|
|||||||
android:paddingTop="12dp">
|
android:paddingTop="12dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_delete"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
@@ -151,6 +156,7 @@
|
|||||||
android:paddingTop="12dp">
|
android:paddingTop="12dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_info"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
@@ -171,6 +177,7 @@
|
|||||||
android:paddingTop="12dp">
|
android:paddingTop="12dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/icon_link"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
|
@@ -18,6 +18,8 @@ package com.android.settings.biometrics;
|
|||||||
|
|
||||||
import android.app.admin.DevicePolicyManager;
|
import android.app.admin.DevicePolicyManager;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffColorFilter;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
@@ -25,6 +27,9 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
import com.android.internal.widget.LockPatternUtils;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.SetupWizardUtils;
|
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.template.FooterButton;
|
||||||
import com.google.android.setupcompat.util.WizardManagerHelper;
|
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||||
import com.google.android.setupdesign.span.LinkSpan;
|
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.
|
* 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 mConfirmingCredentials;
|
||||||
protected boolean mNextClicked;
|
protected boolean mNextClicked;
|
||||||
|
|
||||||
|
@Nullable private PorterDuffColorFilter mIconColorFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the biometric is disabled by a device administrator
|
* @return true if the biometric is disabled by a device administrator
|
||||||
*/
|
*/
|
||||||
@@ -317,4 +325,14 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
|||||||
setDescriptionText(getDescriptionResDisabledByAdmin());
|
setDescriptionText(getDescriptionResDisabledByAdmin());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
protected PorterDuffColorFilter getIconColorFilter() {
|
||||||
|
if (mIconColorFilter == null) {
|
||||||
|
mIconColorFilter = new PorterDuffColorFilter(
|
||||||
|
DynamicColorPalette.getColor(this, DynamicColorPalette.ColorType.ACCENT),
|
||||||
|
PorterDuff.Mode.SRC_IN);
|
||||||
|
}
|
||||||
|
return mIconColorFilter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,6 +23,7 @@ import android.hardware.face.FaceManager;
|
|||||||
import android.hardware.face.FaceSensorPropertiesInternal;
|
import android.hardware.face.FaceSensorPropertiesInternal;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
@@ -69,8 +70,12 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
getLayout().setDescriptionText(getString(
|
final ImageView iconGlasses = findViewById(R.id.icon_glasses);
|
||||||
R.string.security_settings_face_enroll_introduction_message));
|
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);
|
mFaceManager = Utils.getFaceManagerOrNull(this);
|
||||||
mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
|
mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
|
||||||
@@ -81,10 +86,10 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
new FooterButton.Builder(this)
|
new FooterButton.Builder(this)
|
||||||
.setText(R.string.security_settings_face_enroll_introduction_no_thanks)
|
.setText(R.string.security_settings_face_enroll_introduction_no_thanks)
|
||||||
.setListener(this::onSkipButtonClick)
|
.setListener(this::onSkipButtonClick)
|
||||||
.setButtonType(FooterButton.ButtonType.SKIP)
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
.setTheme(R.style.SudGlifButton_Secondary)
|
.setTheme(R.style.SudGlifButton_Primary)
|
||||||
.build()
|
.build(),
|
||||||
);
|
true /* usePrimaryStyle */);
|
||||||
|
|
||||||
FooterButton.Builder nextButtonBuilder = new FooterButton.Builder(this)
|
FooterButton.Builder nextButtonBuilder = new FooterButton.Builder(this)
|
||||||
.setText(R.string.security_settings_face_enroll_introduction_agree)
|
.setText(R.string.security_settings_face_enroll_introduction_agree)
|
||||||
|
@@ -24,6 +24,7 @@ import android.hardware.fingerprint.FingerprintManager;
|
|||||||
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
@@ -58,22 +59,31 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
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 = getLayout().getMixin(FooterBarMixin.class);
|
||||||
mFooterBarMixin.setSecondaryButton(
|
mFooterBarMixin.setSecondaryButton(
|
||||||
new FooterButton.Builder(this)
|
new FooterButton.Builder(this)
|
||||||
.setText(getNegativeButtonTextId())
|
.setText(getNegativeButtonTextId())
|
||||||
.setListener(this::onSkipButtonClick)
|
.setListener(this::onSkipButtonClick)
|
||||||
.setButtonType(FooterButton.ButtonType.SKIP)
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
.setTheme(R.style.SudGlifButton_Secondary)
|
.setTheme(R.style.SudGlifButton_Primary)
|
||||||
.build()
|
.build(),
|
||||||
);
|
true /* usePrimaryStyle */);
|
||||||
|
|
||||||
final FooterButton nextButton = new FooterButton.Builder(this)
|
final FooterButton nextButton = new FooterButton.Builder(this)
|
||||||
.setText(R.string.security_settings_fingerprint_enroll_introduction_agree)
|
.setText(R.string.security_settings_fingerprint_enroll_introduction_agree)
|
||||||
.setListener(this::onNextButtonClick)
|
.setListener(this::onNextButtonClick)
|
||||||
.setButtonType(FooterButton.ButtonType.NEXT)
|
.setButtonType(FooterButton.ButtonType.OPT_IN)
|
||||||
.setTheme(R.style.SudGlifButton_Primary)
|
.setTheme(R.style.SudGlifButton_Primary)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user