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

Commit 53ad5869 authored by Edgar Wang's avatar Edgar Wang
Browse files

[Expressive design] Update Switch and MainSwitch style

- Update colors of thumbIcon, thumb, track
- Update text style and color of MainSwitch

Bug: 423580642
Test: visual
Flag: EXEMPT resource update
Change-Id: Id70619947d60d343bc54818423486ead365e0530
parent 9be477cf
Loading
Loading
Loading
Loading
+27 −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">
    <!-- State Disabled -->
    <item
        android:alpha="0.12"
        android:color="@color/settingslib_materialColorOnSurface"
        android:state_enabled="false"/>
    <!-- State Enabled -->
    <item
        android:color="@color/settingslib_materialColorPrimaryContainer"/>
</selector>
 No newline at end of file
+23 −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_materialColorOnSurface"
        android:alpha="0.38" />
    <item android:color="@color/settingslib_materialColorOnPrimaryContainer"/>
</selector>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    android:color="?android:attr/colorControlHighlight">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/settingslib_materialColorPrimaryContainer"/>
            <solid android:color="@color/settingslib_expressive_color_main_switch_bar_bg"/>
            <corners android:radius="@dimen/settingslib_expressive_radius_extralarge3"/>
        </shape>
    </item>
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
                android:ellipsize="end"
                android:textAlignment="viewStart"
                android:textAppearance="@style/TextAppearance.SettingsLib.TitleMedium.Emphasized"
                android:textColor="@color/settingslib_main_switch_text_color" />
                android:textColor="@color/settingslib_expressive_color_main_switch_text" />

            <TextView
                android:id="@+id/switch_summary"
@@ -60,7 +60,7 @@
                android:layout_gravity="start"
                android:textAlignment="viewStart"
                android:textAppearance="@style/TextAppearance.SettingsLib.LabelMedium"
                android:textColor="@color/settingslib_main_switch_text_color"
                android:textColor="@color/settingslib_expressive_color_main_switch_text"
                android:visibility="gone" />
        </RelativeLayout>

+47 −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">
    <!-- State Disabled, Unchecked -->
    <item
        android:alpha="0.38"
        android:color="@color/settingslib_materialColorOutline"
        android:state_enabled="false" android:state_checked="false"/>
    <!-- State Disabled, Checked -->
    <item
        android:alpha="0.38"
        android:color="@color/settingslib_materialColorSurface"
        android:state_enabled="false" android:state_checked="true"/>
    <!-- State Checked -->
    <item
        android:color="@color/settingslib_materialColorOnPrimary"
        android:state_checked="true"/>

    <!-- State Unchecked -->
    <item
        android:color="@color/settingslib_materialColorOutline"
        android:state_hovered="true" android:state_checked="false"/>
    <item
        android:color="@color/settingslib_materialColorOutline"
        android:state_focused="true" android:state_checked="false"/>
    <item
        android:color="@color/settingslib_materialColorOutline"
        android:state_pressed="true" android:state_checked="false"/>
    <item
        android:color="@color/settingslib_materialColorOutline"
        android:state_checked="false"/>
</selector>
 No newline at end of file
Loading