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

Commit 468e15f4 authored by Chris Antol's avatar Chris Antol
Browse files

Supported updated suggestion cards in AOSP Settings

Flag: com.android.settings.flags.updated_suggestion_card_aosp
Bug: 323258154
Test: Enable flag and trigger suggestion cards to show
Change-Id: Iee47d05d8d75c10ba073ae3541f108bc37b4c09b
parent 4c90aa74
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -56,3 +56,10 @@ flag {
  description: "This flag controls the About phone > Legal information page migration"
  bug: "323791114"
}

flag {
    name: "updated_suggestion_card_aosp"
    namespace: "android_settings"
    description: "Use updated suggestion card(s) in AOSP Settings"
    bug: "323258154"
}
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2024 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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <size
        android:width="40dp"
        android:height="40dp" />
    <solid android:color="@color/settingslib_materialColorSecondaryContainer" />
</shape>
 No newline at end of file
+96 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2024 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.
-->
<com.google.android.material.card.MaterialCardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:apps="http://schemas.android.com/apk/res-auto"
    android:id="@+id/suggestion_card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    style="@style/SuggestionCardStyle">

    <LinearLayout
        android:id="@+id/card_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:baselineAligned="false"
        android:minHeight="72dp"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:background="?android:attr/selectableItemBackground">

        <FrameLayout
            android:id="@android:id/icon_frame"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:ignore="ContentDescription">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/suggestion_icon_background"/>

            <ImageView
                android:id="@android:id/icon"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_gravity="center"/>

        </FrameLayout>

        <LinearLayout
            android:id="@+id/text_container"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingStart="16dp"
            android:paddingEnd="16dp"
            android:paddingVertical="@dimen/suggestion_card_text_padding_vertical"
            android:orientation="vertical">

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

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

        </LinearLayout>

        <ImageView
            android:id="@android:id/closeButton"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:padding="8dp"
            android:visibility="gone"
            android:layout_gravity="center"
            android:contentDescription="@string/suggestion_button_close"
            android:src="@drawable/ic_suggestion_close_button"
            android:tint="@color/settingslib_materialColorPrimaryContainer"
            android:background="?android:attr/selectableItemBackground" />

    </LinearLayout>

</com.google.android.material.card.MaterialCardView>
+1 −0
Original line number Diff line number Diff line
@@ -297,6 +297,7 @@
    <dimen name="contextual_card_side_margin">4dp</dimen>
    <dimen name="contextual_card_icon_padding_start">14dp</dimen>
    <dimen name="contextual_card_text_padding_start">16dp</dimen>
    <dimen name="suggestion_card_text_padding_vertical">18dp</dimen>
    <dimen name="contextual_card_padding_end">16dp</dimen>
    <dimen name="contextual_card_corner_radius">@*android:dimen/config_dialogCornerRadius</dimen>
    <dimen name="contextual_full_card_padding_end">12dp</dimen>
+18 −0
Original line number Diff line number Diff line
@@ -1017,4 +1017,22 @@
        <item name="android:background">@null</item>
    </style>

    <style name="SuggestionCardStyle">
        <item name="cardBackgroundColor">@color/settingslib_materialColorPrimary</item>
        <item name="cardCornerRadius">40dp</item>
        <item name="cardElevation">0dp</item>
    </style>

    <style name="TextAppearance.SuggestionCardTitle">
        <item name="android:textColor">@color/settingslib_materialColorOnPrimary</item>
        <item name="android:textSize">20sp</item>
        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
    </style>

    <style name="TextAppearance.SuggestionCardSummary">
        <item name="android:textColor">@color/settingslib_materialColorOnSecondary</item>
        <item name="android:textSize">14sp</item>
        <item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
    </style>

</resources>
Loading