Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a3e94b7 authored by Mady Mellor's avatar Mady Mellor
Browse files

Bubbles user education for stack & manage

Two types of education
1) highlighting the bubble when it first appears on screen (after user tap)
2) highlighting manage button when a bubble is expanded

* Both of these are added in BubbleStackView & respond to theme changes
* Prefs to save whether user has seen either education
* Simple animations in / out; we can tune them later
* Adjusts the starting position of the stack to work with user education
  positioning
* Adds a secure setting string to force user education to show for demo
  purposes.

Test: manual:

1) get bubble for first time
2) tap on flyout => flyout disappears & user education shows
3) get another update to that bubble => note that it doesn't show bc
   user education is displaying

1) get bubble for first time
2) tap on bubble => flyout disappears & user education shows
3) tap outside of the user education => user education hides

1) get bubble for first time
2) wait => after flyout disappears, user education shows
3) tap  on the bubble => user education hides & bubble expands, after
   expansion "manage" user education appears
4a) interact with content in the activity view
4b) collapse the stack (via back or tapping outside)
4c) tap on the manage button
4d) select a different bubble
=> each of 4x) should dismiss the manage button user education

Check that switching themes (and dark mode) gets the right colour for user
education backgrounds & text.

Bug: 148105621
Change-Id: I8e6401573c1ac21dfe636aa1132461fe04ce67ac
Merged-In: I8e6401573c1ac21dfe636aa1132461fe04ce67ac
parent 5b55f124
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <solid android:color="?android:attr/colorAccent"/>
    <corners
        android:radius="?android:attr/dialogCornerRadius" />
</shape>
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <solid android:color="?android:attr/colorAccent"/>
    <corners
        android:bottomRightRadius="360dp"
        android:topRightRadius="360dp" />
</shape>
 No newline at end of file
+48 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/user_education_view"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:paddingTop="48dp"
    android:paddingBottom="48dp"
    android:paddingStart="@dimen/bubble_stack_user_education_side_inset"
    android:paddingEnd="16dp"
    android:layout_marginEnd="24dp"
    android:orientation="vertical"
    android:background="@drawable/bubble_stack_user_education_bg">

    <TextView
        android:id="@+id/user_education_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingBottom="16dp"
        android:fontFamily="@*android:string/config_bodyFontFamilyMedium"
        android:maxLines="1"
        android:text="@string/bubbles_user_education_title"
        android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Headline"/>

    <TextView
        android:id="@+id/user_education_description"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/bubbles_user_education_description"
        android:fontFamily="@*android:string/config_bodyFontFamily"
        android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"/>

</LinearLayout>
+46 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<com.android.systemui.bubbles.BubbleManageEducationView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/manage_education_view"
        android:orientation="vertical"
        android:layout_height="wrap_content"
        android:layout_width="@dimen/bubbles_manage_education_width">

        <TextView
            android:id="@+id/user_education_description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="8dp"
            android:text="@string/bubbles_user_education_manage"
            android:fontFamily="@*android:string/config_bodyFontFamily"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"
            android:background="@drawable/bubble_manage_user_education_bg"
        />

        <View
            android:id="@+id/user_education_pointer"
            android:layout_width="@dimen/bubble_pointer_width"
            android:layout_height="@dimen/bubble_pointer_height"
        />

    </LinearLayout>
</com.android.systemui.bubbles.BubbleManageEducationView>
 No newline at end of file
+10 −4
Original line number Diff line number Diff line
@@ -1159,7 +1159,7 @@
    <!-- Extra padding around the dismiss target for bubbles -->
    <dimen name="bubble_dismiss_slop">16dp</dimen>
    <!-- Height of button allowing users to adjust settings for bubbles. -->
    <dimen name="bubble_settings_size">48dp</dimen>
    <dimen name="bubble_manage_button_height">48dp</dimen>
    <!-- How far, horizontally, to animate the expanded view over when animating in/out. -->
    <dimen name="bubble_expanded_animate_x_distance">100dp</dimen>
    <!-- How far, vertically, to animate the expanded view over when animating in/out. -->
@@ -1175,16 +1175,22 @@
    <!-- How far offscreen the bubble stack rests. Cuts off padding and part of icon bitmap. -->
    <dimen name="bubble_stack_offscreen">9dp</dimen>
    <!-- How far down the screen the stack starts. -->
    <dimen name="bubble_stack_starting_offset_y">96dp</dimen>
    <dimen name="bubble_stack_starting_offset_y">120dp</dimen>
    <!-- Space between the pointer triangle and the bubble expanded view -->
    <dimen name="bubble_pointer_margin">8dp</dimen>
    <!-- Height of the permission prompt shown with bubbles -->
    <dimen name="bubble_permission_height">120dp</dimen>
    <!-- Padding applied to the bubble dismiss target. Touches in this padding cause the bubbles to
         snap to the dismiss target. -->
    <dimen name="bubble_dismiss_target_padding_x">40dp</dimen>
    <dimen name="bubble_dismiss_target_padding_y">20dp</dimen>

    <!-- Bubbles user education views -->
    <dimen name="bubbles_manage_education_width">160dp</dimen>
    <!-- The inset from the top bound of the manage button to place the user education. -->
    <dimen name="bubbles_manage_education_top_inset">10dp</dimen>
    <!-- Size of padding for the user education cling, this should at minimum be larger than
        individual_bubble_size + some padding. -->
    <dimen name="bubble_stack_user_education_side_inset">72dp</dimen>

    <!-- Size of the RAT type for CellularTile -->
    <dimen name="celltile_rat_type_size">10sp</dimen>

Loading