Rename back button to navigate up button

A minor wording review.

Test: build pass
Bug: 219000314
Change-Id: I23bc580b193cc891b659514d13705db2c55b756a
Merged-In: I23bc580b193cc891b659514d13705db2c55b756a
This commit is contained in:
Tsung-Mao Fang
2022-02-17 20:02:29 +08:00
parent bdd37ce348
commit 00cbd72c60
5 changed files with 14 additions and 15 deletions

View File

@@ -144,8 +144,7 @@ public class SettingsActivity extends SettingsBaseActivity
public static final String EXTRA_SHOW_FRAGMENT_AS_SUBSETTING = public static final String EXTRA_SHOW_FRAGMENT_AS_SUBSETTING =
":settings:show_fragment_as_subsetting"; ":settings:show_fragment_as_subsetting";
public static final String EXTRA_IS_SECONDARY_LAYER_PAGE = public static final String EXTRA_IS_SECOND_LAYER_PAGE = ":settings:is_second_layer_page";
":settings:is_secondary_layer_page";
/** /**
* Additional extra of Settings#ACTION_SETTINGS_LARGE_SCREEN_DEEP_LINK. * Additional extra of Settings#ACTION_SETTINGS_LARGE_SCREEN_DEEP_LINK.
@@ -372,12 +371,12 @@ public class SettingsActivity extends SettingsBaseActivity
if (WizardManagerHelper.isAnySetupWizard(intent)) { if (WizardManagerHelper.isAnySetupWizard(intent)) {
return false; return false;
} }
final boolean isSecondaryLayerPage = final boolean isSecondLayerPage =
intent.getBooleanExtra(EXTRA_IS_SECONDARY_LAYER_PAGE, false); intent.getBooleanExtra(EXTRA_IS_SECOND_LAYER_PAGE, false);
// TODO: move Settings's ActivityEmbeddingUtils to SettingsLib. // TODO: move Settings's ActivityEmbeddingUtils to SettingsLib.
return !com.android.settingslib.activityembedding.ActivityEmbeddingUtils return !com.android.settingslib.activityembedding.ActivityEmbeddingUtils
.shouldHideBackButton(this, isSecondaryLayerPage); .shouldHideNavigateUpButton(this, isSecondLayerPage);
} }
private boolean isSubSettings(Intent intent) { private boolean isSubSettings(Intent intent) {

View File

@@ -197,7 +197,7 @@ public class ActivityEmbeddingRulesController {
addActivityFilter(activityFilters, Settings.class); addActivityFilter(activityFilters, Settings.class);
final Intent intent = new Intent(mContext, Settings.NetworkDashboardActivity.class); final Intent intent = new Intent(mContext, Settings.NetworkDashboardActivity.class);
intent.putExtra(SettingsActivity.EXTRA_IS_SECONDARY_LAYER_PAGE, true); intent.putExtra(SettingsActivity.EXTRA_IS_SECOND_LAYER_PAGE, true);
final SplitPlaceholderRule placeholderRule = new SplitPlaceholderRule( final SplitPlaceholderRule placeholderRule = new SplitPlaceholderRule(
activityFilters, activityFilters,
intent, intent,

View File

@@ -122,9 +122,9 @@ public class SubSettingLauncher {
return this; return this;
} }
/** Decide whether the next page is secondary layer page or not. */ /** Decide whether the next page is second layer page or not. */
public SubSettingLauncher setIsSecondaryLayerPage(boolean isSecondaryLayerPage) { public SubSettingLauncher setIsSecondLayerPage(boolean isSecondLayerPage) {
mLaunchRequest.mIsSecondaryLayerPage = isSecondaryLayerPage; mLaunchRequest.mIsSecondLayerPage = isSecondLayerPage;
return this; return this;
} }
@@ -176,8 +176,8 @@ public class SubSettingLauncher {
intent.addFlags(mLaunchRequest.mFlags); intent.addFlags(mLaunchRequest.mFlags);
intent.putExtra(SettingsBaseActivity.EXTRA_PAGE_TRANSITION_TYPE, intent.putExtra(SettingsBaseActivity.EXTRA_PAGE_TRANSITION_TYPE,
mLaunchRequest.mTransitionType); mLaunchRequest.mTransitionType);
intent.putExtra(SettingsActivity.EXTRA_IS_SECONDARY_LAYER_PAGE, intent.putExtra(SettingsActivity.EXTRA_IS_SECOND_LAYER_PAGE,
mLaunchRequest.mIsSecondaryLayerPage); mLaunchRequest.mIsSecondLayerPage);
return intent; return intent;
} }
@@ -225,6 +225,6 @@ public class SubSettingLauncher {
int mTransitionType; int mTransitionType;
Bundle mArguments; Bundle mArguments;
Bundle mExtras; Bundle mExtras;
boolean mIsSecondaryLayerPage; boolean mIsSecondLayerPage;
} }
} }

View File

@@ -52,10 +52,10 @@ public class FeatureFlagPreference extends SwitchPreference {
FeatureFlagUtils.setEnabled(getContext(), mKey, isChecked); FeatureFlagUtils.setEnabled(getContext(), mKey, isChecked);
} }
// A temporary logic for settings_hide_secondary_page_back_button_in_two_pane // A temporary logic for settings_hide_second_layer_page_navigate_up_button_in_two_pane
// Remove it before Android T release. // Remove it before Android T release.
if (TextUtils.equals(mKey, if (TextUtils.equals(mKey,
FeatureFlagUtils.SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE)) { FeatureFlagUtils.SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE)) {
Settings.Global.putString(getContext().getContentResolver(), Settings.Global.putString(getContext().getContentResolver(),
mKey, String.valueOf(isChecked)); mKey, String.valueOf(isChecked));
} }

View File

@@ -119,7 +119,7 @@ public class TopLevelSettings extends DashboardFragment implements
? ((Instrumentable) caller).getMetricsCategory() ? ((Instrumentable) caller).getMetricsCategory()
: Instrumentable.METRICS_CATEGORY_UNKNOWN) : Instrumentable.METRICS_CATEGORY_UNKNOWN)
.setTitleRes(-1) .setTitleRes(-1)
.setIsSecondaryLayerPage(true) .setIsSecondLayerPage(true)
.launch(); .launch();
return true; return true;
} }