Loading res/layout/choose_lock_password.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,11 @@ <com.google.android.setupdesign.GlifLayout <com.google.android.setupdesign.GlifLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto" android:id="@+id/setup_wizard_layout" android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_height="match_parent" android:icon="@drawable/ic_lock" android:icon="@drawable/ic_lock" android:importantForAutofill="noExcludeDescendants" android:importantForAutofill="noExcludeDescendants" settings:sucFooter="@layout/choose_lock_password_footer" settings:sucHeaderText="@string/lockpassword_choose_your_screen_lock_header"> settings:sucHeaderText="@string/lockpassword_choose_your_screen_lock_header"> <LinearLayout <LinearLayout Loading res/layout/choose_lock_password_footer.xmldeleted 100644 → 0 +0 −53 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2017 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- TODO: Use aapt:attr when it is fixed (b/36809755) --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/SudGlifButtonBar" android:layout_width="match_parent" android:layout_height="wrap_content"> <!-- left : skip --> <Button android:id="@+id/skip_button" style="@style/SudGlifButton.Secondary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/skip_label" android:visibility="gone" /> <!-- left : clear --> <Button android:id="@+id/clear_button" style="@style/SudGlifButton.Secondary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:text="@string/lockpassword_clear_label" /> <Space android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> <!-- right : continue --> <Button android:id="@+id/next_button" style="@style/SudGlifButton.Primary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/next_label" /> </LinearLayout> src/com/android/settings/password/ChooseLockPassword.java +31 −25 Original line number Original line Diff line number Diff line Loading @@ -47,7 +47,6 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo; import android.widget.Button; import android.widget.LinearLayout; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; import android.widget.TextView.OnEditorActionListener; Loading @@ -69,6 +68,8 @@ import com.android.settings.core.InstrumentedFragment; import com.android.settings.notification.RedactionInterstitial; import com.android.settings.notification.RedactionInterstitial; import com.android.settings.widget.ImeAwareEditText; import com.android.settings.widget.ImeAwareEditText; import com.google.android.setupcompat.item.FooterButton; import com.google.android.setupcompat.template.ButtonFooterMixin; import com.google.android.setupdesign.GlifLayout; import com.google.android.setupdesign.GlifLayout; import java.util.ArrayList; import java.util.ArrayList; Loading Loading @@ -168,8 +169,7 @@ public class ChooseLockPassword extends SettingsActivity { } } public static class ChooseLockPasswordFragment extends InstrumentedFragment public static class ChooseLockPasswordFragment extends InstrumentedFragment implements OnClickListener, OnEditorActionListener, TextWatcher, implements OnEditorActionListener, TextWatcher, SaveAndFinishWorker.Listener { SaveAndFinishWorker.Listener { private static final String KEY_FIRST_PIN = "first_pin"; private static final String KEY_FIRST_PIN = "first_pin"; private static final String KEY_UI_STAGE = "ui_stage"; private static final String KEY_UI_STAGE = "ui_stage"; private static final String KEY_CURRENT_PASSWORD = "current_password"; private static final String KEY_CURRENT_PASSWORD = "current_password"; Loading Loading @@ -210,9 +210,8 @@ public class ChooseLockPassword extends SettingsActivity { private String mFirstPin; private String mFirstPin; private RecyclerView mPasswordRestrictionView; private RecyclerView mPasswordRestrictionView; protected boolean mIsAlphaMode; protected boolean mIsAlphaMode; protected Button mSkipButton; protected FooterButton mSkipOrClearButton; private Button mClearButton; private FooterButton mNextButton; private Button mNextButton; private TextView mMessage; private TextView mMessage; private TextChangedHandler mTextChangedHandler; private TextChangedHandler mTextChangedHandler; Loading Loading @@ -408,13 +407,25 @@ public class ChooseLockPassword extends SettingsActivity { ViewGroup container = view.findViewById(R.id.password_container); ViewGroup container = view.findViewById(R.id.password_container); container.setOpticalInsets(Insets.NONE); container.setOpticalInsets(Insets.NONE); mSkipButton = view.findViewById(R.id.skip_button); final ButtonFooterMixin mixin = mLayout.getMixin(ButtonFooterMixin.class); mSkipButton.setOnClickListener(this); mixin.setSecondaryButton( mNextButton = view.findViewById(R.id.next_button); new FooterButton.Builder(getActivity()) mNextButton.setOnClickListener(this); .setText(R.string.lockpassword_clear_label) mClearButton = view.findViewById(R.id.clear_button); .setListener(this::onSkipOrClearButtonClick) mClearButton.setOnClickListener(this); .setButtonType(FooterButton.ButtonType.SKIP) .setTheme(R.style.SudGlifButton_Secondary) .build() ); mixin.setPrimaryButton( new FooterButton.Builder(getActivity()) .setText(R.string.next_label) .setListener(this::onNextButtonClick) .setButtonType(FooterButton.ButtonType.NEXT) .setTheme(R.style.SudGlifButton_Primary) .build() ); mSkipOrClearButton = mixin.getSecondaryButton(); mNextButton = mixin.getPrimaryButton(); mMessage = view.findViewById(R.id.message); mMessage = view.findViewById(R.id.message); if (mForFingerprint) { if (mForFingerprint) { Loading Loading @@ -777,19 +788,15 @@ public class ChooseLockPassword extends SettingsActivity { } } protected void setNextText(int text) { protected void setNextText(int text) { mNextButton.setText(text); mNextButton.setText(getActivity(), text); } } public void onClick(View v) { protected void onSkipOrClearButtonClick(View view) { switch (v.getId()) { case R.id.next_button: handleNext(); break; case R.id.clear_button: mPasswordEntry.setText(""); mPasswordEntry.setText(""); break; } } protected void onNextButtonClick(View view) { handleNext(); } } public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Loading Loading @@ -894,13 +901,12 @@ public class ChooseLockPassword extends SettingsActivity { mPasswordRequirementAdapter.setRequirements(messages); mPasswordRequirementAdapter.setRequirements(messages); // Enable/Disable the next button accordingly. // Enable/Disable the next button accordingly. setNextEnabled(errorCode == NO_ERROR); setNextEnabled(errorCode == NO_ERROR); mClearButton.setVisibility(View.GONE); } else { } else { // Hide password requirement view when we are just asking user to confirm the pw. // Hide password requirement view when we are just asking user to confirm the pw. mPasswordRestrictionView.setVisibility(View.GONE); mPasswordRestrictionView.setVisibility(View.GONE); setHeaderText(getString(mUiStage.getHint(mIsAlphaMode, getStageType()))); setHeaderText(getString(mUiStage.getHint(mIsAlphaMode, getStageType()))); setNextEnabled(canInput && length >= mPasswordMinLength); setNextEnabled(canInput && length >= mPasswordMinLength); mClearButton.setVisibility(toVisibility(canInput && length > 0)); mSkipOrClearButton.setVisibility(toVisibility(canInput && length > 0)); } } int message = mUiStage.getMessage(mIsAlphaMode, getStageType()); int message = mUiStage.getMessage(mIsAlphaMode, getStageType()); if (message != 0) { if (message != 0) { Loading src/com/android/settings/password/SetupChooseLockPassword.java +18 −17 Original line number Original line Diff line number Diff line Loading @@ -72,8 +72,11 @@ public class SetupChooseLockPassword extends ChooseLockPassword { public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment implements OnLockTypeSelectedListener { implements OnLockTypeSelectedListener { private static final String TAG_SKIP_SCREEN_LOCK_DIALOG = "skip_screen_lock_dialog"; @Nullable @Nullable private Button mOptionsButton; private Button mOptionsButton; private boolean mLeftButtonIsSkip; @Override @Override public void onViewCreated(View view, Bundle savedInstanceState) { public void onViewCreated(View view, Bundle savedInstanceState) { Loading @@ -92,26 +95,22 @@ public class SetupChooseLockPassword extends ChooseLockPassword { if (showOptionsButton && anyOptionsShown) { if (showOptionsButton && anyOptionsShown) { mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton.setVisibility(View.VISIBLE); mOptionsButton.setVisibility(View.VISIBLE); mOptionsButton.setOnClickListener(this); mOptionsButton.setOnClickListener((btn) -> ChooseLockTypeDialogFragment.newInstance(mUserId) .show(getChildFragmentManager(), TAG_SKIP_SCREEN_LOCK_DIALOG)); } } } } @Override @Override public void onClick(View v) { protected void onSkipOrClearButtonClick(View view) { switch (v.getId()) { if (mLeftButtonIsSkip) { case R.id.screen_lock_options: ChooseLockTypeDialogFragment.newInstance(mUserId) .show(getChildFragmentManager(), null); break; case R.id.skip_button: SetupSkipDialog dialog = SetupSkipDialog.newInstance( SetupSkipDialog dialog = SetupSkipDialog.newInstance( getActivity().getIntent() getActivity().getIntent() .getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false)); .getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false)); dialog.show(getFragmentManager()); dialog.show(getFragmentManager()); break; return; default: super.onClick(v); } } super.onSkipOrClearButtonClick(view); } } @Override @Override Loading @@ -137,9 +136,11 @@ public class SetupChooseLockPassword extends ChooseLockPassword { super.updateUi(); super.updateUi(); // Show the skip button during SUW but not during Settings > Biometric Enrollment // Show the skip button during SUW but not during Settings > Biometric Enrollment if (mUiStage == Stage.Introduction) { if (mUiStage == Stage.Introduction) { mSkipButton.setVisibility(View.VISIBLE); mSkipOrClearButton.setText(getActivity(), R.string.skip_label); mLeftButtonIsSkip = true; } else { } else { mSkipButton.setVisibility(View.GONE); mSkipOrClearButton.setText(getActivity(), R.string.lockpassword_clear_label); mLeftButtonIsSkip = false; } } if (mOptionsButton != null) { if (mOptionsButton != null) { Loading src/com/android/settings/password/SetupChooseLockPattern.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,8 @@ public class SetupChooseLockPattern extends ChooseLockPattern { public static class SetupChooseLockPatternFragment extends ChooseLockPatternFragment public static class SetupChooseLockPatternFragment extends ChooseLockPatternFragment implements ChooseLockTypeDialogFragment.OnLockTypeSelectedListener { implements ChooseLockTypeDialogFragment.OnLockTypeSelectedListener { private static final String TAG_SKIP_SCREEN_LOCK_DIALOG = "skip_screen_lock_dialog"; @Nullable @Nullable private Button mOptionsButton; private Button mOptionsButton; private boolean mLeftButtonIsSkip; private boolean mLeftButtonIsSkip; Loading @@ -69,7 +71,7 @@ public class SetupChooseLockPattern extends ChooseLockPattern { mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton.setOnClickListener((btn) -> mOptionsButton.setOnClickListener((btn) -> ChooseLockTypeDialogFragment.newInstance(mUserId) ChooseLockTypeDialogFragment.newInstance(mUserId) .show(getChildFragmentManager(), null)); .show(getChildFragmentManager(), TAG_SKIP_SCREEN_LOCK_DIALOG)); } } // Show the skip button during SUW but not during Settings > Biometric Enrollment // Show the skip button during SUW but not during Settings > Biometric Enrollment mSkipOrClearButton.setOnClickListener(this::onSkipOrClearButtonClick); mSkipOrClearButton.setOnClickListener(this::onSkipOrClearButtonClick); Loading Loading
res/layout/choose_lock_password.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,11 @@ <com.google.android.setupdesign.GlifLayout <com.google.android.setupdesign.GlifLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto" android:id="@+id/setup_wizard_layout" android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_height="match_parent" android:icon="@drawable/ic_lock" android:icon="@drawable/ic_lock" android:importantForAutofill="noExcludeDescendants" android:importantForAutofill="noExcludeDescendants" settings:sucFooter="@layout/choose_lock_password_footer" settings:sucHeaderText="@string/lockpassword_choose_your_screen_lock_header"> settings:sucHeaderText="@string/lockpassword_choose_your_screen_lock_header"> <LinearLayout <LinearLayout Loading
res/layout/choose_lock_password_footer.xmldeleted 100644 → 0 +0 −53 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2017 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- TODO: Use aapt:attr when it is fixed (b/36809755) --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/SudGlifButtonBar" android:layout_width="match_parent" android:layout_height="wrap_content"> <!-- left : skip --> <Button android:id="@+id/skip_button" style="@style/SudGlifButton.Secondary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/skip_label" android:visibility="gone" /> <!-- left : clear --> <Button android:id="@+id/clear_button" style="@style/SudGlifButton.Secondary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:text="@string/lockpassword_clear_label" /> <Space android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> <!-- right : continue --> <Button android:id="@+id/next_button" style="@style/SudGlifButton.Primary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/next_label" /> </LinearLayout>
src/com/android/settings/password/ChooseLockPassword.java +31 −25 Original line number Original line Diff line number Diff line Loading @@ -47,7 +47,6 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo; import android.widget.Button; import android.widget.LinearLayout; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.TextView; import android.widget.TextView.OnEditorActionListener; import android.widget.TextView.OnEditorActionListener; Loading @@ -69,6 +68,8 @@ import com.android.settings.core.InstrumentedFragment; import com.android.settings.notification.RedactionInterstitial; import com.android.settings.notification.RedactionInterstitial; import com.android.settings.widget.ImeAwareEditText; import com.android.settings.widget.ImeAwareEditText; import com.google.android.setupcompat.item.FooterButton; import com.google.android.setupcompat.template.ButtonFooterMixin; import com.google.android.setupdesign.GlifLayout; import com.google.android.setupdesign.GlifLayout; import java.util.ArrayList; import java.util.ArrayList; Loading Loading @@ -168,8 +169,7 @@ public class ChooseLockPassword extends SettingsActivity { } } public static class ChooseLockPasswordFragment extends InstrumentedFragment public static class ChooseLockPasswordFragment extends InstrumentedFragment implements OnClickListener, OnEditorActionListener, TextWatcher, implements OnEditorActionListener, TextWatcher, SaveAndFinishWorker.Listener { SaveAndFinishWorker.Listener { private static final String KEY_FIRST_PIN = "first_pin"; private static final String KEY_FIRST_PIN = "first_pin"; private static final String KEY_UI_STAGE = "ui_stage"; private static final String KEY_UI_STAGE = "ui_stage"; private static final String KEY_CURRENT_PASSWORD = "current_password"; private static final String KEY_CURRENT_PASSWORD = "current_password"; Loading Loading @@ -210,9 +210,8 @@ public class ChooseLockPassword extends SettingsActivity { private String mFirstPin; private String mFirstPin; private RecyclerView mPasswordRestrictionView; private RecyclerView mPasswordRestrictionView; protected boolean mIsAlphaMode; protected boolean mIsAlphaMode; protected Button mSkipButton; protected FooterButton mSkipOrClearButton; private Button mClearButton; private FooterButton mNextButton; private Button mNextButton; private TextView mMessage; private TextView mMessage; private TextChangedHandler mTextChangedHandler; private TextChangedHandler mTextChangedHandler; Loading Loading @@ -408,13 +407,25 @@ public class ChooseLockPassword extends SettingsActivity { ViewGroup container = view.findViewById(R.id.password_container); ViewGroup container = view.findViewById(R.id.password_container); container.setOpticalInsets(Insets.NONE); container.setOpticalInsets(Insets.NONE); mSkipButton = view.findViewById(R.id.skip_button); final ButtonFooterMixin mixin = mLayout.getMixin(ButtonFooterMixin.class); mSkipButton.setOnClickListener(this); mixin.setSecondaryButton( mNextButton = view.findViewById(R.id.next_button); new FooterButton.Builder(getActivity()) mNextButton.setOnClickListener(this); .setText(R.string.lockpassword_clear_label) mClearButton = view.findViewById(R.id.clear_button); .setListener(this::onSkipOrClearButtonClick) mClearButton.setOnClickListener(this); .setButtonType(FooterButton.ButtonType.SKIP) .setTheme(R.style.SudGlifButton_Secondary) .build() ); mixin.setPrimaryButton( new FooterButton.Builder(getActivity()) .setText(R.string.next_label) .setListener(this::onNextButtonClick) .setButtonType(FooterButton.ButtonType.NEXT) .setTheme(R.style.SudGlifButton_Primary) .build() ); mSkipOrClearButton = mixin.getSecondaryButton(); mNextButton = mixin.getPrimaryButton(); mMessage = view.findViewById(R.id.message); mMessage = view.findViewById(R.id.message); if (mForFingerprint) { if (mForFingerprint) { Loading Loading @@ -777,19 +788,15 @@ public class ChooseLockPassword extends SettingsActivity { } } protected void setNextText(int text) { protected void setNextText(int text) { mNextButton.setText(text); mNextButton.setText(getActivity(), text); } } public void onClick(View v) { protected void onSkipOrClearButtonClick(View view) { switch (v.getId()) { case R.id.next_button: handleNext(); break; case R.id.clear_button: mPasswordEntry.setText(""); mPasswordEntry.setText(""); break; } } protected void onNextButtonClick(View view) { handleNext(); } } public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Loading Loading @@ -894,13 +901,12 @@ public class ChooseLockPassword extends SettingsActivity { mPasswordRequirementAdapter.setRequirements(messages); mPasswordRequirementAdapter.setRequirements(messages); // Enable/Disable the next button accordingly. // Enable/Disable the next button accordingly. setNextEnabled(errorCode == NO_ERROR); setNextEnabled(errorCode == NO_ERROR); mClearButton.setVisibility(View.GONE); } else { } else { // Hide password requirement view when we are just asking user to confirm the pw. // Hide password requirement view when we are just asking user to confirm the pw. mPasswordRestrictionView.setVisibility(View.GONE); mPasswordRestrictionView.setVisibility(View.GONE); setHeaderText(getString(mUiStage.getHint(mIsAlphaMode, getStageType()))); setHeaderText(getString(mUiStage.getHint(mIsAlphaMode, getStageType()))); setNextEnabled(canInput && length >= mPasswordMinLength); setNextEnabled(canInput && length >= mPasswordMinLength); mClearButton.setVisibility(toVisibility(canInput && length > 0)); mSkipOrClearButton.setVisibility(toVisibility(canInput && length > 0)); } } int message = mUiStage.getMessage(mIsAlphaMode, getStageType()); int message = mUiStage.getMessage(mIsAlphaMode, getStageType()); if (message != 0) { if (message != 0) { Loading
src/com/android/settings/password/SetupChooseLockPassword.java +18 −17 Original line number Original line Diff line number Diff line Loading @@ -72,8 +72,11 @@ public class SetupChooseLockPassword extends ChooseLockPassword { public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment implements OnLockTypeSelectedListener { implements OnLockTypeSelectedListener { private static final String TAG_SKIP_SCREEN_LOCK_DIALOG = "skip_screen_lock_dialog"; @Nullable @Nullable private Button mOptionsButton; private Button mOptionsButton; private boolean mLeftButtonIsSkip; @Override @Override public void onViewCreated(View view, Bundle savedInstanceState) { public void onViewCreated(View view, Bundle savedInstanceState) { Loading @@ -92,26 +95,22 @@ public class SetupChooseLockPassword extends ChooseLockPassword { if (showOptionsButton && anyOptionsShown) { if (showOptionsButton && anyOptionsShown) { mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton.setVisibility(View.VISIBLE); mOptionsButton.setVisibility(View.VISIBLE); mOptionsButton.setOnClickListener(this); mOptionsButton.setOnClickListener((btn) -> ChooseLockTypeDialogFragment.newInstance(mUserId) .show(getChildFragmentManager(), TAG_SKIP_SCREEN_LOCK_DIALOG)); } } } } @Override @Override public void onClick(View v) { protected void onSkipOrClearButtonClick(View view) { switch (v.getId()) { if (mLeftButtonIsSkip) { case R.id.screen_lock_options: ChooseLockTypeDialogFragment.newInstance(mUserId) .show(getChildFragmentManager(), null); break; case R.id.skip_button: SetupSkipDialog dialog = SetupSkipDialog.newInstance( SetupSkipDialog dialog = SetupSkipDialog.newInstance( getActivity().getIntent() getActivity().getIntent() .getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false)); .getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false)); dialog.show(getFragmentManager()); dialog.show(getFragmentManager()); break; return; default: super.onClick(v); } } super.onSkipOrClearButtonClick(view); } } @Override @Override Loading @@ -137,9 +136,11 @@ public class SetupChooseLockPassword extends ChooseLockPassword { super.updateUi(); super.updateUi(); // Show the skip button during SUW but not during Settings > Biometric Enrollment // Show the skip button during SUW but not during Settings > Biometric Enrollment if (mUiStage == Stage.Introduction) { if (mUiStage == Stage.Introduction) { mSkipButton.setVisibility(View.VISIBLE); mSkipOrClearButton.setText(getActivity(), R.string.skip_label); mLeftButtonIsSkip = true; } else { } else { mSkipButton.setVisibility(View.GONE); mSkipOrClearButton.setText(getActivity(), R.string.lockpassword_clear_label); mLeftButtonIsSkip = false; } } if (mOptionsButton != null) { if (mOptionsButton != null) { Loading
src/com/android/settings/password/SetupChooseLockPattern.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,8 @@ public class SetupChooseLockPattern extends ChooseLockPattern { public static class SetupChooseLockPatternFragment extends ChooseLockPatternFragment public static class SetupChooseLockPatternFragment extends ChooseLockPatternFragment implements ChooseLockTypeDialogFragment.OnLockTypeSelectedListener { implements ChooseLockTypeDialogFragment.OnLockTypeSelectedListener { private static final String TAG_SKIP_SCREEN_LOCK_DIALOG = "skip_screen_lock_dialog"; @Nullable @Nullable private Button mOptionsButton; private Button mOptionsButton; private boolean mLeftButtonIsSkip; private boolean mLeftButtonIsSkip; Loading @@ -69,7 +71,7 @@ public class SetupChooseLockPattern extends ChooseLockPattern { mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton = view.findViewById(R.id.screen_lock_options); mOptionsButton.setOnClickListener((btn) -> mOptionsButton.setOnClickListener((btn) -> ChooseLockTypeDialogFragment.newInstance(mUserId) ChooseLockTypeDialogFragment.newInstance(mUserId) .show(getChildFragmentManager(), null)); .show(getChildFragmentManager(), TAG_SKIP_SCREEN_LOCK_DIALOG)); } } // Show the skip button during SUW but not during Settings > Biometric Enrollment // Show the skip button during SUW but not during Settings > Biometric Enrollment mSkipOrClearButton.setOnClickListener(this::onSkipOrClearButtonClick); mSkipOrClearButton.setOnClickListener(this::onSkipOrClearButtonClick); Loading