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

Commit 1d8bc29e authored by Edgar Wang's avatar Edgar Wang
Browse files

[Expressive design] update AlertDialog style

Bug: 394699422
Test: visual
Flag: EXEMPT resource update
Change-Id: Ifa12a937e7678214b32b4db6a38c08bb2d670c23
parent 771c6c3e
Loading
Loading
Loading
Loading
+21 −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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/settingslib_materialColorPrimary"/>
    <corners android:radius="@dimen/settingslib_expressive_radius_full"/>
</shape>
 No newline at end of file
+21 −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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <stroke android:width="1dp"
        android:color="@color/settingslib_materialColorOutlineVariant"/>
    <corners android:radius="@dimen/settingslib_expressive_radius_full"/>
</shape>
 No newline at end of file
+35 −0
Original line number Diff line number Diff line
@@ -90,4 +90,39 @@
        parent="@style/TextAppearance.SettingsLib.BodyMedium">
        <item name="android:textColor">@color/settingslib_text_color_secondary</item>
    </style>

    <style name="Widget.SettingsLib.DialogWindowTitle" parent="">
        <item name="android:scrollHorizontally">false</item>
        <item name="android:ellipsize">end</item>
        <item name="android:textAppearance">@style/TextAppearance.SettingsLib.HeadlineSmall</item>
    </style>

    <style name="Widget.SettingsLib.ButtonBar" parent="@style/Widget.AppCompat.ButtonBar.AlertDialog">
        <item name="android:paddingTop">@dimen/settingslib_expressive_space_extrasmall2</item>
        <item name="android:paddingBottom">@dimen/settingslib_expressive_space_small4</item>
    </style>

    <style name="Widget.SettingsLib.DialogButton" parent="@style/Widget.AppCompat.Button">
        <item name="android:layout_height">wrap_content</item>
        <item name="android:minHeight">0dp</item>
        <item name="android:minWidth">0dp</item>
        <item name="android:paddingVertical">@dimen/settingslib_expressive_space_extrasmall5</item>
        <item name="android:paddingHorizontal">@dimen/settingslib_expressive_space_small1</item>
        <item name="android:stateListAnimator">@null</item>
        <item name="textAllCaps">false</item>
        <item name="android:textAppearance">@style/TextAppearance.SettingsLib.LabelLarge</item>
        <item name="android:textColor">@color/settingslib_materialColorPrimary</item>
        <item name="android:background">@android:color/transparent</item>
    </style>

    <style name="Widget.SettingsLib.DialogButton.Filled">
        <item name="android:layout_marginEnd">@dimen/settingslib_expressive_space_extrasmall6</item>
        <item name="android:background">@drawable/settingslib_expressive_button_background_filled</item>
        <item name="android:textColor">@color/settingslib_materialColorOnPrimary</item>
    </style>

    <style name="Widget.SettingsLib.DialogButton.Outline">
        <item name="android:layout_marginEnd">@dimen/settingslib_expressive_space_extrasmall4</item>
        <item name="android:background">@drawable/settingslib_expressive_button_background_outline</item>
    </style>
</resources>
 No newline at end of file
+12 −1
Original line number Diff line number Diff line
@@ -53,6 +53,17 @@
        <item name="colorControlNormal">?android:attr/colorControlNormal</item>

        <!-- For AndroidX AlertDialog -->
        <!--item name="alertDialogTheme">@style/Theme.AlertDialog.SettingsLib</item-->
        <item name="alertDialogTheme">@style/Theme.AlertDialog.SettingsLib.Expressive</item>
    </style>

    <style name="Theme.AlertDialog.SettingsLib.Expressive">
        <item name="colorAccent">@color/settingslib_materialColorPrimary</item>
        <item name="android:colorBackground">@color/settingslib_materialColorSurfaceContainerHigh</item>
        <item name="android:windowTitleStyle">@style/Widget.SettingsLib.DialogWindowTitle</item>
        <item name="dialogPreferredPadding">@dimen/settingslib_expressive_space_small4</item>
        <item name="buttonBarStyle">@style/Widget.SettingsLib.ButtonBar</item>
        <item name="buttonBarPositiveButtonStyle">@style/Widget.SettingsLib.DialogButton.Filled</item>
        <item name="buttonBarNegativeButtonStyle">@style/Widget.SettingsLib.DialogButton.Outline</item>
        <item name="buttonBarNeutralButtonStyle">@style/Widget.SettingsLib.DialogButton</item>
    </style>
</resources>
 No newline at end of file