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

Commit 20408073 authored by Mady Mellor's avatar Mady Mellor
Browse files

Updates to user education for large screen

- Restrict the width of the education views when
  on a large screen device
- Rather than hardcode the position / padding for
  the education views, figure it out based on where
  the view is on the screen so that it's a little
  less brittle.
- Recreate the views for theme or display size change

Test: visual - verify the user education screens
               look correct in phone and on large screen
               in both portrait & landscape
             - change display size & verify education
               is still visible & sized appropriately
Bug: 186776550
Change-Id: I1c77a810339448d61b570eb158848c15b2df96c8
parent 92b32639
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -17,7 +17,7 @@
<com.android.wm.shell.common.AlphaOptimizedButton
<com.android.wm.shell.common.AlphaOptimizedButton
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="@android:style/Widget.DeviceDefault.Button.Borderless"
    style="@android:style/Widget.DeviceDefault.Button.Borderless"
    android:id="@+id/settings_button"
    android:id="@+id/manage_button"
    android:layout_gravity="start"
    android:layout_gravity="start"
    android:layout_width="wrap_content"
    android:layout_width="wrap_content"
    android:layout_height="@dimen/bubble_manage_button_height"
    android:layout_height="@dimen/bubble_manage_button_height"
+0 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@
    android:layout_width="wrap_content"
    android:layout_width="wrap_content"
    android:paddingTop="48dp"
    android:paddingTop="48dp"
    android:paddingBottom="48dp"
    android:paddingBottom="48dp"
    android:paddingStart="@dimen/bubble_stack_user_education_side_inset"
    android:paddingEnd="16dp"
    android:paddingEnd="16dp"
    android:layout_marginEnd="24dp"
    android:layout_marginEnd="24dp"
    android:orientation="vertical"
    android:orientation="vertical"
+6 −13
Original line number Original line Diff line number Diff line
@@ -23,7 +23,6 @@
    android:clickable="true"
    android:clickable="true"
    android:paddingTop="28dp"
    android:paddingTop="28dp"
    android:paddingBottom="16dp"
    android:paddingBottom="16dp"
    android:paddingStart="@dimen/bubble_expanded_view_padding"
    android:paddingEnd="48dp"
    android:paddingEnd="48dp"
    android:layout_marginEnd="24dp"
    android:layout_marginEnd="24dp"
    android:orientation="vertical"
    android:orientation="vertical"
@@ -66,27 +65,21 @@
        android:id="@+id/button_layout"
        android:id="@+id/button_layout"
        android:orientation="horizontal" >
        android:orientation="horizontal" >


        <com.android.wm.shell.common.AlphaOptimizedButton
        <include
            style="@android:style/Widget.Material.Button.Borderless"
            layout="@layout/bubble_manage_button"
            android:id="@+id/manage"
            android:layout_gravity="start"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="true"
            android:clickable="false"
            android:text="@string/manage_bubbles_text"
            android:textColor="@android:color/system_neutral1_900"
            />
            />


        <com.android.wm.shell.common.AlphaOptimizedButton
        <com.android.wm.shell.common.AlphaOptimizedButton
            style="@android:style/Widget.Material.Button.Borderless"
            style="@android:style/Widget.DeviceDefault.Button.Borderless"
            android:id="@+id/got_it"
            android:id="@+id/got_it"
            android:layout_gravity="start"
            android:layout_gravity="start"
            android:layout_width="wrap_content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_height="@dimen/bubble_manage_button_height"
            android:focusable="true"
            android:focusable="true"
            android:text="@string/bubbles_user_education_got_it"
            android:text="@string/bubbles_user_education_got_it"
            android:textSize="@*android:dimen/text_size_body_2_material"
            android:textColor="@android:color/system_neutral1_900"
            android:textColor="@android:color/system_neutral1_900"
            android:background="@drawable/bubble_manage_btn_bg"
            />
            />
    </LinearLayout>
    </LinearLayout>
</LinearLayout>
</LinearLayout>
+2 −8
Original line number Original line Diff line number Diff line
@@ -184,14 +184,8 @@
    <dimen name="bubble_dismiss_target_padding_x">40dp</dimen>
    <dimen name="bubble_dismiss_target_padding_x">40dp</dimen>
    <dimen name="bubble_dismiss_target_padding_y">20dp</dimen>
    <dimen name="bubble_dismiss_target_padding_y">20dp</dimen>
    <dimen name="bubble_manage_menu_elevation">4dp</dimen>
    <dimen name="bubble_manage_menu_elevation">4dp</dimen>

    <!-- Size of user education views on large screens (phone is just match parent). -->
    <!-- Bubbles user education views -->
    <dimen name="bubbles_user_education_width_large_screen">400dp</dimen>
    <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">65dp</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>


    <!-- The width/height of the size compat restart button. -->
    <!-- The width/height of the size compat restart button. -->
    <dimen name="size_compat_button_size">48dp</dimen>
    <dimen name="size_compat_button_size">48dp</dimen>
+7 −0
Original line number Original line Diff line number Diff line
@@ -241,6 +241,13 @@ public class BubblePositioner {
        return mPositionRect;
        return mPositionRect;
    }
    }


    /**
     * @return a rect of the screen size.
     */
    public Rect getScreenRect() {
        return mScreenRect;
    }

    /**
    /**
     * @return the relevant insets (status bar, nav bar, cutouts). If taskbar is showing, its
     * @return the relevant insets (status bar, nav bar, cutouts). If taskbar is showing, its
     * inset is not included here.
     * inset is not included here.
Loading