From 75ad41effa37cd16cccda3f336af990a6090d310 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Fri, 6 Mar 2020 09:52:46 -0500 Subject: [PATCH] Adds a tooltip for multiple structures Adds a tooltip (manager) to display tooltips in Controls surfaces. The manager supports the following: * The tooltip will not be shown after a certain number of times. Tracked by a Shared Pref that is passed to the TooltipManager * The tooltip will be shown pointing to a given position on screen * The tooltip can be parametrized to show the arrow pointing up (default) or down. Fixes: 150707923 Test: manual Change-Id: I70e7c38343a16ae6cd887a0fdcfa5b0f896e413e --- .../res/layout/controls_onboarding.xml | 65 +++++++ .../res/layout/controls_structure_page.xml | 13 +- packages/SystemUI/res/values/strings.xml | 3 + packages/SystemUI/res/values/styles.xml | 1 + .../src/com/android/systemui/Prefs.java | 4 +- .../systemui/controls/TooltipManager.kt | 160 ++++++++++++++++++ .../management/ControlsFavoritingActivity.kt | 75 +++++++- .../management/ManagementPageIndicator.kt | 9 + 8 files changed, 315 insertions(+), 15 deletions(-) create mode 100644 packages/SystemUI/res/layout/controls_onboarding.xml create mode 100644 packages/SystemUI/src/com/android/systemui/controls/TooltipManager.kt diff --git a/packages/SystemUI/res/layout/controls_onboarding.xml b/packages/SystemUI/res/layout/controls_onboarding.xml new file mode 100644 index 0000000000000..577a3b404472c --- /dev/null +++ b/packages/SystemUI/res/layout/controls_onboarding.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/controls_structure_page.xml b/packages/SystemUI/res/layout/controls_structure_page.xml index 2c7e1681f2e1c..047ab98eb1917 100644 --- a/packages/SystemUI/res/layout/controls_structure_page.xml +++ b/packages/SystemUI/res/layout/controls_structure_page.xml @@ -15,17 +15,10 @@ ~ limitations under the License. --> - - - - - \ No newline at end of file + android:layout_marginTop="@dimen/controls_management_list_margin"/> \ No newline at end of file diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index caf22fe16bebc..18fec29dd3cfa 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -2653,4 +2653,7 @@ Verify device PIN Enter PIN + + + Swipe to see other structures diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 125dd8f1d60cd..47709108db1b2 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -650,6 +650,7 @@