From 9521748a77ee46a0b72b00a827e478921d685a1a Mon Sep 17 00:00:00 2001 From: sayakiitg Date: Thu, 4 Aug 2022 06:08:39 +0000 Subject: [PATCH] Update back FooterButton visibility for navigation instead of back button Bug: 201252175 Change-Id: I6c99b1173bd8ef90b89dedc49745fdb2bcf11318 (cherry picked from commit 40e436ff3bfad0c15625e8453717452178616962). Merged-In: I6c99b1173bd8ef90b89dedc49745fdb2bcf11318 --- .../deviceinfo/StorageWizardInit.java | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/com/android/settings/deviceinfo/StorageWizardInit.java b/src/com/android/settings/deviceinfo/StorageWizardInit.java index 3a0f7e61df7..962c65ca060 100644 --- a/src/com/android/settings/deviceinfo/StorageWizardInit.java +++ b/src/com/android/settings/deviceinfo/StorageWizardInit.java @@ -76,36 +76,28 @@ public class StorageWizardInit extends StorageWizardBase { } } - @Override - public void onBackPressed() { - if (mPortable) { - super.onBackPressed(); - } else { - mFlipper.showPrevious(); - setBackButtonText(R.string.wizard_back_adoptable); - setHeaderText(R.string.storage_wizard_init_v2_external_title, - getDiskShortDescription()); - setNextButtonText(R.string.storage_wizard_init_v2_external_action); - mPortable = true; - } - } - @Override public void onNavigateBack(View v) { - if (mPortable == false) { - return; - } if (!mIsPermittedToAdopt) { // TODO: Show a message about why this is disabled for guest and // that only an admin user can adopt an sd card. v.setEnabled(false); + } else if (mPortable == false) { + mFlipper.showNext(); + setHeaderText(R.string.storage_wizard_init_v2_external_title, + getDiskShortDescription()); + setNextButtonText(R.string.storage_wizard_init_v2_external_action); + setBackButtonText(R.string.wizard_back_adoptable); + setBackButtonVisibility(View.VISIBLE); + mPortable = true; } else { mFlipper.showNext(); setHeaderText(R.string.storage_wizard_init_v2_internal_title, getDiskShortDescription()); setNextButtonText(R.string.storage_wizard_init_v2_internal_action); - setBackButtonVisibility(View.INVISIBLE); + setBackButtonText(R.string.wizard_back_adoptable); + setBackButtonVisibility(View.VISIBLE); mPortable = false; } } @@ -162,4 +154,4 @@ public class StorageWizardInit extends StorageWizardBase { } return s; } -} +} \ No newline at end of file