Files
packages_apps_Settings/res/layout-land/mode_interstitial_layout.xml
Yuri Lin 65548c0e56 Add interstitial for modes that are disabled but not by user
This covers both the case of navigating to the mode page through the mode aggregator menu as well as if an app sends an intent to go to the mode.

The interstitial visuals are not done yet; in particular, the image is just a gray box for now.

Manual tests done:
- visually verifying the interstitial page in both portrait and landscape
- accessing the mode page from modes list, confirming interstitial pops up
- accessing enabled and disabled-by-user mode page from modes list (no interstitial)
- getting to the mode page from intent through an app
- accessing enabled and disabled-by-user mode pages from app intent (no interstitial)
- adjusted display and font size (it looks bad with max display & font size, maybe not much to be done)

Bug: 332730534
Test: manual, ZenModeFragmentTest, SetupInterstitialActivityTest
Flag: android.app.modes_ui
Change-Id: I21f13b0842d5b118a341f7d85e8fcac947ca3a06
2024-08-01 18:44:22 -04:00

113 lines
4.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2024 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
android:id="@+id/interstitial_page"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:transitionGroup="true"
android:orientation="vertical">
<Toolbar
android:id="@+id/action_bar"
style="?android:attr/actionBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?android:attr/actionBarTheme"
android:elevation="0dp"
android:background="@android:color/transparent"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="12dp"
android:paddingBottom="24dp"
android:paddingHorizontal="24dp"
android:clipChildren="true">
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constrainedHeight="true"
app:layout_constraintBottom_toTopOf="@+id/enable_mode_button"
app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingEnd="12dp"
android:paddingStart="12dp">
<TextView
android:id="@+id/mode_name_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:paddingVertical="12dp"
android:textSize="36sp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Title" />
<TextView
android:id="@+id/mode_name_subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:paddingBottom="12dp"
android:text="@string/zen_mode_setup_page_summary"
android:textSize="18sp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead" />
</LinearLayout>
</ScrollView>
<Button
android:id="@+id/enable_mode_button"
style="@style/ActionPrimaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/guideline"
android:paddingEnd="12dp" />
<!-- guideline to have text/button side & image side take up half the page each -->
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<ImageView
android:id="@+id/image"
android:layout_height="0dp"
android:layout_width="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintEnd_toEndOf="parent"
android:paddingStart="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>