Apply FooterButton builder
FotterButton constructor in setupcompat will be deprecated, change to use builder. Bug: 120805516 Test: RunSettingsRoboTests Change-Id: Ic84b0c91205bf3c770bc658e8eaf2626e4d7bddd
This commit is contained in:
@@ -152,21 +152,21 @@ public class EncryptionInterstitial extends SettingsActivity {
|
|||||||
|
|
||||||
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
||||||
buttonFooterMixin.setSecondaryButton(
|
buttonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(getContext())
|
||||||
getContext(),
|
.setText(R.string.encryption_interstitial_no)
|
||||||
R.string.encryption_interstitial_no,
|
.setListener(this::onNoButtonClicked)
|
||||||
this::onNoButtonClicked,
|
.setButtonType(FooterButton.ButtonType.SKIP)
|
||||||
FooterButton.ButtonType.SKIP,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
R.style.SuwGlifButton_Secondary)
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
buttonFooterMixin.setPrimaryButton(
|
buttonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(getContext())
|
||||||
getContext(),
|
.setText(R.string.encryption_interstitial_yes)
|
||||||
R.string.encryption_interstitial_yes,
|
.setListener(this::onYesButtonClicked)
|
||||||
this::onYesButtonClicked,
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
FooterButton.ButtonType.NEXT,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -419,12 +419,12 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
|
|||||||
final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
|
final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
|
||||||
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
||||||
buttonFooterMixin.setPrimaryButton(
|
buttonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(getActivity())
|
||||||
getActivity(),
|
.setText(R.string.master_clear_button_text)
|
||||||
R.string.master_clear_button_text,
|
.setListener(mInitiateListener)
|
||||||
mInitiateListener,
|
.setButtonType(ButtonType.OTHER)
|
||||||
ButtonType.OTHER,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
mInitiateButton = buttonFooterMixin.getPrimaryButton();
|
mInitiateButton = buttonFooterMixin.getPrimaryButton();
|
||||||
}
|
}
|
||||||
|
@@ -156,12 +156,12 @@ public class MasterClearConfirm extends InstrumentedFragment {
|
|||||||
|
|
||||||
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
||||||
buttonFooterMixin.setPrimaryButton(
|
buttonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(getActivity())
|
||||||
getActivity(),
|
.setText(R.string.master_clear_button_text)
|
||||||
R.string.master_clear_button_text,
|
.setListener(mFinalClickListener)
|
||||||
mFinalClickListener,
|
.setButtonType(ButtonType.OTHER)
|
||||||
ButtonType.OTHER,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -93,12 +93,12 @@ public class FaceEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
|
|
||||||
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setSecondaryButton(
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.security_settings_face_enroll_enrolling_skip)
|
||||||
R.string.security_settings_face_enroll_enrolling_skip,
|
.setListener(this::onSkipButtonClick)
|
||||||
this::onSkipButtonClick,
|
.setButtonType(FooterButton.ButtonType.SKIP)
|
||||||
FooterButton.ButtonType.SKIP,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
R.style.SuwGlifButton_Secondary)
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!getIntent().getBooleanExtra(BiometricEnrollBase.EXTRA_KEY_REQUIRE_DIVERSITY, true)) {
|
if (!getIntent().getBooleanExtra(BiometricEnrollBase.EXTRA_KEY_REQUIRE_DIVERSITY, true)) {
|
||||||
|
@@ -39,12 +39,12 @@ public class FaceEnrollFinish extends BiometricEnrollBase {
|
|||||||
|
|
||||||
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setPrimaryButton(
|
mButtonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.security_settings_face_enroll_done)
|
||||||
R.string.security_settings_face_enroll_done,
|
.setListener(this::onNextButtonClick)
|
||||||
this::onNextButtonClick,
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
FooterButton.ButtonType.NEXT,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,21 +62,21 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setSecondaryButton(
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.security_settings_face_enroll_introduction_cancel)
|
||||||
R.string.security_settings_face_enroll_introduction_cancel,
|
.setListener(this::onCancelButtonClick)
|
||||||
this::onCancelButtonClick,
|
.setButtonType(FooterButton.ButtonType.SKIP)
|
||||||
FooterButton.ButtonType.SKIP,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
R.style.SuwGlifButton_Secondary)
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
mButtonFooterMixin.setPrimaryButton(
|
mButtonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.wizard_next)
|
||||||
R.string.wizard_next,
|
.setListener(this::onNextButtonClick)
|
||||||
this::onNextButtonClick,
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
FooterButton.ButtonType.NEXT,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -139,12 +139,12 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
|||||||
|
|
||||||
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setSecondaryButton(
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.security_settings_fingerprint_enroll_enrolling_skip)
|
||||||
R.string.security_settings_fingerprint_enroll_enrolling_skip,
|
.setListener(this::onSkipButtonClick)
|
||||||
this::onSkipButtonClick,
|
.setButtonType(FooterButton.ButtonType.SKIP)
|
||||||
FooterButton.ButtonType.SKIP,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
R.style.SuwGlifButton_Secondary)
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
final LayerDrawable fingerprintDrawable = (LayerDrawable) mProgressBar.getBackground();
|
final LayerDrawable fingerprintDrawable = (LayerDrawable) mProgressBar.getBackground();
|
||||||
|
@@ -49,12 +49,12 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase {
|
|||||||
setContentView(getContentView());
|
setContentView(getContentView());
|
||||||
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setSecondaryButton(
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.skip_label)
|
||||||
R.string.skip_label,
|
.setListener(this::onSkipButtonClick)
|
||||||
this::onSkipButtonClick,
|
.setButtonType(FooterButton.ButtonType.SKIP)
|
||||||
FooterButton.ButtonType.SKIP,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
R.style.SuwGlifButton_Secondary)
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title);
|
setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title);
|
||||||
|
@@ -44,21 +44,20 @@ public class FingerprintEnrollFinish extends BiometricEnrollBase {
|
|||||||
|
|
||||||
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setSecondaryButton(
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.fingerprint_enroll_button_add)
|
||||||
R.string.fingerprint_enroll_button_add,
|
.setButtonType(FooterButton.ButtonType.SKIP)
|
||||||
null,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
FooterButton.ButtonType.SKIP,
|
.build()
|
||||||
R.style.SuwGlifButton_Secondary)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
mButtonFooterMixin.setPrimaryButton(
|
mButtonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.security_settings_fingerprint_enroll_done)
|
||||||
R.string.security_settings_fingerprint_enroll_done,
|
.setListener(this::onNextButtonClick)
|
||||||
this::onNextButtonClick,
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
FooterButton.ButtonType.NEXT,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,21 +49,21 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setSecondaryButton(
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.security_settings_face_enroll_introduction_cancel)
|
||||||
R.string.security_settings_face_enroll_introduction_cancel,
|
.setListener(this::onCancelButtonClick)
|
||||||
this::onCancelButtonClick,
|
.setButtonType(FooterButton.ButtonType.SKIP)
|
||||||
FooterButton.ButtonType.SKIP,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
R.style.SuwGlifButton_Secondary)
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
mButtonFooterMixin.setPrimaryButton(
|
mButtonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.wizard_next)
|
||||||
R.string.wizard_next,
|
.setListener(this::onNextButtonClick)
|
||||||
this::onNextButtonClick,
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
FooterButton.ButtonType.NEXT,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,20 +96,20 @@ public abstract class StorageWizardBase extends FragmentActivity {
|
|||||||
|
|
||||||
mButtonFooterMixin = getGlifLayout().getMixin(ButtonFooterMixin.class);
|
mButtonFooterMixin = getGlifLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mButtonFooterMixin.setSecondaryButton(
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.wizard_back)
|
||||||
R.string.wizard_back,
|
.setListener(this::onNavigateBack)
|
||||||
this::onNavigateBack,
|
.setButtonType(FooterButton.ButtonType.OTHER)
|
||||||
FooterButton.ButtonType.OTHER,
|
.setTheme(R.style.SuwGlifButton_Secondary)
|
||||||
R.style.SuwGlifButton_Secondary)
|
.build()
|
||||||
);
|
);
|
||||||
mButtonFooterMixin.setPrimaryButton(
|
mButtonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(this)
|
||||||
this,
|
.setText(R.string.wizard_next)
|
||||||
R.string.wizard_next,
|
.setListener(this::onNavigateNext)
|
||||||
this::onNavigateNext,
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
FooterButton.ButtonType.NEXT,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
mBack = mButtonFooterMixin.getSecondaryButton();
|
mBack = mButtonFooterMixin.getSecondaryButton();
|
||||||
mNext = mButtonFooterMixin.getPrimaryButton();
|
mNext = mButtonFooterMixin.getPrimaryButton();
|
||||||
|
@@ -135,12 +135,12 @@ public class RedactionInterstitial extends SettingsActivity {
|
|||||||
final GlifLayout layout = view.findViewById(R.id.setup_wizard_layout);
|
final GlifLayout layout = view.findViewById(R.id.setup_wizard_layout);
|
||||||
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
||||||
buttonFooterMixin.setPrimaryButton(
|
buttonFooterMixin.setPrimaryButton(
|
||||||
new FooterButton(
|
new FooterButton.Builder(getContext())
|
||||||
getContext(),
|
.setText(R.string.app_notifications_dialog_done)
|
||||||
R.string.app_notifications_dialog_done,
|
.setListener(this::onDoneButtonClicked)
|
||||||
this::onDoneButtonClicked,
|
.setButtonType(FooterButton.ButtonType.NEXT)
|
||||||
FooterButton.ButtonType.NEXT,
|
.setTheme(R.style.SuwGlifButton_Primary)
|
||||||
R.style.SuwGlifButton_Primary)
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user