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

Commit 96bd28fc authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adjust Modes Settings pages for the Expressive theme" into main

parents e2a88a14 1865961c
Loading
Loading
Loading
Loading
+122 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/enable_mode_button"
            style="@style/SettingsLibButtonStyle.Expressive.Filled.Large"
            android:layout_width="0dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/guideline" />

        <!-- 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" />

        <FrameLayout
            android:id="@+id/image_frame"
            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:paddingHorizontal="12dp">

            <ImageView
                android:id="@+id/image"
                android:clickable="false"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:adjustViewBounds="true"
                android:scaleType="fitCenter"
                android:layout_gravity="center" />

        </FrameLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

</LinearLayout>
 No newline at end of file
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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.
  -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingHorizontal="80dp" >

    <include
        layout="@layout/mode_interstitial_layout_base_expressive"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_horizontal" />
</FrameLayout>
 No newline at end of file
+94 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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="12dp"
        android:paddingLeft="24dp"
        android:paddingRight="24dp"
        android:orientation="vertical">

        <TextView
            android:id="@+id/mode_name_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clickable="false"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Title"
            app:layout_constraintTop_toTopOf="parent"
            android:textSize="36sp"
            android:paddingVertical="12dp" />

        <TextView
            android:id="@+id/mode_name_subtitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clickable="false"
            android:text="@string/zen_mode_setup_page_summary"
            android:textSize="18sp"
            android:paddingBottom="48dp"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
            app:layout_constraintTop_toBottomOf="@+id/mode_name_title" />


        <!-- image goes here -->
        <FrameLayout
            android:id="@+id/image_frame"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintTop_toBottomOf="@id/mode_name_subtitle">

            <ImageView
                android:id="@+id/image"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:adjustViewBounds="true"
                android:clickable="false"
                android:scaleType="fitCenter"
                android:layout_gravity="center" />

        </FrameLayout>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/enable_mode_button"
            style="@style/SettingsLibButtonStyle.Expressive.Filled.Large"
            android:layout_width="match_parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintVertical_bias="1" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</LinearLayout>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -24,5 +24,6 @@
     <item name="sfps_enroll_finish" type="layout">@layout/sfps_enroll_finish_base</item>
     <item name="choose_lock_pattern" type="layout">@layout/choose_lock_pattern_common</item>
     <item name="mode_interstitial_layout" type="layout">@layout/mode_interstitial_layout_base</item>
     <item name="mode_interstitial_layout_expressive" type="layout">@layout/mode_interstitial_layout_base_expressive</item>
</resources>
+42 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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.
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:title="@string/zen_modes_list_title"
    android:key="modes_list_settings">

    <com.android.settingslib.widget.TopIntroPreference
        android:title="@string/zen_modes_list_intro" />

    <PreferenceCategory
        android:key="zen_modes_list">
        <!-- Preferences leading to individual mode pages are added in this PreferenceCategory. -->
    </PreferenceCategory>

    <com.android.settingslib.widget.UntitledPreferenceCategory>
      <com.android.settingslib.widget.ButtonPreference
          android:key="add_mode"
          android:title="@string/zen_modes_add_mode"
          android:icon="@drawable/ic_add_24dp"
          settings:buttonPreferenceSize="large"
          settings:buttonPreferenceType="filled"
          settings:allowDividerAbove="false"/>
    </com.android.settingslib.widget.UntitledPreferenceCategory>

</PreferenceScreen>
Loading