Use GLIF theme for screen lock confirmation
Theme the confirm password screen similar to setup wizard and screen lock enrollment flow, so that we can start showing it during setup wizard. The new layouts are called "internal" because it's supposed to be used only when another settings screen starts it. For external intents from CONFIRM_DEVICE_CREDENTIAL, the existing theme and layout are unchanged. Bug: 32373672 Test: Run ConfirmLockPasswordTest with `am instrument` Change-Id: Ib887a763a073e6e4b96264d08846827b2e5cbf52
This commit is contained in:
@@ -114,7 +114,13 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.confirm_lock_pattern, null);
|
||||
ConfirmLockPattern activity = (ConfirmLockPattern) getActivity();
|
||||
View view = inflater.inflate(
|
||||
activity.getConfirmCredentialTheme() == ConfirmCredentialTheme.INTERNAL
|
||||
? R.layout.confirm_lock_pattern_internal
|
||||
: R.layout.confirm_lock_pattern,
|
||||
container,
|
||||
false);
|
||||
mHeaderTextView = (TextView) view.findViewById(R.id.headerText);
|
||||
mLockPatternView = (LockPatternView) view.findViewById(R.id.lockPattern);
|
||||
mDetailsTextView = (TextView) view.findViewById(R.id.detailsText);
|
||||
@@ -343,27 +349,24 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
}
|
||||
mDisappearing = true;
|
||||
|
||||
if (getActivity().getThemeResId() == R.style.Theme_ConfirmDeviceCredentialsDark) {
|
||||
final ConfirmLockPattern activity = (ConfirmLockPattern) getActivity();
|
||||
// Bail if there is no active activity.
|
||||
if (activity == null || activity.isFinishing()) {
|
||||
return;
|
||||
}
|
||||
if (activity.getConfirmCredentialTheme() == ConfirmCredentialTheme.DARK) {
|
||||
mLockPatternView.clearPattern();
|
||||
mDisappearAnimationUtils.startAnimation2d(getActiveViews(),
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Bail if there is no active activity.
|
||||
if (getActivity() == null || getActivity().isFinishing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
getActivity().setResult(RESULT_OK, intent);
|
||||
getActivity().finish();
|
||||
getActivity().overridePendingTransition(
|
||||
R.anim.confirm_credential_close_enter,
|
||||
R.anim.confirm_credential_close_exit);
|
||||
}
|
||||
() -> {
|
||||
activity.setResult(RESULT_OK, intent);
|
||||
activity.finish();
|
||||
activity.overridePendingTransition(
|
||||
R.anim.confirm_credential_close_enter,
|
||||
R.anim.confirm_credential_close_exit);
|
||||
}, this);
|
||||
} else {
|
||||
getActivity().setResult(RESULT_OK, intent);
|
||||
getActivity().finish();
|
||||
activity.setResult(RESULT_OK, intent);
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user