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

Commit 66cce00f authored by Edgar Wang's avatar Edgar Wang
Browse files

[Exressive design] Update ActionButtons style

- update disable state color
- handle text when icon is null

Bug: 381034472
Flag: EXEMPT library update
Test: visual test
Change-Id: I01f36845b72f29f3870ab2db0ef2db3a9fa40d6b
parent a4e6cc06
Loading
Loading
Loading
Loading
+24 −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.
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false"
        android:color="@color/settingslib_materialColorSurface"/>
    <item android:state_checked="true" android:color="?attr/colorContainerChecked"/>
    <item android:state_checkable="true" android:color="?attr/colorContainerUnchecked"/>
    <item android:color="@color/settingslib_materialColorPrimaryContainer" />
</selector>
 No newline at end of file
+25 −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.
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false"
        android:alpha="@dimen/material_emphasis_disabled" android:color="?attr/colorOnSurface"/>
    <item android:state_checkable="true" android:state_checked="true"
        android:color="?attr/colorOnContainerChecked"/>
    <item android:state_checkable="true" android:color="?attr/colorOnContainerUnchecked"/>
    <item android:color="@color/settingslib_materialColorOnPrimaryContainer"/>
</selector>
 No newline at end of file
+8 −3
Original line number Diff line number Diff line
@@ -17,9 +17,14 @@

<resources>
    <style name="SettingsLibActionButton.Expressive" parent="SettingsLibButtonStyle.Expressive.Tonal">
        <item name="android:backgroundTint">@color/settingslib_materialColorPrimaryContainer</item>
        <item name="iconTint">@color/settingslib_materialColorOnPrimaryContainer</item>
        <item name="iconGravity">textTop</item>
        <item name="android:backgroundTint">@color/settingslib_expressive_actionbutton_background</item>
        <item name="android:textColor">@color/settingslib_expressive_actionbutton_content_color</item>
        <item name="android:insetTop">@dimen/settingslib_expressive_space_none</item>
        <item name="android:insetBottom">@dimen/settingslib_expressive_space_none</item>
        <item name="iconTint">@color/settingslib_expressive_actionbutton_content_color</item>
        <item name="iconSize">@dimen/settingslib_expressive_space_small4</item>
        <item name="iconPadding">@dimen/settingslib_expressive_space_none</item>"
        <item name="iconGravity">textStart</item>
    </style>

    <style name="SettingsLibActionButton.Expressive.Label" parent="">
+1 −1
Original line number Diff line number Diff line
@@ -549,7 +549,7 @@ public class ActionButtonsPreference extends Preference implements GroupSectionD
                    ((MaterialButton) mButton).setIcon(mIcon);
                }
                mButton.setEnabled(mIsEnabled);
                mActionLayout.setOnClickListener(mListener);
                mButton.setOnClickListener(mListener);
                mActionLayout.setEnabled(mIsEnabled);
                mActionLayout.setContentDescription(mText);
            } else {