Rename back button to navigate up button
Also some minor wording changes. Test: Rebuild apk Bug: 219000314 Change-Id: I9e54bd5f17dd1eb4e0f8803d2c29781a49c1124d Merged-In: I9e54bd5f17dd1eb4e0f8803d2c29781a49c1124d
This commit is contained in:
@@ -71,8 +71,8 @@ public class FeatureFlagUtils {
|
||||
* Hide back key in the Settings two pane design.
|
||||
* @hide
|
||||
*/
|
||||
public static final String SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE =
|
||||
"settings_hide_secondary_page_back_button_in_two_pane";
|
||||
public static final String SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE =
|
||||
"settings_hide_second_layer_page_navigate_up_button_in_two_pane";
|
||||
|
||||
private static final Map<String, String> DEFAULT_FLAGS;
|
||||
|
||||
@@ -99,7 +99,7 @@ public class FeatureFlagUtils {
|
||||
DEFAULT_FLAGS.put(SETTINGS_APP_LANGUAGE_SELECTION, "true");
|
||||
DEFAULT_FLAGS.put(SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS, "true");
|
||||
DEFAULT_FLAGS.put(SETTINGS_APP_ALLOW_DARK_THEME_ACTIVATION_AT_BEDTIME, "false");
|
||||
DEFAULT_FLAGS.put(SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE, "true");
|
||||
DEFAULT_FLAGS.put(SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE, "true");
|
||||
}
|
||||
|
||||
private static final Set<String> PERSISTENT_FLAGS;
|
||||
@@ -109,7 +109,7 @@ public class FeatureFlagUtils {
|
||||
PERSISTENT_FLAGS.add(SETTINGS_SUPPORT_LARGE_SCREEN);
|
||||
PERSISTENT_FLAGS.add(SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS);
|
||||
PERSISTENT_FLAGS.add(SETTINGS_APP_ALLOW_DARK_THEME_ACTIVATION_AT_BEDTIME);
|
||||
PERSISTENT_FLAGS.add(SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE);
|
||||
PERSISTENT_FLAGS.add(SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,27 +51,34 @@ public class ActivityEmbeddingUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether current activity is embedded in the Settings app or not.
|
||||
* Whether the current activity is embedded in the Settings app or not.
|
||||
*
|
||||
* @param activity Activity that needs the check
|
||||
*/
|
||||
public static boolean isActivityEmbedded(Activity activity) {
|
||||
return SplitController.getInstance().isActivityEmbedded(activity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether current activity is suggested to show back button or not.
|
||||
* Whether the current activity should hide the navigate up button.
|
||||
*
|
||||
* @param activity Activity that needs the check
|
||||
* @param isSecondLayerPage indicates if the activity(page) is shown in the 2nd layer of
|
||||
* Settings app
|
||||
*/
|
||||
public static boolean shouldHideBackButton(Activity activity, boolean isSecondaryLayerPage) {
|
||||
public static boolean shouldHideNavigateUpButton(Activity activity, boolean isSecondLayerPage) {
|
||||
if (!BuildCompat.isAtLeastT()) {
|
||||
return false;
|
||||
}
|
||||
if (!isSecondaryLayerPage) {
|
||||
if (!isSecondLayerPage) {
|
||||
return false;
|
||||
}
|
||||
final String shouldHideBackButton = Settings.Global.getString(activity.getContentResolver(),
|
||||
"settings_hide_secondary_page_back_button_in_two_pane");
|
||||
final String shouldHideNavigateUpButton =
|
||||
Settings.Global.getString(activity.getContentResolver(),
|
||||
"settings_hide_second_layer_page_navigate_up_button_in_two_pane");
|
||||
|
||||
if (TextUtils.isEmpty(shouldHideBackButton)
|
||||
|| TextUtils.equals("true", shouldHideBackButton)) {
|
||||
if (TextUtils.isEmpty(shouldHideNavigateUpButton)
|
||||
|| Boolean.parseBoolean(shouldHideNavigateUpButton)) {
|
||||
return isActivityEmbedded(activity);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user