material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.34k stars 3.06k forks source link

Action Mode Item - While styling an actions' mode bar item text color, it doesn´t change it #4317

Closed benjaminreynoso closed 3 weeks ago

benjaminreynoso commented 3 weeks ago

Description: While styling an actions' mode bar item text color, it doesn´t change it with proper styling, it is more noticeable on dark theme, as the text seems to be grayed out

Expected behavior: change the item's text color to the one that was set.

Source code:

@style/Widget.foo.ActionMode

Minimal sample app repro: have up and running a action mode menu with items that display a text

Android API version: API LEVEL 33

Material Library version: 1.8.0-alpha01

Device:Samsung A03 API LEVEL 33

I've tried to update the material dependency, creating the same styling for the dark theme and fixing a color for both themes.

dsn5ft commented 3 weeks ago

Hi @benjaminreynoso can you try following the same pattern as the M3 ActionMode?

https://github.com/search?q=repo%3Amaterial-components%2Fmaterial-components-android%20Widget.Material3.ActionMode&type=code

Within the actionModeStyle you can set titleTextStyle and then within the titleTextStyle you can set android:textColor:

https://github.com/material-components/material-components-android/blob/ade1437cfd2f11845673638e4abfdd68bda92645/lib/java/com/google/android/material/appbar/res/values/styles.xml#L256-L267

benjaminreynoso commented 2 weeks ago

HI, even though we're using M2?

dsn5ft commented 2 weeks ago

We don't customize the action mode style in the M2 themes, so if using M2 you can extend directly from AppCompat. So same instructions as above but using these instead as parent styles: