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

Commit 58f079b1 authored by Brian Isganitis's avatar Brian Isganitis
Browse files

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
parent 46b73c23
Loading
Loading
Loading
Loading
+40 −26
Original line number Diff line number Diff line
@@ -13,29 +13,36 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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">
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/title"
        style="@style/TextAppearance.TaskbarEduTooltip.Title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:paddingBottom="@dimen/taskbar_edu_tooltip_vertical_margin"
        android:text="@string/taskbar_edu_features"

        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/splitscreen_animation"/>

    <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"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/title"

        app:lottie_autoPlay="true"
        app:lottie_loop="true" />
        app:lottie_loop="true"

        app:layout_constraintEnd_toEndOf="@id/splitscreen_text"
        app:layout_constraintStart_toStartOf="@id/splitscreen_text"
        app:layout_constraintTop_toBottomOf="@id/title" />

    <TextView
        android:id="@+id/splitscreen_text"
@@ -43,8 +50,9 @@
        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_constraintEnd_toStartOf="@id/settings_text"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/splitscreen_animation" />

    <androidx.constraintlayout.widget.Group
@@ -57,13 +65,14 @@
        android:id="@+id/settings_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"
        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_settings" />
        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" />

    <TextView
        android:id="@+id/settings_text"
@@ -71,21 +80,23 @@
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/taskbar_edu_settings_persistent"
        app:layout_constraintEnd_toEndOf="@id/settings_animation"
        app:layout_constraintStart_toStartOf="@id/settings_animation"
        android:layout_marginStart="@dimen/taskbar_edu_features_horizontal_spacing"

        app:layout_constraintEnd_toStartOf="@id/suggestions_text"
        app:layout_constraintStart_toEndOf="@id/splitscreen_text"
        app:layout_constraintTop_toBottomOf="@id/settings_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"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/settings_animation"
        app:layout_constraintTop_toBottomOf="@id/title"

        app:lottie_autoPlay="true"
        app:lottie_loop="true" />
        app:lottie_loop="true"

        app:layout_constraintEnd_toEndOf="@id/suggestions_text"
        app:layout_constraintStart_toStartOf="@id/suggestions_text"
        app:layout_constraintTop_toBottomOf="@id/title" />

    <TextView
        android:id="@+id/suggestions_text"
@@ -93,8 +104,10 @@
        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"
        android:layout_marginStart="@dimen/taskbar_edu_features_horizontal_spacing"

        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/settings_text"
        app:layout_constraintTop_toBottomOf="@id/suggestions_animation" />

    <androidx.constraintlayout.widget.Barrier
@@ -108,11 +121,12 @@
        android:id="@+id/done_button"
        style="@style/TaskbarEdu.Button.Done"
        android:layout_width="wrap_content"
        android:layout_height="36dp"
        android:layout_height="wrap_content"
        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/edu_barrier_bottom" />
</merge>
 No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
 No newline at end of file
+5 −3
Original line number Diff line number Diff line
@@ -13,8 +13,10 @@
     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">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/title"
@@ -39,4 +41,4 @@
        app:lottie_loop="true"
        app:lottie_rawRes="@raw/taskbar_edu_stashing" />

</merge>
 No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -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">

    <androidx.constraintlayout.widget.ConstraintLayout
    <FrameLayout
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
+2 −0
Original line number Diff line number Diff line
@@ -340,6 +340,8 @@
    <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>
    <dimen name="taskbar_edu_features_tooltip_width_persistent">624dp</dimen>
    <dimen name="taskbar_edu_features_tooltip_width_transient">428dp</dimen>

    <!--- Taskbar Pinning -->
    <dimen name="taskbar_pinning_popup_menu_width">300dp</dimen>
+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@
        <item name="android:background">@drawable/button_taskbar_edu_colored</item>
        <item name="android:stateListAnimator">@null</item>
        <item name="android:textSize">16sp</item>
        <item name="android:padding">4dp</item>
        <item name="android:minHeight">36dp</item>
    </style>

    <style name="TextAppearance.TaskbarEduTooltip.Title" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle">
Loading