Add skip button in PS account login error screen
Recording link : b/320460786#comment5 Bug: 320460786 Test: Verified skip button in shown in error screen. Change-Id: I0b3b9258ad55069c9920d7fc9fb7f17d422297f1
This commit is contained in:
@@ -31,6 +31,7 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.navigation.fragment.NavHostFragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.InstrumentedFragment;
|
||||
@@ -55,11 +56,20 @@ public class PrivateSpaceAccountLoginError extends InstrumentedFragment {
|
||||
final FooterBarMixin mixin = rootView.getMixin(FooterBarMixin.class);
|
||||
mixin.setPrimaryButton(
|
||||
new FooterButton.Builder(getContext())
|
||||
.setText(R.string.private_space_tryagain_label)
|
||||
.setText(R.string.private_space_continue_login_label)
|
||||
.setListener(nextScreen())
|
||||
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||
.setTheme(com.google.android.setupdesign.R.style.SudGlifButton_Primary)
|
||||
.build());
|
||||
mixin.setSecondaryButton(
|
||||
new FooterButton.Builder(getContext())
|
||||
.setText(R.string.private_space_skip_login_label)
|
||||
.setListener(onSkip())
|
||||
.setButtonType(FooterButton.ButtonType.CANCEL)
|
||||
.setTheme(
|
||||
androidx.appcompat.R.style
|
||||
.Base_TextAppearance_AppCompat_Widget_Button)
|
||||
.build());
|
||||
OnBackPressedCallback callback =
|
||||
new OnBackPressedCallback(true /* enabled by default */) {
|
||||
@Override
|
||||
@@ -96,4 +106,17 @@ public class PrivateSpaceAccountLoginError extends InstrumentedFragment {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private View.OnClickListener onSkip() {
|
||||
return v -> {
|
||||
mMetricsFeatureProvider.action(
|
||||
getContext(), SettingsEnums.ACTION_PRIVATE_SPACE_SETUP_SKIP_ACCOUNT_LOGIN);
|
||||
mMetricsFeatureProvider.action(
|
||||
getContext(),
|
||||
SettingsEnums.ACTION_PRIVATE_SPACE_SETUP_ACCOUNT_LOGIN_SUCCESS,
|
||||
false);
|
||||
NavHostFragment.findNavController(PrivateSpaceAccountLoginError.this)
|
||||
.navigate(R.id.action_success_fragment);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user