Refactoring A11y shortcut functions in Settings to use GESTURE

Properly integrating GESTURE into Settings, so that text pertaining to the gesture shortcut are displayed when appropriate.
Heavy refactoring has been done to allow for easier cleanup and expansion

Demo video: https://x20web.corp.google.com/users/jo/jonesriley/splitShortcut/a11ySettingsGestureCompat.mp4

NO_IFTTT=changes do not alter the order of the shortcuts.

Bug: 365570709
Test: atest com.android.settings.accessibility
Flag: android.provider.a11y_standalone_gesture_enabled
Change-Id: If90719763a48e3b8bc35988a1de9a352a766953b
This commit is contained in:
Riley Jones
2024-09-10 23:21:13 +00:00
parent b5aa5265ee
commit 3d4b0c5440
15 changed files with 515 additions and 414 deletions

View File

@@ -49,9 +49,14 @@ public class AccessibilityButtonFooterPreferenceController extends
public void displayPreference(PreferenceScreen screen) {
// Need to update footerPreference's data before super.displayPreference(), then it will use
// data to update related property of footerPreference.
final int titleResource = AccessibilityUtil.isGestureNavigateEnabled(mContext)
? R.string.accessibility_button_gesture_description
: R.string.accessibility_button_description;
final int titleResource;
if (android.provider.Flags.a11yStandaloneGestureEnabled()) {
titleResource = R.string.accessibility_button_description;
} else {
titleResource = AccessibilityUtil.isGestureNavigateEnabled(mContext)
? R.string.accessibility_button_gesture_description
: R.string.accessibility_button_description;
}
final CharSequence footerText = Html.fromHtml(
MessageFormat.format(mContext.getString(titleResource), 1, 2, 3),
Html.FROM_HTML_MODE_COMPACT);