From e6e72b68b9d7a3f2132da9408b397633d69124c4 Mon Sep 17 00:00:00 2001 From: Hyph <79437385+Hyphrio@users.noreply.github.com> Date: Sun, 8 Sep 2024 15:02:46 +0800 Subject: [PATCH] Open Recents as a gesture option (#4773) * Initial test of adding recents on gestures. * Rename * FIxes * Fix options? * surely this time! * A11y and some cleanup (this is still very ugly and needs fixing) * Update accessibility desc. * Fix strings rename * Update RecentsGestureHandler * Fix merge * Update GestureHandlerConfig.kt (fix compilation errors) * Update strings.xml * Fix build * fixed style --------- Co-authored-by: MrSluffy --- lawnchair/res/values/strings.xml | 10 ++-- .../gestures/config/GestureHandlerConfig.kt | 7 ++- .../gestures/config/GestureHandlerOption.kt | 1 + .../handlers/RecentsGestureHandler.kt | 46 +++++++++++++++++++ .../gestures/handlers/SleepGestureHandler.kt | 4 +- .../components/GestureHandlerPreference.kt | 1 + 6 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 lawnchair/src/app/lawnchair/gestures/handlers/RecentsGestureHandler.kt diff --git a/lawnchair/res/values/strings.xml b/lawnchair/res/values/strings.xml index 606840e9ee..94343b59ec 100644 --- a/lawnchair/res/values/strings.xml +++ b/lawnchair/res/values/strings.xml @@ -88,7 +88,7 @@ What to show - To lock your phone when performing a gesture, Lawnchair requires accessibility access.\n\nLawnchair doesn\'t watch any user action, though the privilege to do so is required for all accessibility services. Lawnchair discards any event sent by the system.\n\nIn order to lock your phone, Lawnchair uses the performGlobalAction Accessibility service. + To lock your phone when performing a gesture, and to open Recents via gesture, Lawnchair requires accessibility access.\n\nLawnchair doesn\'t watch any user action, though the privilege to do so is required for all accessibility services. Lawnchair discards any event sent by the system.\n\nIn order to lock your phone, or to open Recents, Lawnchair uses the performGlobalAction Accessibility service. "" @@ -435,6 +435,7 @@ Do nothing Sleep + Open Recents Open notification panel Open app Open %1$s @@ -448,9 +449,12 @@ To use Double-Tap to Sleep, set Lawnchair as a device admin app. Tap \"Open settings\", then tap \"Activate this device admin app.\" Double-Tap to Sleep will be turned off. - Turn on accessibility service + + Turn on accessibility service To use Double-Tap to Sleep, turn on the Lawnchair accessibility service. Tap \"Open settings\", select \"Lawnchair\" and turn on \"Use Lawnchair.\"\n\nLawnchair uses Accessibility\'s `performGlobalAction` method to perform this action. This is a sensitive permission that allows monitoring other apps. However, Lawnchair is not configured for that functionality and receives no events. - Open settings + Open settings + +To use Open Recents, turn on the Lawnchair accessibility service. Tap \"Open settings\", select \"Lawnchair\" and turn on \"Use Lawnchair.\"\n\nLawnchair uses Accessibility\'s `performGlobalAction` method to perform this action. This is a sensitive permission that allows monitoring other apps. However, Lawnchair is not configured for that functionality and receives no events.