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

Commit 79aa3159 authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Use onSecondaryContainer color in IME switcher

The item text and checkmark image were always using the onSurface color
role (matching the dialog background), however the selected item's
background is using the secondaryContainer color role.

This updates the resources to use the correct color roles based on the
item selection status.

Flag: android.view.inputmethod.ime_switcher_revamp
Test: show IME Switcher menu in different contrast modes
Bug: 361057000
Change-Id: Iec24ae6394596dccc4395df58a94ae3d1415d312
parent 48d98a08
Loading
Loading
Loading
Loading
+21 −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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_activated="true" android:color="?attr/materialColorOnSecondaryContainer" />
    <item android:color="?attr/materialColorOnSurface" />
</selector>
+2 −1
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@
                android:ellipsize="marquee"
                android:singleLine="true"
                android:fontFamily="google-sans-text"
                android:textColor="@color/input_method_switch_on_item"
                android:textAppearance="?attr/textAppearanceListItem"/>

        </LinearLayout>
@@ -81,7 +82,7 @@
            android:gravity="center_vertical"
            android:layout_marginStart="12dp"
            android:src="@drawable/ic_check_24dp"
            android:tint="?attr/materialColorOnSurface"
            android:tint="@color/input_method_switch_on_item"
            android:visibility="gone"
            android:importantForAccessibility="no"/>