From f2c79dea0da80b88dac99f3d1be354412ace91bf Mon Sep 17 00:00:00 2001 From: Alina Zaidi Date: Thu, 27 May 2021 14:55:21 +0100 Subject: [PATCH] Add more education tips for widgets. (2/3) Show education dialog on WidgetsFullSheet. -Have a button in widget education dialog to intent into PixelTips apps. -Make sure arrow tip view shows after dismissing education dialog on WidgetsFullSheet if there is a widget to show it on. -Update colors and layout for arrow tips. Test: Tested manually Bug: 185354491 Change-Id: I5cbdd02fc4f19a49a42dac4451b071e3d604747f --- ...widgets_picker_surface.xml => surface.xml} | 0 ...widgets_picker_surface.xml => surface.xml} | 0 res/color/arrow_tip_view_content.xml | 2 +- res/color/button_bg.xml | 23 ++++ res/color/button_text.xml | 23 ++++ ...widgets_picker_surface.xml => surface.xml} | 0 .../widgets_bottom_sheet_background.xml | 2 +- res/drawable/add_item_dialog_background.xml | 2 +- .../arrow_toast_rounded_background.xml | 2 +- .../bg_rounded_corner_bottom_sheet.xml | 23 ++++ res/drawable/bg_widgets_searchbox.xml | 2 +- .../button_bottom_rounded_colored_ripple.xml | 32 +++++ .../button_rounded_colored_ripple.xml | 28 +++++ .../button_top_rounded_bordered_ripple.xml | 35 ++++++ .../widgets_bottom_sheet_background.xml | 2 +- res/drawable/widgets_list_bottom_ripple.xml | 4 +- res/drawable/widgets_list_middle_ripple.xml | 4 +- .../widgets_list_single_item_ripple.xml | 4 +- res/drawable/widgets_list_top_ripple.xml | 4 +- .../widgets_recommendation_background.xml | 2 +- res/layout/arrow_toast.xml | 42 ++----- res/layout/widgets_edu.xml | 66 ++++++++++ res/values-v28/dimens.xml | 19 +++ res/values/dimens.xml | 3 +- res/values/strings.xml | 9 ++ res/values/styles.xml | 15 +++ .../launcher3/AbstractFloatingView.java | 9 +- .../android/launcher3/views/ArrowTipView.java | 12 +- .../launcher3/views/WidgetsEduView.java | 118 ++++++++++++++++++ .../widget/picker/WidgetsFullSheet.java | 53 +++++++- 30 files changed, 475 insertions(+), 65 deletions(-) rename res/color-night-v31/{widgets_picker_surface.xml => surface.xml} (100%) rename res/color-v31/{widgets_picker_surface.xml => surface.xml} (100%) create mode 100644 res/color/button_bg.xml create mode 100644 res/color/button_text.xml rename res/color/{widgets_picker_surface.xml => surface.xml} (100%) create mode 100644 res/drawable/bg_rounded_corner_bottom_sheet.xml create mode 100644 res/drawable/button_bottom_rounded_colored_ripple.xml create mode 100644 res/drawable/button_rounded_colored_ripple.xml create mode 100644 res/drawable/button_top_rounded_bordered_ripple.xml create mode 100644 res/layout/widgets_edu.xml create mode 100644 res/values-v28/dimens.xml create mode 100644 src/com/android/launcher3/views/WidgetsEduView.java diff --git a/res/color-night-v31/widgets_picker_surface.xml b/res/color-night-v31/surface.xml similarity index 100% rename from res/color-night-v31/widgets_picker_surface.xml rename to res/color-night-v31/surface.xml diff --git a/res/color-v31/widgets_picker_surface.xml b/res/color-v31/surface.xml similarity index 100% rename from res/color-v31/widgets_picker_surface.xml rename to res/color-v31/surface.xml diff --git a/res/color/arrow_tip_view_content.xml b/res/color/arrow_tip_view_content.xml index 87c733e7ad..7d7f98bf3d 100644 --- a/res/color/arrow_tip_view_content.xml +++ b/res/color/arrow_tip_view_content.xml @@ -19,5 +19,5 @@ --> - + diff --git a/res/color/button_bg.xml b/res/color/button_bg.xml new file mode 100644 index 0000000000..91eed508b1 --- /dev/null +++ b/res/color/button_bg.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/res/color/button_text.xml b/res/color/button_text.xml new file mode 100644 index 0000000000..7d7f98bf3d --- /dev/null +++ b/res/color/button_text.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/res/color/widgets_picker_surface.xml b/res/color/surface.xml similarity index 100% rename from res/color/widgets_picker_surface.xml rename to res/color/surface.xml diff --git a/res/drawable-v28/widgets_bottom_sheet_background.xml b/res/drawable-v28/widgets_bottom_sheet_background.xml index c3009c3752..7fb8681301 100644 --- a/res/drawable-v28/widgets_bottom_sheet_background.xml +++ b/res/drawable-v28/widgets_bottom_sheet_background.xml @@ -16,7 +16,7 @@ --> - + - + diff --git a/res/drawable/arrow_toast_rounded_background.xml b/res/drawable/arrow_toast_rounded_background.xml index f3f2158186..1206ddd87b 100644 --- a/res/drawable/arrow_toast_rounded_background.xml +++ b/res/drawable/arrow_toast_rounded_background.xml @@ -15,5 +15,5 @@ --> - + diff --git a/res/drawable/bg_rounded_corner_bottom_sheet.xml b/res/drawable/bg_rounded_corner_bottom_sheet.xml new file mode 100644 index 0000000000..aa49bced7a --- /dev/null +++ b/res/drawable/bg_rounded_corner_bottom_sheet.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/res/drawable/bg_widgets_searchbox.xml b/res/drawable/bg_widgets_searchbox.xml index 3230ac86b2..dc6d868bd7 100644 --- a/res/drawable/bg_widgets_searchbox.xml +++ b/res/drawable/bg_widgets_searchbox.xml @@ -14,6 +14,6 @@ limitations under the License. --> - + \ No newline at end of file diff --git a/res/drawable/button_bottom_rounded_colored_ripple.xml b/res/drawable/button_bottom_rounded_colored_ripple.xml new file mode 100644 index 0000000000..95f5234089 --- /dev/null +++ b/res/drawable/button_bottom_rounded_colored_ripple.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable/button_rounded_colored_ripple.xml b/res/drawable/button_rounded_colored_ripple.xml new file mode 100644 index 0000000000..f6d689f5aa --- /dev/null +++ b/res/drawable/button_rounded_colored_ripple.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable/button_top_rounded_bordered_ripple.xml b/res/drawable/button_top_rounded_bordered_ripple.xml new file mode 100644 index 0000000000..f15a4a0c5f --- /dev/null +++ b/res/drawable/button_top_rounded_bordered_ripple.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable/widgets_bottom_sheet_background.xml b/res/drawable/widgets_bottom_sheet_background.xml index 24607678c6..b877546656 100644 --- a/res/drawable/widgets_bottom_sheet_background.xml +++ b/res/drawable/widgets_bottom_sheet_background.xml @@ -16,7 +16,7 @@ --> - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/res/layout/arrow_toast.xml b/res/layout/arrow_toast.xml index c071becb84..aee00a95ae 100644 --- a/res/layout/arrow_toast.xml +++ b/res/layout/arrow_toast.xml @@ -14,46 +14,22 @@ limitations under the License. --> - - - - - - - + android:textColor="@color/arrow_tip_view_content" + android:textSize="14sp"/> + + + + + + + + + + +