Apply SUW theme to add/remove button in face settings
Update the button to "Set up Face Unlock" or "Delete face model" shown on the Face Unlock Settings screen to match the primary button theme used in Setup Wizard. Test: Manual Fixes: 190422391 Change-Id: Ib864cb53f366eec7d1a69c2808d7effc8a0aa05a
This commit is contained in:
@@ -22,10 +22,11 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/security_settings_face_settings_enroll_button"
|
||||
android:layout_marginStart="20dp"
|
||||
style="@style/SudGlifButton.Primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="@string/security_settings_face_settings_enroll"/>
|
||||
|
||||
</LinearLayout>
|
@@ -22,10 +22,11 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/security_settings_face_settings_remove_button"
|
||||
android:layout_marginStart="20dp"
|
||||
style="@style/SudGlifButton.Primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="@string/security_settings_face_settings_remove_face_model"/>
|
||||
|
||||
</LinearLayout>
|
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.biometrics.face;
|
||||
|
||||
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
@@ -29,6 +31,9 @@ import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.password.ChooseLockSettingsHelper;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
|
||||
import com.google.android.setupdesign.util.ButtonStyler;
|
||||
import com.google.android.setupdesign.util.PartnerStyleHelper;
|
||||
|
||||
/**
|
||||
* Preference controller that allows a user to enroll their face.
|
||||
*/
|
||||
@@ -38,6 +43,8 @@ public class FaceSettingsEnrollButtonPreferenceController extends BasePreference
|
||||
private static final String TAG = "FaceSettings/Remove";
|
||||
static final String KEY = "security_settings_face_enroll_faces_container";
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
private int mUserId;
|
||||
private byte[] mToken;
|
||||
private SettingsActivity mActivity;
|
||||
@@ -49,17 +56,22 @@ public class FaceSettingsEnrollButtonPreferenceController extends BasePreference
|
||||
this(context, KEY);
|
||||
}
|
||||
|
||||
public FaceSettingsEnrollButtonPreferenceController(Context context,
|
||||
String preferenceKey) {
|
||||
public FaceSettingsEnrollButtonPreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
|
||||
mButton = ((LayoutPreference) preference)
|
||||
.findViewById(R.id.security_settings_face_settings_enroll_button);
|
||||
mButton = ((LayoutPreference) preference).findViewById(
|
||||
R.id.security_settings_face_settings_enroll_button);
|
||||
|
||||
if (PartnerStyleHelper.shouldApplyPartnerResource(mButton)) {
|
||||
ButtonStyler.applyPartnerCustomizationPrimaryButtonStyle(mContext, mButton);
|
||||
}
|
||||
|
||||
mButton.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@@ -67,7 +79,7 @@ public class FaceSettingsEnrollButtonPreferenceController extends BasePreference
|
||||
public void onClick(View v) {
|
||||
mIsClicked = true;
|
||||
final Intent intent = new Intent();
|
||||
intent.setClassName("com.android.settings", FaceEnrollIntroduction.class.getName());
|
||||
intent.setClassName(SETTINGS_PACKAGE_NAME, FaceEnrollIntroduction.class.getName());
|
||||
intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
|
||||
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
|
||||
if (mListener != null) {
|
||||
|
@@ -39,6 +39,9 @@ import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
|
||||
import com.google.android.setupdesign.util.ButtonStyler;
|
||||
import com.google.android.setupdesign.util.PartnerStyleHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -163,6 +166,11 @@ public class FaceSettingsRemoveButtonPreferenceController extends BasePreference
|
||||
mPreference = preference;
|
||||
mButton = ((LayoutPreference) preference)
|
||||
.findViewById(R.id.security_settings_face_settings_remove_button);
|
||||
|
||||
if (PartnerStyleHelper.shouldApplyPartnerResource(mButton)) {
|
||||
ButtonStyler.applyPartnerCustomizationPrimaryButtonStyle(mContext, mButton);
|
||||
}
|
||||
|
||||
mButton.setOnClickListener(this);
|
||||
|
||||
if (!FaceSettings.isFaceHardwareDetected(mContext)) {
|
||||
|
Reference in New Issue
Block a user