Add new reminder in "Magnify with shortcut" page
Add new reminder string in "Magnify with shortcut" page when
it's under gesture navigation mode.
Reference link of screenshot:
https://drive.google.com/file/d/1uo31FZebhXKcCR8QY_WrgEPiInzARmIl/view?usp=sharing
Bug: 134645913
Test: Visual
Change-Id: Ibbaa162d4acf0fdeed8c98b2aa1d83953880e6a6
Merged-In: Ibbaa162d4acf0fdeed8c98b2aa1d83953880e6a6
diff --git a/res/values/strings.xml b/res/values/strings.xml
index b883e7a..8a6c733 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4877,6 +4877,8 @@
<string name="accessibility_tutorial_dialog_button">Got it</string>
<!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
<string name="accessibility_screen_magnification_navbar_configuration_warning">The Accessibility button is set to <xliff:g id="service" example="Select to Speak">%1$s</xliff:g>. To use magnification, touch & hold the Accessibility button, then select magnification.</string>
+ <!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
+ <string name="accessibility_screen_magnification_gesture_navigation_warning">The accessibility gesture is set to the <xliff:g id="service" example="Select to Speak">%1$s</xliff:g>. To use magnification, swipe up with two fingers from the bottom of the screen and hold. Then select magnification.</string>
<!-- Title for the preference to configure the accessibility shortcut, which uses the volume keys. [CHAR LIMIT=35] -->
<string name="accessibility_global_gesture_preference_title">Volume key shortcut</string>
<!-- Title for the preference to choose the service that is turned on and off by the accessibility shortcut. [CHAR LIMIT=35] -->
diff --git a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
index c3cb34f..b96d2b7 100644
--- a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
@@ -16,6 +16,8 @@
package com.android.settings.accessibility;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
+
import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.settings.SettingsEnums;
import android.content.ComponentName;
@@ -132,9 +134,10 @@
if (info.getComponentName().equals(assignedComponentName)) {
final CharSequence assignedServiceName = info.getResolveInfo().loadLabel(
context.getPackageManager());
- return context.getString(
- R.string.accessibility_screen_magnification_navbar_configuration_warning,
- assignedServiceName);
+ final int messageId = isGestureNavigateEnabled(context)
+ ? R.string.accessibility_screen_magnification_gesture_navigation_warning
+ : R.string.accessibility_screen_magnification_navbar_configuration_warning;
+ return context.getString(messageId, assignedServiceName);
}
}
}
@@ -158,6 +161,12 @@
return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar);
}
+ private static boolean isGestureNavigateEnabled(Context context) {
+ return context.getResources().getInteger(
+ com.android.internal.R.integer.config_navBarInteractionMode)
+ == NAV_BAR_MODE_GESTURAL;
+ }
+
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override
@@ -173,4 +182,4 @@
return isApplicable(context.getResources());
}
};
-}
+}
\ No newline at end of file