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

Commit b21ad2da authored by Brian Isganitis's avatar Brian Isganitis
Browse files

Implement initial transient Taskbar EDU tooltips.

Since this tooltip looks and behaves differently than the existing EDU
sheet, it has its own view and controller implementations (I also may
have wanted to write some Kotlin).

To keep transient taskbar open while on the second EDU step, another
autohide suspend flag is defined. Additionally, special casing is added
to avoid hiding transient taskbar if autohiding is currently suspended.

Tooltips use the same assets as the bottom sheet for now, and are scaled
down to fit the tooltip dimensions.

Reset `Taskbar Education` in Developer Options to try EDU again.

[Demos]
- First: https://screenshot.googleplex.com/ASBeGvrb2EA5wEF.png
- Second: https://screenshot.googleplex.com/7fnfcTh9bMYezDc.png

Test: Manual
Test: Open app, see swipe-up tooltip.
Test: Swipe up to show transient taskbar, see features tooltip.
Bug: 263157739
Fix: 258460203
Change-Id: I473f5fccbae279db0614763b640da0a120b6b7f7
parent 8d98dd29
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:shape="rectangle">

    <corners android:radius="@dimen/dialogCornerRadius" />
    <solid android:color="?androidprv:attr/colorSurface" />
</shape>
 No newline at end of file
+87 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <TextView
        android:id="@+id/title"
        style="@style/TextAppearance.TaskbarEduTooltip.Title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/taskbar_edu_features"
        app:layout_constraintEnd_toEndOf="@id/suggestions_animation"
        app:layout_constraintStart_toStartOf="@id/splitscreen_animation"
        app:layout_constraintTop_toTopOf="parent" />

    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/splitscreen_animation"
        android:layout_width="@dimen/taskbar_edu_features_lottie_width"
        android:layout_height="@dimen/taskbar_edu_features_lottie_height"
        android:layout_marginTop="@dimen/taskbar_edu_tooltip_vertical_margin"
        android:scaleType="centerCrop"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/title"
        app:lottie_autoPlay="true"
        app:lottie_loop="true"
        app:lottie_rawRes="@raw/taskbar_edu_splitscreen_transient" />

    <TextView
        android:id="@+id/splitscreen_text"
        style="@style/TextAppearance.TaskbarEduTooltip.Subtext"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/taskbar_edu_splitscreen"
        app:layout_constraintEnd_toEndOf="@id/splitscreen_animation"
        app:layout_constraintStart_toStartOf="@id/splitscreen_animation"
        app:layout_constraintTop_toBottomOf="@id/splitscreen_animation" />

    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/suggestions_animation"
        android:layout_width="@dimen/taskbar_edu_features_lottie_width"
        android:layout_height="@dimen/taskbar_edu_features_lottie_height"
        android:layout_marginStart="@dimen/taskbar_edu_features_horizontal_spacing"
        android:layout_marginTop="@dimen/taskbar_edu_tooltip_vertical_margin"
        android:scaleType="centerCrop"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/splitscreen_animation"
        app:layout_constraintTop_toBottomOf="@id/title"
        app:lottie_autoPlay="true"
        app:lottie_loop="true"
        app:lottie_rawRes="@raw/taskbar_edu_suggestions_transient" />

    <TextView
        android:id="@+id/suggestions_text"
        style="@style/TextAppearance.TaskbarEduTooltip.Subtext"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/taskbar_edu_suggestions"
        app:layout_constraintEnd_toEndOf="@id/suggestions_animation"
        app:layout_constraintStart_toStartOf="@id/suggestions_animation"
        app:layout_constraintTop_toBottomOf="@id/suggestions_animation" />

    <Button
        android:id="@+id/done_button"
        style="@style/TaskbarEdu.Button.Next"
        android:layout_width="wrap_content"
        android:layout_height="36dp"
        android:layout_marginTop="32dp"
        android:text="@string/taskbar_edu_done"
        android:textColor="?androidprv:attr/textColorOnAccent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/suggestions_text" />
</merge>
 No newline at end of file
+43 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <TextView
        android:id="@+id/title"
        style="@style/TextAppearance.TaskbarEduTooltip.Title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/taskbar_edu_stashing"
        app:layout_constraintEnd_toEndOf="@id/animation"
        app:layout_constraintStart_toStartOf="@id/animation"
        app:layout_constraintTop_toTopOf="parent" />

    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/animation"
        android:layout_width="@dimen/taskbar_edu_swipe_lottie_width"
        android:layout_height="@dimen/taskbar_edu_swipe_lottie_height"
        android:layout_marginTop="@dimen/taskbar_edu_tooltip_vertical_margin"
        android:scaleType="centerCrop"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/title"
        app:lottie_autoPlay="true"
        app:lottie_loop="true"
        app:lottie_rawRes="@raw/taskbar_edu_stashing_transient" />

</merge>
 No newline at end of file
+41 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.launcher3.taskbar.TaskbarEduTooltip xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center"
    android:layout_marginBottom="16dp"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:fitsSystemWindows="true"
    android:gravity="center"
    android:orientation="vertical">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/bg_taskbar_edu_tooltip"
        android:elevation="@dimen/taskbar_edu_tooltip_elevation"
        android:paddingHorizontal="@dimen/taskbar_edu_tooltip_horizontal_margin"
        android:paddingVertical="@dimen/taskbar_edu_tooltip_vertical_margin" />

    <View
        android:id="@+id/arrow"
        android:layout_width="@dimen/popup_arrow_width"
        android:layout_height="@dimen/popup_arrow_height"
        android:elevation="@dimen/taskbar_edu_tooltip_elevation" />
</com.android.launcher3.taskbar.TaskbarEduTooltip>
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
@@ -309,6 +309,18 @@
    <dimen name="taskbar_button_margin_6_5">75dp</dimen>
    <dimen name="taskbar_button_margin_default">48dp</dimen>

    <!-- Taskbar education tooltip -->
    <dimen name="taskbar_edu_tooltip_elevation">14dp</dimen>
    <dimen name="taskbar_edu_tooltip_horizontal_margin">32dp</dimen>
    <dimen name="taskbar_edu_tooltip_vertical_margin">24dp</dimen>
    <dimen name="taskbar_edu_tooltip_enter_y_delta">20dp</dimen>
    <dimen name="taskbar_edu_tooltip_exit_y_delta">-10dp</dimen>
    <dimen name="taskbar_edu_swipe_lottie_width">348dp</dimen>
    <dimen name="taskbar_edu_swipe_lottie_height">217dp</dimen>
    <dimen name="taskbar_edu_features_lottie_width">170dp</dimen>
    <dimen name="taskbar_edu_features_lottie_height">106dp</dimen>
    <dimen name="taskbar_edu_features_horizontal_spacing">24dp</dimen>

    <!-- Recents overview -->
    <dimen name="recents_filter_icon_size">30dp</dimen>

Loading