From 40cab1692d9c7a50470a25b07452cc37114adf46 Mon Sep 17 00:00:00 2001 From: danielwbhuang Date: Wed, 11 Jan 2023 04:20:45 +0800 Subject: [PATCH] Implement trackpad gestures education UI. 1. Use BottomSheetDialogFragment. 2. Use LottieAnimationView for animation 3. Add 5 animation assets Demo: go/trackpad_education_demo Bug: 247080509 Test: manual Change-Id: Icac7a6cd51763ca20b7661d6f1d4cc95af5292e9 --- res/drawable/trackpad_gesture_dialog_bg.xml | 24 ++ res/layout/gesture_tip1_go_home.xml | 62 ++++ res/layout/gesture_tip2_go_back.xml | 62 ++++ res/layout/gesture_tip3_recent_apps.xml | 62 ++++ res/layout/gesture_tip4_notifications.xml | 62 ++++ res/layout/gesture_tip5_switch_apps.xml | 62 ++++ res/layout/trackpad_gesture_preview.xml | 102 +++++++ res/raw/gesture_tip1_go_home.json | 1 + res/raw/gesture_tip2_go_back.json | 1 + res/raw/gesture_tip3_recent_apps.json | 1 + res/raw/gesture_tip4_notifications.json | 1 + res/raw/gesture_tip5_switch_apps.json | 1 + res/values/strings.xml | 30 ++ ...uchGesturesButtonPreferenceController.java | 16 +- .../TrackpadGestureDialogFragment.java | 268 ++++++++++++++++++ .../inputmethod/TrackpadSettings.java | 1 + .../TrackpadTouchGestureSettings.java | 1 + 17 files changed, 751 insertions(+), 6 deletions(-) create mode 100644 res/drawable/trackpad_gesture_dialog_bg.xml create mode 100644 res/layout/gesture_tip1_go_home.xml create mode 100644 res/layout/gesture_tip2_go_back.xml create mode 100644 res/layout/gesture_tip3_recent_apps.xml create mode 100644 res/layout/gesture_tip4_notifications.xml create mode 100644 res/layout/gesture_tip5_switch_apps.xml create mode 100644 res/layout/trackpad_gesture_preview.xml create mode 100644 res/raw/gesture_tip1_go_home.json create mode 100644 res/raw/gesture_tip2_go_back.json create mode 100644 res/raw/gesture_tip3_recent_apps.json create mode 100644 res/raw/gesture_tip4_notifications.json create mode 100644 res/raw/gesture_tip5_switch_apps.json create mode 100644 src/com/android/settings/inputmethod/TrackpadGestureDialogFragment.java diff --git a/res/drawable/trackpad_gesture_dialog_bg.xml b/res/drawable/trackpad_gesture_dialog_bg.xml new file mode 100644 index 00000000000..3f2a216b5dd --- /dev/null +++ b/res/drawable/trackpad_gesture_dialog_bg.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/res/layout/gesture_tip1_go_home.xml b/res/layout/gesture_tip1_go_home.xml new file mode 100644 index 00000000000..7f5bd4d7233 --- /dev/null +++ b/res/layout/gesture_tip1_go_home.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + diff --git a/res/layout/gesture_tip2_go_back.xml b/res/layout/gesture_tip2_go_back.xml new file mode 100644 index 00000000000..d6bce2dc160 --- /dev/null +++ b/res/layout/gesture_tip2_go_back.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + diff --git a/res/layout/gesture_tip3_recent_apps.xml b/res/layout/gesture_tip3_recent_apps.xml new file mode 100644 index 00000000000..6ce11b511d7 --- /dev/null +++ b/res/layout/gesture_tip3_recent_apps.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + diff --git a/res/layout/gesture_tip4_notifications.xml b/res/layout/gesture_tip4_notifications.xml new file mode 100644 index 00000000000..34c5e939cfa --- /dev/null +++ b/res/layout/gesture_tip4_notifications.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + diff --git a/res/layout/gesture_tip5_switch_apps.xml b/res/layout/gesture_tip5_switch_apps.xml new file mode 100644 index 00000000000..8a90d76062c --- /dev/null +++ b/res/layout/gesture_tip5_switch_apps.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + diff --git a/res/layout/trackpad_gesture_preview.xml b/res/layout/trackpad_gesture_preview.xml new file mode 100644 index 00000000000..aa227be8019 --- /dev/null +++ b/res/layout/trackpad_gesture_preview.xml @@ -0,0 +1,102 @@ + + + + + + + + + +