From ac653b983821393b3f3255929e4534157fc48e03 Mon Sep 17 00:00:00 2001 From: joshmccloskey Date: Mon, 6 May 2019 15:11:34 -0700 Subject: [PATCH] Updated Face Enroll Introduction Test: Builds. Bug: 131774204 Change-Id: Ibccd54185b9d8ffbfd2678be1c8680ffb1699425 --- .../ic_face_enroll_introduction_people.xml | 42 +++++++++ .../ic_face_enroll_introduction_shield.xml | 45 +++++++++ ...ic_face_enroll_introduction_visibility.xml | 45 +++++++++ res/layout/face_enroll_introduction.xml | 92 +++++++++++-------- res/values/strings.xml | 8 +- .../face/FaceEnrollIntroduction.java | 44 --------- 6 files changed, 192 insertions(+), 84 deletions(-) create mode 100644 res/drawable/ic_face_enroll_introduction_people.xml create mode 100644 res/drawable/ic_face_enroll_introduction_shield.xml create mode 100644 res/drawable/ic_face_enroll_introduction_visibility.xml diff --git a/res/drawable/ic_face_enroll_introduction_people.xml b/res/drawable/ic_face_enroll_introduction_people.xml new file mode 100644 index 00000000000..b452efe14fd --- /dev/null +++ b/res/drawable/ic_face_enroll_introduction_people.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable/ic_face_enroll_introduction_shield.xml b/res/drawable/ic_face_enroll_introduction_shield.xml new file mode 100644 index 00000000000..09d3909cbe1 --- /dev/null +++ b/res/drawable/ic_face_enroll_introduction_shield.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable/ic_face_enroll_introduction_visibility.xml b/res/drawable/ic_face_enroll_introduction_visibility.xml new file mode 100644 index 00000000000..04ff21f4cac --- /dev/null +++ b/res/drawable/ic_face_enroll_introduction_visibility.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/face_enroll_introduction.xml b/res/layout/face_enroll_introduction.xml index 3115bb4ca2f..535a531ba9f 100644 --- a/res/layout/face_enroll_introduction.xml +++ b/res/layout/face_enroll_introduction.xml @@ -1,6 +1,6 @@ Use your face to unlock your phone, authorize purchases, or sign in to apps - - + + + + + + Center your face in the circle diff --git a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java index 6887d51e598..a5434a9aed1 100644 --- a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java +++ b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java @@ -23,9 +23,6 @@ import android.content.Intent; import android.hardware.face.FaceManager; import android.os.Bundle; import android.text.TextUtils; -import android.view.View; -import android.widget.Button; -import android.widget.CompoundButton; import android.widget.TextView; import com.android.settings.R; @@ -38,51 +35,18 @@ import com.google.android.setupcompat.template.FooterBarMixin; 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.view.IllustrationVideoView; public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { private static final String TAG = "FaceIntro"; private FaceManager mFaceManager; - private FaceEnrollAccessibilityToggle mSwitchDiversity; - - private IllustrationVideoView mIllustrationNormal; - private View mIllustrationAccessibility; - - private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener = - new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (isChecked) { - mIllustrationNormal.stop(); - mIllustrationNormal.setVisibility(View.INVISIBLE); - mIllustrationAccessibility.setVisibility(View.VISIBLE); - } else { - mIllustrationNormal.setVisibility(View.VISIBLE); - mIllustrationNormal.start(); - mIllustrationAccessibility.setVisibility(View.INVISIBLE); - } - } - }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mFaceManager = Utils.getFaceManagerOrNull(this); - final Button accessibilityButton = findViewById(R.id.accessibility_button); - accessibilityButton.setOnClickListener(view -> { - mSwitchDiversity.setChecked(true); - accessibilityButton.setVisibility(View.GONE); - mSwitchDiversity.setVisibility(View.VISIBLE); - }); - - mSwitchDiversity = findViewById(R.id.toggle_diversity); - mSwitchDiversity.setListener(mSwitchDiversityListener); - - mIllustrationNormal = findViewById(R.id.illustration_normal); - mIllustrationAccessibility = findViewById(R.id.illustration_accessibility); mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class); if (WizardManagerHelper.isAnySetupWizard(getIntent())) { @@ -115,13 +79,6 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { ); } - @Override - protected void onResume() { - super.onResume(); - mSwitchDiversityListener.onCheckedChanged(mSwitchDiversity.getSwitch(), - mSwitchDiversity.isChecked()); - } - @Override protected boolean isDisabledByAdmin() { return RestrictedLockUtilsInternal.checkIfKeyguardFeaturesDisabled( @@ -209,7 +166,6 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { } else { intent.setClass(this, FaceEnrollEnrolling.class); } - intent.putExtra(EXTRA_KEY_REQUIRE_DIVERSITY, !mSwitchDiversity.isChecked()); WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent); return intent; }