From 58f079b1347092f651aea0a9b3aec162515eb05d Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Tue, 2 May 2023 21:10:30 +0000 Subject: [PATCH] Better handle large display and text scaling on EDU tooltip. For large scaling configurations, the tooltip height can exceed the available space, which can truncate important content such as the "Done" button. To mitigate this issue, we should attempt to increase the width of the tooltip to hopefully free up some height due to the text taking up fewer lines. To support dynamic width, each EDU column gets an equal weight in the ConstraintLayout, but the lottie animations are still constrained to their original dimensions. If they fill the width, their aspect ratio will be maintained and we will still have height issues. Demo: https://screenshot.googleplex.com/6jV6geJFzCYtQ6v.png Test: Manual (transient and persistent) Fix: 278761297 Change-Id: I8cc0c4260caef747378954225d8635b2fb8eef52 --- quickstep/res/layout/taskbar_edu_features.xml | 66 +++++++++++-------- quickstep/res/layout/taskbar_edu_swipe.xml | 8 ++- quickstep/res/layout/taskbar_edu_tooltip.xml | 5 +- quickstep/res/values/dimens.xml | 2 + quickstep/res/values/styles.xml | 2 +- .../launcher3/taskbar/TaskbarEduTooltip.kt | 14 ++++ .../taskbar/TaskbarEduTooltipController.kt | 25 +++++-- 7 files changed, 85 insertions(+), 37 deletions(-) diff --git a/quickstep/res/layout/taskbar_edu_features.xml b/quickstep/res/layout/taskbar_edu_features.xml index 5cd7aaf7a7..efbe7f82fe 100644 --- a/quickstep/res/layout/taskbar_edu_features.xml +++ b/quickstep/res/layout/taskbar_edu_features.xml @@ -13,29 +13,36 @@ See the License for the specific language governing permissions and limitations under the License. --> - + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/splitscreen_animation"/> + app:lottie_loop="true" + + app:layout_constraintEnd_toEndOf="@id/splitscreen_text" + app:layout_constraintStart_toStartOf="@id/splitscreen_text" + app:layout_constraintTop_toBottomOf="@id/title" /> + app:lottie_rawRes="@raw/taskbar_edu_settings" + + app:layout_constraintEnd_toEndOf="@id/settings_text" + app:layout_constraintStart_toStartOf="@id/settings_text" + app:layout_constraintTop_toBottomOf="@id/title" /> + app:lottie_loop="true" + + app:layout_constraintEnd_toEndOf="@id/suggestions_text" + app:layout_constraintStart_toStartOf="@id/suggestions_text" + app:layout_constraintTop_toBottomOf="@id/title" /> - \ No newline at end of file + \ No newline at end of file diff --git a/quickstep/res/layout/taskbar_edu_swipe.xml b/quickstep/res/layout/taskbar_edu_swipe.xml index ebdfbb1e01..3f5e81919e 100644 --- a/quickstep/res/layout/taskbar_edu_swipe.xml +++ b/quickstep/res/layout/taskbar_edu_swipe.xml @@ -13,8 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. --> - + - \ No newline at end of file + \ No newline at end of file diff --git a/quickstep/res/layout/taskbar_edu_tooltip.xml b/quickstep/res/layout/taskbar_edu_tooltip.xml index 657066c108..f3da8b0d66 100644 --- a/quickstep/res/layout/taskbar_edu_tooltip.xml +++ b/quickstep/res/layout/taskbar_edu_tooltip.xml @@ -17,7 +17,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|center" - android:layout_marginBottom="16dp" + android:layout_marginHorizontal="24dp" + android:paddingBottom="16dp" android:clipChildren="false" android:clipToPadding="false" android:focusable="true" @@ -25,7 +26,7 @@ android:gravity="center" android:orientation="vertical"> - 170dp 106dp 24dp + 624dp + 428dp 300dp diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml index 6c12f11bcb..e1afb265ee 100644 --- a/quickstep/res/values/styles.xml +++ b/quickstep/res/values/styles.xml @@ -200,7 +200,7 @@ @drawable/button_taskbar_edu_colored @null 16sp - 4dp + 36dp