Add auto advancing screens for private space setup

This includes changes for
1. To add auto avancing screens to PS setup
2. Screen to set a different Private profile lock or use existing lock
3. Success screen on setup completion
4. Shows Error screen if profile creation failed for some reason
5. Send intent towards launcher, show a Toast message to access PS from bottom of All apps and exit.

Bug: 299069146
Test: Manual setup
Change-Id: If4e5dd5a42abb11259bc40506189c7c750324139
This commit is contained in:
josephpv
2023-10-06 15:50:21 +00:00
committed by Joseph Vincent
parent 149a36a4df
commit 84944ba6f0
22 changed files with 939 additions and 24 deletions

View File

@@ -24,6 +24,7 @@ import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.navigation.fragment.NavHostFragment;
import com.android.settings.R;
@@ -49,7 +50,6 @@ public class PrivateSpaceEducation extends Fragment {
.setButtonType(FooterButton.ButtonType.NEXT)
.setTheme(com.google.android.setupdesign.R.style.SudGlifButton_Primary)
.build());
mixin.getPrimaryButtonView().setFilterTouchesWhenObscured(true);
mixin.setSecondaryButton(
new FooterButton.Builder(getContext())
.setText(R.string.privatespace_cancel_label)
@@ -59,29 +59,24 @@ public class PrivateSpaceEducation extends Fragment {
androidx.appcompat.R.style
.Base_TextAppearance_AppCompat_Widget_Button)
.build());
mixin.getSecondaryButtonView().setFilterTouchesWhenObscured(true);
return rootView;
}
private View.OnClickListener onSetup() {
return v -> {
if (PrivateSpaceMaintainer.getInstance(getContext()).createPrivateSpace()) {
finishActivity();
}
NavHostFragment.findNavController(PrivateSpaceEducation.this)
.navigate(R.id.action_education_to_auto_advance);
};
}
private View.OnClickListener onCancel() {
return v -> {
finishActivity();
Activity activity = getActivity();
if (activity != null) {
activity.finish();
}
};
}
private void finishActivity() {
Activity activity = getActivity();
if (activity != null) {
activity.finish();
}
}
}