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

Commit 9966f906 authored by Catherine Liang's avatar Catherine Liang Committed by Android (Google) Code Review
Browse files

Merge changes from topic "wpp-app-icon-changes" into main

* changes:
  Create app icon entry point
  Create app icon floating sheet
parents 52fdbe16 7517ae46
Loading
Loading
Loading
Loading
+29 −12
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~ 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.
@@ -17,11 +17,10 @@
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingHorizontal="@dimen/customization_option_entry_horizontal_padding"
    android:paddingVertical="@dimen/customization_option_entry_vertical_padding_large"
    android:paddingVertical="@dimen/customization_option_entry_vertical_padding"
    android:clickable="true">

    <TextView
@@ -29,20 +28,38 @@
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/themed_icon_title"
        android:text="@string/app_icons_title"
        android:layout_marginEnd="@dimen/customization_option_entry_text_margin_end"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/option_entry_switch"
        app:layout_constraintEnd_toStartOf="@+id/option_entry_icon_container"
        app:layout_constraintBottom_toTopOf="@+id/option_entry_description"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent" />
        app:layout_constraintVertical_chainStyle="packed" />

    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/option_entry_switch"
        android:layout_width="wrap_content"
    <TextView
        android:id="@+id/option_entry_description"
        style="@style/CustomizationOptionEntrySubtitleTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:focusable="false"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginEnd="@dimen/customization_option_entry_text_margin_end"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/option_entry_icon_container"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/option_entry_title" />

    <FrameLayout
        android:id="@+id/option_entry_icon_container"
        android:layout_width="@dimen/customization_option_entry_icon_size"
        android:layout_height="@dimen/customization_option_entry_icon_size"
        android:padding="@dimen/customization_option_entry_icon_padding"
        android:background="@drawable/customization_option_entry_icon_background"
        app:layout_constraintEnd_toEndOf="parent"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight" />
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent">

        <ImageView
            android:id="@+id/option_entry_icon"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/shape_and_grid_title"
        android:text="@string/grid_layout"
        android:layout_marginEnd="@dimen/customization_option_entry_text_margin_end"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/option_entry_icon_container"
+86 −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 xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/floating_sheet_content_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="@dimen/floating_sheet_horizontal_padding"
    android:paddingVertical="@dimen/floating_sheet_content_vertical_padding"
    android:background="@drawable/floating_sheet_content_background"
    android:orientation="vertical"
    android:clipToPadding="false"
    android:clipChildren="false">

    <FrameLayout
        android:id="@+id/app_shape_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="12dp"
        android:clipToPadding="false"
        android:clipChildren="false">

        <!--
        This is just an invisible placeholder put in place so that the parent keeps its height
        stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the
        layout logic to keep the size of the preview container stable as well, which bodes well
        for setting up the SurfaceView for remote rendering without changing its size after the
        content is loaded into the RecyclerView.

        It's critical for any TextViews inside the included layout to have text.
        -->
        <include
            layout="@layout/shape_option2"
            android:layout_width="64dp"
            android:layout_height="64dp"
            android:visibility="invisible" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/shape_options"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:clipToPadding="false"
            android:clipChildren="false" />
    </FrameLayout>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:gravity="center_vertical"
        android:layout_marginHorizontal="@dimen/floating_sheet_content_horizontal_padding"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/themed_icon_title"
            style="@style/SectionTitleTextStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/themed_icon_title" />

        <com.google.android.material.materialswitch.MaterialSwitch
            android:id="@+id/themed_icon_toggle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@null"
            android:focusable="false"
            android:minHeight="0dp"
            android:theme="@style/Theme.Material3.DynamicColors.DayNight" />
    </LinearLayout>
</LinearLayout>
 No newline at end of file
+19 −65
Original line number Diff line number Diff line
@@ -30,44 +30,6 @@
        android:clipToPadding="false"
        android:clipChildren="false">

        <FrameLayout
            android:id="@+id/app_shape_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:clipChildren="false">

            <!--
            This is just an invisible placeholder put in place so that the parent keeps its height
            stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the
            layout logic to keep the size of the preview container stable as well, which bodes well
            for setting up the SurfaceView for remote rendering without changing its size after the
            content is loaded into the RecyclerView.

            It's critical for any TextViews inside the included layout to have text.
            -->
            <include
                layout="@layout/shape_option2"
                android:layout_width="64dp"
                android:layout_height="64dp"
                android:visibility="invisible" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/shape_options"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:clipToPadding="false"
                android:clipChildren="false" />
        </FrameLayout>

        <FrameLayout
            android:id="@+id/app_grid_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:clipChildren="false">

        <!--
        This is just an invisible placeholder put in place so that the parent keeps its height
        stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the
@@ -92,12 +54,4 @@
            android:clipChildren="false"
            android:layout_gravity="center_horizontal" />
    </FrameLayout>
    </FrameLayout>

    <com.android.wallpaper.picker.customization.ui.view.FloatingToolbar
        android:id="@+id/floating_toolbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginVertical="@dimen/floating_sheet_tab_toolbar_vertical_margin" />
</LinearLayout>
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -123,6 +123,10 @@
        the grid layout of the apps -->
    <string name="grid_layout">Layout</string>

    <!-- Title of a section of the customization picker where the user can customize app icon
     shape and theme for the home screen. [CHAR LIMIT=15] -->
    <string name="app_icons_title">Icons</string>

    <!-- Label for a button that allows the user to apply the currently selected Theme.
        [CHAR LIMIT=20] -->
    <string name="apply_theme_btn">Apply</string>
Loading