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
|
<Button
|
||||||
android:id="@+id/security_settings_face_settings_enroll_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_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
android:text="@string/security_settings_face_settings_enroll"/>
|
android:text="@string/security_settings_face_settings_enroll"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@@ -22,10 +22,11 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/security_settings_face_settings_remove_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_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
android:text="@string/security_settings_face_settings_remove_face_model"/>
|
android:text="@string/security_settings_face_settings_remove_face_model"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.biometrics.face;
|
package com.android.settings.biometrics.face;
|
||||||
|
|
||||||
|
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -29,6 +31,9 @@ import com.android.settings.core.BasePreferenceController;
|
|||||||
import com.android.settings.password.ChooseLockSettingsHelper;
|
import com.android.settings.password.ChooseLockSettingsHelper;
|
||||||
import com.android.settingslib.widget.LayoutPreference;
|
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.
|
* 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";
|
private static final String TAG = "FaceSettings/Remove";
|
||||||
static final String KEY = "security_settings_face_enroll_faces_container";
|
static final String KEY = "security_settings_face_enroll_faces_container";
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
|
||||||
private int mUserId;
|
private int mUserId;
|
||||||
private byte[] mToken;
|
private byte[] mToken;
|
||||||
private SettingsActivity mActivity;
|
private SettingsActivity mActivity;
|
||||||
@@ -49,17 +56,22 @@ public class FaceSettingsEnrollButtonPreferenceController extends BasePreference
|
|||||||
this(context, KEY);
|
this(context, KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FaceSettingsEnrollButtonPreferenceController(Context context,
|
public FaceSettingsEnrollButtonPreferenceController(Context context, String preferenceKey) {
|
||||||
String preferenceKey) {
|
|
||||||
super(context, preferenceKey);
|
super(context, preferenceKey);
|
||||||
|
mContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateState(Preference preference) {
|
public void updateState(Preference preference) {
|
||||||
super.updateState(preference);
|
super.updateState(preference);
|
||||||
|
|
||||||
mButton = ((LayoutPreference) preference)
|
mButton = ((LayoutPreference) preference).findViewById(
|
||||||
.findViewById(R.id.security_settings_face_settings_enroll_button);
|
R.id.security_settings_face_settings_enroll_button);
|
||||||
|
|
||||||
|
if (PartnerStyleHelper.shouldApplyPartnerResource(mButton)) {
|
||||||
|
ButtonStyler.applyPartnerCustomizationPrimaryButtonStyle(mContext, mButton);
|
||||||
|
}
|
||||||
|
|
||||||
mButton.setOnClickListener(this);
|
mButton.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +79,7 @@ public class FaceSettingsEnrollButtonPreferenceController extends BasePreference
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mIsClicked = true;
|
mIsClicked = true;
|
||||||
final Intent intent = new Intent();
|
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(Intent.EXTRA_USER_ID, mUserId);
|
||||||
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
|
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
@@ -39,6 +39,9 @@ import com.android.settings.overlay.FeatureFactory;
|
|||||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||||
import com.android.settingslib.widget.LayoutPreference;
|
import com.android.settingslib.widget.LayoutPreference;
|
||||||
|
|
||||||
|
import com.google.android.setupdesign.util.ButtonStyler;
|
||||||
|
import com.google.android.setupdesign.util.PartnerStyleHelper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,6 +166,11 @@ public class FaceSettingsRemoveButtonPreferenceController extends BasePreference
|
|||||||
mPreference = preference;
|
mPreference = preference;
|
||||||
mButton = ((LayoutPreference) preference)
|
mButton = ((LayoutPreference) preference)
|
||||||
.findViewById(R.id.security_settings_face_settings_remove_button);
|
.findViewById(R.id.security_settings_face_settings_remove_button);
|
||||||
|
|
||||||
|
if (PartnerStyleHelper.shouldApplyPartnerResource(mButton)) {
|
||||||
|
ButtonStyler.applyPartnerCustomizationPrimaryButtonStyle(mContext, mButton);
|
||||||
|
}
|
||||||
|
|
||||||
mButton.setOnClickListener(this);
|
mButton.setOnClickListener(this);
|
||||||
|
|
||||||
if (!FaceSettings.isFaceHardwareDetected(mContext)) {
|
if (!FaceSettings.isFaceHardwareDetected(mContext)) {
|
||||||
|
Reference in New Issue
Block a user