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

Commit 6e1f4770 authored by Kenneth Ford's avatar Kenneth Ford
Browse files

Adds RearDisplay education dialog to SysUI

To accompany the rear display API's to allow
apps to move their content to the cover screen
on a foldable device, to use the powerful rear
cameras for selfies, there needs to be a consisten
educational dialog to let users know what is going
to happen. This will be shown for all apps that use
the rear display jetpack API's, to keep consistency
and remove any knowledge an app would have to know
about the device they are on.

Bug: 207686851
Test: Manual RearDisplay flow testing
Change-Id: Ib9e2b286c0d84e2411f19f7cf0b0397486e4d4b1
parent a6abfc6e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@
    <uses-permission android:name="android.permission.ALLOW_SLIPPERY_TOUCHES" />
    <uses-permission android:name="android.permission.INPUT_CONSUMER" />

    <!-- DeviceStateManager -->
    <uses-permission android:name="android.permission.CONTROL_DEVICE_STATE" />

    <!-- DreamManager -->
    <uses-permission android:name="android.permission.READ_DREAM_STATE" />
    <uses-permission android:name="android.permission.WRITE_DREAM_STATE" />
+63 −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.
  -->
<LinearLayout 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:orientation="vertical"
             android:gravity="center" >

    <androidx.cardview.widget.CardView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:cardElevation="0dp"
        app:cardCornerRadius="28dp"
        app:cardBackgroundColor="@color/rear_display_overlay_animation_background_color">

            <com.airbnb.lottie.LottieAnimationView
                android:id="@+id/rear_display_folded_animation"
                android:layout_width="@dimen/rear_display_animation_width"
                android:layout_height="@dimen/rear_display_animation_height"
                android:layout_gravity="center"
                android:contentDescription="@null"
                android:scaleType="fitXY"
                app:lottie_rawRes="@raw/rear_display_folded"
                app:lottie_autoPlay="true"
                app:lottie_repeatMode="reverse"/>
    </androidx.cardview.widget.CardView>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_fold_bottom_sheet_title"
        android:textAppearance="@style/TextAppearance.Dialog.Title"
        android:lineSpacingExtra="2sp"
        android:paddingTop="@dimen/rear_display_title_top_padding"
        android:paddingBottom="@dimen/rear_display_title_bottom_padding"
        android:gravity="center_horizontal|center_vertical"
    />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_bottom_sheet_description"
        android:textAppearance="@style/TextAppearance.Dialog.Body"
        android:lineSpacingExtra="2sp"
        android:translationY="-1.24sp"
        android:gravity="center_horizontal|top"
    />
</LinearLayout>
+75 −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.
  -->

<LinearLayout 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:orientation="vertical"
              android:gravity="center" >

    <androidx.cardview.widget.CardView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:cardElevation="0dp"
        app:cardCornerRadius="28dp"
        app:cardBackgroundColor="@color/rear_display_overlay_animation_background_color">

        <com.airbnb.lottie.LottieAnimationView
            android:id="@+id/rear_display_folded_animation"
            android:layout_width="@dimen/rear_display_animation_width"
            android:layout_height="@dimen/rear_display_animation_height"
            android:layout_gravity="center"
            android:contentDescription="@null"
            android:scaleType="fitXY"
            app:lottie_rawRes="@raw/rear_display_turnaround"
            app:lottie_autoPlay="true"
            app:lottie_repeatMode="reverse"/>
    </androidx.cardview.widget.CardView>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_unfold_bottom_sheet_title"
        android:textAppearance="@style/TextAppearance.Dialog.Title"
        android:lineSpacingExtra="2sp"
        android:paddingTop="@dimen/rear_display_title_top_padding"
        android:paddingBottom="@dimen/rear_display_title_bottom_padding"
        android:gravity="center_horizontal|center_vertical"
    />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_bottom_sheet_description"
        android:textAppearance="@style/TextAppearance.Dialog.Body"
        android:lineSpacingExtra="2sp"
        android:translationY="-1.24sp"
        android:gravity="center_horizontal|top"
    />

    <TextView
        android:id="@+id/rear_display_warning_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_bottom_sheet_warning"
        android:textAppearance="@style/TextAppearance.Dialog.Body"
        android:lineSpacingExtra="2sp"
        android:gravity="center_horizontal|top"
    />

</LinearLayout>
+1 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading