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

Commit 2a436f9c authored by Edgar Wang's avatar Edgar Wang
Browse files

[Expressive design]relayout cardpreference

- remove MaterialCardView

Bug: 380233807
Test: visual
Flag: EXEMPT library update
Change-Id: I83590e369e56bf6ab5effd1922b162d960d5cae4
parent be860b4d
Loading
Loading
Loading
Loading
+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.
-->

<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 Diff line number Diff line
@@ -14,9 +14,13 @@
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<com.google.android.material.card.MaterialCardView
<LinearLayout
    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
        android:id="@+id/card_container"
@@ -24,10 +28,10 @@
        android:layout_height="wrap_content"
        android:baselineAligned="false"
        android:minHeight="@dimen/settingslib_expressive_space_large3"
        android:paddingStart="@dimen/settingslib_expressive_space_small1"
        android:paddingEnd="@dimen/settingslib_expressive_space_small1"
        android:paddingHorizontal="@dimen/settingslib_expressive_space_medium1"
        android:orientation="horizontal"
        android:gravity="center_vertical">
        android:gravity="center_vertical"
        android:background="@drawable/settingslib_card_preference_background">

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

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

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

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

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

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

        </LinearLayout>

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

    </LinearLayout>

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

    <style name="TextAppearance.CardSummary.SettingsLib"
        parent="@style/TextAppearance.SettingsLib.LabelMedium">
        <item name="android:textColor">@color/settingslib_materialColorOnSecondary</item>
        <item name="android:textColor">@color/settingslib_materialColorOnSecondaryContainer</item>
    </style>
</resources>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -21,4 +21,6 @@
    <string name="settingslib_expressive_text_expand">Expand</string>
    <!-- text of button to indicate user the textView is collapsable [CHAR LIMIT=NONE] -->
    <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>
 No newline at end of file