Repository navigation
Conversation
A new gesture action and Backtalk menu item, Set gestures for this app, opens the gesture list for the app with the item you're on. Each gesture there says Same as in other apps until you choose another action, and Gesture settings > Gestures for apps lists the apps with gestures of their own. Each app's choice is stored under the gesture's key followed by the app's package, and GestureShortcutMapping checks it first. The menu item is off by default, the action isn't assigned, and nothing changes until a gesture is set for an app. Backtalk's own screens always use the usual gestures, and it's hidden on watches. Fixes trypsynth#411. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks for this. I'm not going to take it, sorry. As the description says, scripts can already give a gesture another action in one app. I'd rather make that easier than add a second way to do the same thing that needs its own settings screen, menu item and changes to |
Owner
|
Sorry, I closed this by mistake. I'd already said yes in #411, and you opened it as we agreed. I'm reopening it, and I'll review it properly. I'll mostly be checking that it stays as small as you described there, especially the changes to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every gesture does the same thing in every app, and the only way to make one behave differently in a single app is a script. As proposed in #411, this lets users give any gesture another action in one app, while the gestures they don't change keep their usual action.
What changes. A new gesture action, Set gestures for this app, opens the gesture list for the app with the item you're on. The same screen is reachable from a new Backtalk menu item, Set gestures for followed by the app's name, at the end of the menu. The menu item is off by default (Customize menus > Backtalk menu), and the action isn't assigned to any gesture. Each gesture on the app's list says Same as in other apps and its usual action until you choose another, and Same as in other apps is the first choice in its action list. Use the same gestures as in other apps sets all of the app's gestures back at once. Gesture settings > Gestures for apps lists the apps with gestures of their own. While you're on the keyboard, the app's gestures don't apply, since the keyboard is its own app. Backtalk's own screens always use the usual gestures, so settings can always be reached. Fingerprint gestures and gesture sets aren't per app, and it's hidden on watches. Nothing changes until a user sets a gesture for an app. differences.md describes it.
How. Each app's choice is stored next to the gesture's own preference, under the gesture's key followed by
@app:and the package.GestureShortcutMapping.getActionKeyFromGestureIdchecks it first, so swipe and hold gestures and gesture hints follow the app too. It's one shared-preferences lookup per gesture, and the app comes from the last accessibility focus event, so nothing is read from the screen. The logic is in Backtalk's own files:AppGestures,AppGesturesFragmentandAppGestureSettingsFragment. Changes to Google's files, as described in the issue:GestureShortcutMapping: the lookup, a gesture id to preference key map, and the new action.TalkBackService: one line passing accessibility events toAppGestures.GestureController,TalkbackMenuProcessor,GestureListPreference: the new action and menu item.GesturePreferenceFragmentCompat(phone): choosing Same as in other apps removes the app's preference.Two small additions the issue didn't spell out:
GesturePreferenceFragmentCompat(phone and wear) gets an overload ofcreateBundleForFragmentArgumentsthat takes the key, title, value and actions instead of aGestureListPreference, so the app's gesture list can open the same action list; andTalkBackPreferenceFiltergets entries that hide the feature on watches.Testing.
AppGesturesTestcovers a gesture set for an app working only in that app, the app's other gestures keeping their action, an unassigned gesture, listing and removing apps with gestures, and Backtalk itself never getting gestures of its own../gradlew testPhoneDebugUnitTest :lintPhoneDebug :lintWearDebugpasses on the branch rebased on the currentmaster. I tested it on a Samsung Galaxy S24 with Android 16 and Speech Services by Google, as Backtalk Test, before rebasing on #396 and #408: gestures set for one app worked as described in #411. The rebase only had an import conflict inTalkBackService.Fixes #411.
🤖 Generated with Claude Code