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

Commit 8a79ce3f authored by Bob Yang's avatar Bob Yang Committed by Android (Google) Code Review
Browse files

Merge "Implementation of the pack theme entry in the home option" into main

parents d63d88cc 6792be90
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
<!--
     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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="?attr/colorControlNormal"
    android:translateX="100"
    android:viewportHeight="1920"
    android:viewportWidth="1920">

    <group
        android:translateX="480"
        android:translateY="480">
        <path
            android:fillColor="?android:textColorPrimary"
            android:pathData="M340,240L260,160L340,80L420,160L340,240ZM800,700L720,620L800,540L880,620L800,700ZM205,868L92,755Q80,743 80,727Q80,711 92,699L455,335Q490,300 540,300Q590,300 625,335Q660,370 660,420Q660,470 625,505L261,868Q249,880 233,880Q217,880 205,868ZM740,401Q740,326 687,273Q634,220 559,220Q634,220 687,167.5Q740,115 740,40Q740,115 792.5,167.5Q845,220 920,220Q845,220 792.5,273Q740,326 740,401ZM484,533L484,533Q484,533 469.5,519Q455,505 455,505Q455,505 441,491Q427,477 427,477L427,477L455,505L484,533ZM233,784L484,533L427,477L177,727L233,784Z" />
    </group>
</vector>
 No newline at end of file
+69 −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.
  -->

<androidx.constraintlayout.widget.ConstraintLayout
    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="wrap_content"
    android:paddingHorizontal="@dimen/customization_option_entry_horizontal_padding"
    android:paddingVertical="@dimen/customization_option_entry_vertical_padding"
    android:clickable="true">

    <TextView
        android:id="@+id/option_entry_title"
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/pack_theme_title"
        android:layout_marginEnd="@dimen/customization_option_entry_text_margin_end"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/option_entry_icon_container"
        app:layout_constraintBottom_toTopOf="@+id/option_entry_description"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_chainStyle="packed" />

    <TextView
        android:id="@+id/option_entry_description"
        style="@style/CustomizationOptionEntrySubtitleTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/customization_option_entry_text_margin_end"
        android:text="@string/theme_packs_description"
        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" />

    <RelativeLayout
        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"
        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"
            android:background="@drawable/ic_pack_theme_24px"
            android:contentDescription="@string/pack_theme_preview_card_content_description"
            android:layout_centerInParent="true"/>
    </RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
+1 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@
    <dimen name="floating_sheet_color_option_size">54dp</dimen>
    <dimen name="floating_sheet_color_option_stroke_width">3dp</dimen>
    <dimen name="customization_option_entry_shortcut_icon_size">20dp</dimen>
    <dimen name="customization_option_entry_icon_image_size">24dp</dimen>
    <dimen name="customization_option_entry_clock_icon_size">44dp</dimen>
    <dimen name="customization_option_entry_color_icon_size">48dp</dimen>

+9 −0
Original line number Diff line number Diff line
@@ -141,6 +141,9 @@
    <!-- Content description of grid preview card. [CHAR_LIMIT=30]-->
    <string name="grid_preview_card_content_description">Grid preview</string>

    <!-- Content description of theme preview card. [CHAR_LIMIT=30]-->
    <string name="pack_theme_preview_card_content_description">Themes preview</string>

    <!-- Content description of font preview. [CHAR_LIMIT=30]-->
    <string name="font_preview_content_description">Font preview</string>

@@ -348,9 +351,15 @@
    <!-- Title of a section of the customization where the user can select color override for icon. [CHAR LIMIT=30] -->
    <string name="themed_icon_title" msgid="4305612684940220645">Themed icons</string>

    <!-- Title of a section of the customization where the user can select color override for icon. [CHAR LIMIT=30] -->
    <string name="pack_theme_title" msgid="4305612684940220645">Themes</string>

    <!-- Title of the tag to indicate beta version. [CHAR LIMIT=6] -->
    <string name="beta_title">Beta</string>

    <!-- The description of theme picker entry. [CHAR LIMIT=30] -->
    <string name="theme_packs_description">Discover Pixel themes</string>

    <!-- The content description of grid picker entry. [CHAR LIMIT=NONE] -->
    <string name="gird_picker_entry_content_description" msgid="7538418512525897691">Change app grid</string>

+20 −0
Original line number Diff line number Diff line
@@ -175,6 +175,22 @@ constructor(private val defaultCustomizationOptionsBinder: DefaultCustomizationO
            navigateToMoreLockScreenSettingsActivity.invoke()
        }

        var optionPackThemeIconHome: ImageView? = null
        var optionPackThemeIconLock: ImageView? = null

        if (BaseFlags.get().isPackThemeEnabled()) {
            val optionPackThemeHome: View =
                homeScreenCustomizationOptionEntries
                    .first { it.first == ThemePickerHomeCustomizationOption.PACK_THEME }
                    .second
            optionPackThemeIconHome = optionPackThemeHome.requireViewById(R.id.option_entry_icon)
            val optionPackThemeLock: View =
                homeScreenCustomizationOptionEntries
                    .first { it.first == ThemePickerHomeCustomizationOption.PACK_THEME }
                    .second
            optionPackThemeIconLock = optionPackThemeLock.requireViewById(R.id.option_entry_icon)
        }

        val optionColors: View =
            homeScreenCustomizationOptionEntries
                .first { it.first == ThemePickerHomeCustomizationOption.COLORS }
@@ -209,6 +225,10 @@ constructor(private val defaultCustomizationOptionsBinder: DefaultCustomizationO
                optionShortcutIcon1.setColorFilter(color)
                optionShortcutIcon2.setColorFilter(color)
                optionShapeGridIcon.setColorFilter(color)
                if (BaseFlags.get().isPackThemeEnabled()) {
                    optionPackThemeIconHome?.setColorFilter(color)
                    optionPackThemeIconLock?.setColorFilter(color)
                }
            },
            color = colorUpdateViewModel.colorOnSurfaceVariant,
            shouldAnimate = isOnMainScreen,
Loading