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

Commit bf5b7b2d authored by tomnatan's avatar tomnatan
Browse files

[5/n] Letterbox Education: update the dialog layout.

In addition, remove the overlay layout and include it in the dialog
layout as the background of the top-level layout (renamed as dimmer).

Test: N/A
Bug: 207010227
Change-Id: I658e85378ec266c4260b520b5fcdddbfb66b35c6
parent eafc7435
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -14,11 +14,8 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:alpha="0"
    android:background="@android:color/system_neutral1_900"
    android:clickable="true">
</FrameLayout>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <solid android:color="@color/compat_controls_background"/>
    <corners android:radius="@dimen/letterbox_education_dialog_corner_radius"/>
</shape>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -16,6 +16,6 @@
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <solid android:color="@android:color/system_accent1_100"/>
    <solid android:color="@color/letterbox_education_accent_primary"/>
    <corners android:radius="12dp"/>
</shape>
 No newline at end of file
+1 −2
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<!-- DO NOT SUBMIT - find right color!! -->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="@android:color/system_accent1_10">
    <item android:drawable="@drawable/letterbox_education_dismiss_background"/>
    <item android:drawable="@drawable/letterbox_education_dismiss_button_background"/>
</ripple>
 No newline at end of file
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="@dimen/letterbox_education_dialog_icon_size"
        android:height="@dimen/letterbox_education_dialog_icon_size"
        android:viewportWidth="48"
        android:viewportHeight="48">
    <path
        android:fillColor="@color/letterbox_education_accent_primary"
        android:fillType="evenOdd"
        android:pathData="M2 8C0.895431 8 0 8.89543 0 10V38C0 39.1046 0.895431 40 2 40H46C47.1046 40 48 39.1046 48 38V10C48 8.89543 47.1046 8 46 8H2ZM44 12H4V36H44V12Z" />
    <path
        android:fillColor="@color/letterbox_education_accent_primary"
        android:pathData="M 17 14 L 31 14 Q 32 14 32 15 L 32 33 Q 32 34 31 34 L 17 34 Q 16 34 16 33 L 16 15 Q 16 14 17 14 Z" />
</vector>
 No newline at end of file
+30 −29
Original line number Diff line number Diff line
@@ -13,30 +13,31 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<com.android.wm.shell.compatui.LetterboxEduDialogLayout
<com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogLayout
    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"
    android:background="@color/compat_controls_background"
    android:gravity="center"
    android:paddingTop="24dp"
    android:paddingBottom="32dp"
    android:paddingHorizontal="32dp">
    android:background="@android:color/system_neutral1_900">

    <!-- The background of the top-level layout acts as the background dim. -->

    <!-- Adding an extra layer to animate the alpha of the background and content separately. -->
    <LinearLayout
        android:id="@+id/letterbox_education_content"
        android:id="@+id/letterbox_education_dialog_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center_horizontal"
        android:orientation="vertical">
        android:orientation="vertical"
        android:background="@drawable/letterbox_education_dialog_background"
        android:padding="24dp">

        <ImageView
            android:id="@+id/letterbox_education_icon"
            android:layout_width="@dimen/letterbox_education_dialog_icon_size"
            android:layout_height="@dimen/letterbox_education_dialog_icon_size"
            android:layout_marginBottom="20dp" />
            android:layout_marginBottom="12dp"
            android:src="@drawable/letterbox_education_ic_letterboxed_app"/>

        <TextView
            android:id="@+id/letterbox_education_dialog_title"
@@ -44,36 +45,38 @@
            android:layout_height="wrap_content"
            android:maxWidth="@dimen/letterbox_education_dialog_title_max_width"
            android:lineSpacingExtra="4sp"
            android:text="@string/letterbox_education_dialog_title"
            android:textAlignment="center"
            android:textColor="@color/compat_controls_text"
            android:textSize="24sp"/>

        <LinearLayout
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="top"
            android:orientation="horizontal"
            android:paddingTop="43dp">
            android:layout_marginTop="8dp"
            android:maxWidth="@dimen/letterbox_education_dialog_title_max_width"
            android:lineSpacingExtra="4sp"
            android:text="@string/letterbox_education_dialog_subtext"
            android:textAlignment="center"
            android:textColor="@color/letterbox_education_text_secondary"
            android:textSize="14sp"/>

            <com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogActionLayout
                android:id="@+id/letterbox_education_dialog_screen_rotation_action"
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                app:icon="@drawable/letterbox_education_ic_screen_rotation"/>
            android:gravity="top"
            android:orientation="horizontal"
            android:paddingTop="48dp">

            <com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogActionLayout
                android:id="@+id/letterbox_education_dialog_split_screen_action"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/letterbox_education_dialog_space_between_actions"
                app:icon="@drawable/letterbox_education_ic_split_screen"
                app:text="@string/letterbox_education_split_screen_text"/>
                app:icon="@drawable/letterbox_education_ic_screen_rotation"
                app:text="@string/letterbox_education_screen_rotation_text"/>

            <com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogActionLayout
                android:id="@+id/letterbox_education_dialog_reposition_action"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layout_marginStart="@dimen/letterbox_education_dialog_space_between_actions"
                app:icon="@drawable/letterbox_education_ic_reposition"
                app:text="@string/letterbox_education_reposition_text"/>
@@ -81,13 +84,11 @@
        </LinearLayout>

        <Button
            android:id="@+id/letterbox_education_dialog_dismiss"
            android:id="@+id/letterbox_education_dialog_dismiss_button"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:layout_marginTop="43dp"
            android:layout_marginHorizontal="24dp"
            android:background="@drawable/letterbox_education_dismiss_background_ripple"
            android:gravity="center"
            android:layout_marginTop="48dp"
            android:background="@drawable/letterbox_education_dismiss_button_background_ripple"
            android:text="@string/letterbox_education_got_it"
            android:textColor="@android:color/system_neutral1_900"
            android:textAlignment="center"
@@ -95,4 +96,4 @@

    </LinearLayout>

</com.android.wm.shell.compatui.LetterboxEduDialogLayout>
</com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogLayout>
Loading