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

Commit beca2c45 authored by Edgar Wang's avatar Edgar Wang Committed by Android (Google) Code Review
Browse files

Merge "[Expressive design]relayout cardpreference" into main

parents d555e2c9 2a436f9c
Loading
Loading
Loading
Loading
+28 −0
Original line number Original line 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.
-->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:colorControlHighlight">
    <item>
        <shape android:shape="rectangle">
            <solid
                android:color="@color/settingslib_materialColorSecondaryContainer" />
            <corners
                android:radius="@dimen/settingslib_expressive_radius_extralarge3" />
        </shape>
    </item>
</ripple>
 No newline at end of file
+17 −18
Original line number Original line Diff line number Diff line
@@ -14,9 +14,13 @@
    See the License for the specific language governing permissions and
    See the License for the specific language governing permissions and
    limitations under the License.
    limitations under the License.
-->
-->
<com.google.android.material.card.MaterialCardView
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/SettingsLibCardStyle">
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingVertical="@dimen/settingslib_expressive_space_extrasmall4">


    <LinearLayout
    <LinearLayout
        android:id="@+id/card_container"
        android:id="@+id/card_container"
@@ -24,10 +28,10 @@
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:baselineAligned="false"
        android:baselineAligned="false"
        android:minHeight="@dimen/settingslib_expressive_space_large3"
        android:minHeight="@dimen/settingslib_expressive_space_large3"
        android:paddingStart="@dimen/settingslib_expressive_space_small1"
        android:paddingHorizontal="@dimen/settingslib_expressive_space_medium1"
        android:paddingEnd="@dimen/settingslib_expressive_space_small1"
        android:orientation="horizontal"
        android:orientation="horizontal"
        android:gravity="center_vertical">
        android:gravity="center_vertical"
        android:background="@drawable/settingslib_card_preference_background">


        <LinearLayout
        <LinearLayout
            android:id="@+id/icon_frame"
            android:id="@+id/icon_frame"
@@ -35,15 +39,13 @@
            android:layout_height="wrap_content"
            android:layout_height="wrap_content"
            android:minWidth="@dimen/settingslib_expressive_space_medium3"
            android:minWidth="@dimen/settingslib_expressive_space_medium3"
            android:minHeight="@dimen/settingslib_expressive_space_medium3"
            android:minHeight="@dimen/settingslib_expressive_space_medium3"
            android:gravity="center"
            android:gravity="center">
            android:orientation="horizontal">

            <ImageView
            <ImageView
                android:id="@android:id/icon"
                android:id="@android:id/icon"
                android:layout_width="@dimen/settingslib_expressive_space_medium3"
                android:layout_width="@dimen/settingslib_expressive_space_medium3"
                android:layout_height="@dimen/settingslib_expressive_space_medium3"
                android:layout_height="@dimen/settingslib_expressive_space_medium3"
                android:scaleType="centerInside"/>
                android:scaleType="centerInside"

                android:importantForAccessibility="no"/>
        </LinearLayout>
        </LinearLayout>


        <LinearLayout
        <LinearLayout
@@ -54,19 +56,16 @@
            android:paddingHorizontal="@dimen/settingslib_expressive_space_small1"
            android:paddingHorizontal="@dimen/settingslib_expressive_space_small1"
            android:paddingVertical="@dimen/settingslib_expressive_space_small2"
            android:paddingVertical="@dimen/settingslib_expressive_space_small2"
            android:orientation="vertical">
            android:orientation="vertical">

            <TextView
            <TextView
                android:id="@android:id/title"
                android:id="@android:id/title"
                android:layout_width="match_parent"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="@style/TextAppearance.CardTitle.SettingsLib" />
                android:textAppearance="@style/TextAppearance.CardTitle.SettingsLib" />

            <TextView
            <TextView
                android:id="@android:id/summary"
                android:id="@android:id/summary"
                android:layout_width="match_parent"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="@style/TextAppearance.CardSummary.SettingsLib" />
                android:textAppearance="@style/TextAppearance.CardSummary.SettingsLib" />

        </LinearLayout>
        </LinearLayout>


        <ImageView
        <ImageView
@@ -75,9 +74,9 @@
            android:layout_height="@dimen/settingslib_expressive_space_medium4"
            android:layout_height="@dimen/settingslib_expressive_space_medium4"
            android:padding="@dimen/settingslib_expressive_space_extrasmall4"
            android:padding="@dimen/settingslib_expressive_space_extrasmall4"
            android:layout_gravity="center"
            android:layout_gravity="center"
            android:contentDescription="@string/settingslib_dismiss_button_content_description"
            android:src="@drawable/settingslib_expressive_icon_close"
            android:src="@drawable/settingslib_expressive_icon_close"
            android:background="?android:attr/selectableItemBackground" />
            android:tint="@color/settingslib_materialColorOnSecondary" />


    </LinearLayout>
    </LinearLayout>

</LinearLayout>
</com.google.android.material.card.MaterialCardView>
 No newline at end of file
 No newline at end of file
+2 −2
Original line number Original line Diff line number Diff line
@@ -18,11 +18,11 @@
<resources>
<resources>
    <style name="TextAppearance.CardTitle.SettingsLib"
    <style name="TextAppearance.CardTitle.SettingsLib"
        parent="@style/TextAppearance.SettingsLib.TitleMedium.Emphasized">
        parent="@style/TextAppearance.SettingsLib.TitleMedium.Emphasized">
        <item name="android:textColor">@color/settingslib_materialColorOnPrimary</item>
        <item name="android:textColor">@color/settingslib_materialColorOnSecondaryContainer</item>
    </style>
    </style>


    <style name="TextAppearance.CardSummary.SettingsLib"
    <style name="TextAppearance.CardSummary.SettingsLib"
        parent="@style/TextAppearance.SettingsLib.LabelMedium">
        parent="@style/TextAppearance.SettingsLib.LabelMedium">
        <item name="android:textColor">@color/settingslib_materialColorOnSecondary</item>
        <item name="android:textColor">@color/settingslib_materialColorOnSecondaryContainer</item>
    </style>
    </style>
</resources>
</resources>
 No newline at end of file
+2 −0
Original line number Original line Diff line number Diff line
@@ -21,4 +21,6 @@
    <string name="settingslib_expressive_text_expand">Expand</string>
    <string name="settingslib_expressive_text_expand">Expand</string>
    <!-- text of button to indicate user the textView is collapsable [CHAR LIMIT=NONE] -->
    <!-- text of button to indicate user the textView is collapsable [CHAR LIMIT=NONE] -->
    <string name="settingslib_expressive_text_collapse">Collapse</string>
    <string name="settingslib_expressive_text_collapse">Collapse</string>
    <!-- Content description of the dismiss button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="settingslib_dismiss_button_content_description">Dismiss</string>
</resources>
</resources>
 No newline at end of file