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

Commit 25bc6864 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "m3: impl baseline button styling Outline & Text" into main

parents 479453ff ba15cd8b
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line Diff line number Diff line
<!--
  ~ 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.
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false"
          android:alpha="?attr/disabledAlpha"
          android:color="?attr/materialColorOnSurface" />
    <item android:color="?attr/materialColorOutline" />
</selector>
+39 −0
Original line number Original line Diff line number Diff line
<!--
  ~ 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.
  -->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="?attr/colorControlHighlight">
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
            <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/>
            <solid android:color="#fff"/>
            <size
                android:width="@dimen/btn_material_width"
                android:height="@dimen/btn_material_height" />
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/>
            <stroke
                android:width="1dp"
                android:color="@color/btn_material_outlined_background_color" />
            <size
                android:width="@dimen/btn_material_width"
                android:height="@dimen/btn_material_height" />
        </shape>
    </item>
</ripple>
+28 −0
Original line number Original line Diff line number Diff line
<!--
  ~ 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.
  -->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="?attr/colorControlHighlight">
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
            <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/>
            <solid android:color="#fff"/>
            <size
                android:width="@dimen/btn_material_width"
                android:height="@dimen/btn_material_height" />
        </shape>
    </item>
</ripple>
+14 −4
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~
@@ -17,7 +17,7 @@


<resources>
<resources>
    <!--  Button Styles  -->
    <!--  Button Styles  -->
    <!-- Material Button - Filled  -->
    <!-- Material Button - Filled (primary colored) -->
    <style name="Widget.DeviceDefault.Button.Filled" parent="Widget.DeviceDefault.Button.WearMaterial3">
    <style name="Widget.DeviceDefault.Button.Filled" parent="Widget.DeviceDefault.Button.WearMaterial3">
        <item name="android:background">@drawable/btn_background_material_filled</item>
        <item name="android:background">@drawable/btn_background_material_filled</item>
        <item name="textAppearance">@style/TextAppearance.Widget.Button.Material.Filled</item>
        <item name="textAppearance">@style/TextAppearance.Widget.Button.Material.Filled</item>
@@ -41,9 +41,19 @@
        <item name="gravity">center_vertical</item>
        <item name="gravity">center_vertical</item>
    </style>
    </style>


    <!-- Material Button - Outlined -->
    <style name="Widget.DeviceDefault.Button.Outlined" parent="Widget.DeviceDefault.Button.WearMaterial3">
        <item name="android:background">@drawable/btn_background_material_outlined</item>
    </style>

    <!-- Material Button - Text -->
    <style name="Widget.DeviceDefault.Button.Text" parent="Widget.DeviceDefault.Button.WearMaterial3">
        <item name="android:background">@drawable/btn_background_material_text</item>
    </style>

    <!--  Text Styles  -->
    <!--  Text Styles  -->
    <!-- TextAppearance for Material Button - Filled  -->
    <!-- TextAppearance for Material Button - Filled  -->
    <style name="TextAppearance.Widget.Button.Material.Filled" parent="TextAppearance.Widget.Button.Material">
    <style name="TextAppearance.Widget.Button.Material.Filled">
        <item name="textColor">@color/btn_material_filled_content_color</item>
        <item name="textColor">@color/btn_material_filled_content_color</item>
    </style>
    </style>