Separate skip and clear button in pattern screen

So that the action performed is always the same as what the button
label says.

Test: m -j RunSettingsRoboTests
Bug: 72197171
Change-Id: Ia2a02b630a86874d002e462e41fdf676c2d27203
This commit is contained in:
Maurice Lam
2018-03-21 14:06:07 -07:00
parent f663d78436
commit e13e319e0c
3 changed files with 63 additions and 27 deletions

View File

@@ -25,7 +25,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.android.settings.R;
import com.android.settings.SetupRedactionInterstitial;
@@ -70,6 +69,17 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
ChooseLockTypeDialogFragment.newInstance(mUserId)
.show(getChildFragmentManager(), null));
}
// enable skip button only during setup wizard and not with fingerprint flow.
if (!mForFingerprint) {
Button skipButton = view.findViewById(R.id.skip_button);
skipButton.setVisibility(View.VISIBLE);
skipButton.setOnClickListener(v -> {
SetupSkipDialog dialog = SetupSkipDialog.newInstance(
getActivity().getIntent()
.getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false));
dialog.show(getFragmentManager());
});
}
return view;
}
@@ -81,16 +91,6 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
startChooseLockActivity(lock, getActivity());
}
@Override
protected void updateFooterLeftButton(Stage stage, TextView footerLeftButton) {
super.updateFooterLeftButton(stage, footerLeftButton);
// enable skip button only during setupwizard and not with fingerprint flow.
if (!mForFingerprint) {
footerLeftButton.setVisibility(View.VISIBLE);
footerLeftButton.setText(R.string.skip_label);
}
}
@Override
protected void updateStage(Stage stage) {
super.updateStage(stage);
@@ -101,14 +101,6 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
}
}
@Override
public void handleLeftButton() {
SetupSkipDialog dialog = SetupSkipDialog.newInstance(
getActivity().getIntent()
.getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false));
dialog.show(getFragmentManager());
}
@Override
protected Intent getRedactionInterstitialIntent(Context context) {
// Setup wizard's redaction interstitial is deferred to optional step. Enable that