Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Define theme `surface`/`container` colors

Open BrayanDSO opened this issue 1 year ago • 14 comments

Define theme surface/container colors

We've moved to Mateiral3 themes a long time ago, but never defined some colors like the many surface and container variants (source). The ones that are currently defined are mostly hacks to avoid breaking some UI components.

For example, MaterialAlertDialogs look like this right now:

image

BrayanDSO avatar Jul 03 '25 18:07 BrayanDSO

Material has some resources to help designing the colors.

This should have a plan to how things should look before doing an actual implementation.

BrayanDSO avatar Jul 03 '25 18:07 BrayanDSO

Seeing that MaterialAlertDialogBuilder doesn't produce an ui like AlertDialog does we should settle which one we use going forward.

  • https://github.com/ankidroid/Anki-Android/pull/18748#discussion_r2202451785

david-allison avatar Jul 14 '25 02:07 david-allison

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Oct 12 '25 02:10 github-actions[bot]

@david-allison if this issue still percist i want to work in it

Aadarsh45 avatar Oct 27 '25 18:10 Aadarsh45

@Aadarsh45 There'll likely be some back & forth on this one, as it's design-related. Sure! But best to take it in steps

As a first step, could you summarize the changes we'll need to make?

david-allison avatar Oct 27 '25 18:10 david-allison

I am currently understanding the code but my approach is to manage ui things through app config

Aadarsh45 avatar Oct 27 '25 19:10 Aadarsh45

Please add support for dynamic color themes. As far as I understand it using material ui components does not make it automatically use dynamic colors. I added this comment to be able to close https://github.com/ankidroid/Anki-Android/issues/19301

idnovic avatar Oct 29 '25 20:10 idnovic

Let me explain why I think dynamic colours should be supported. In case this feature is unknown to anyone it basically themes the device colours matching to the wallpaper colours. It is an extension of the material design.

Looks cool. Theming is dependent on the users taste. It improves accessibility. Because I can choose a system theme that makes text more readable to me. Applications supporting dynamic colours fit design wise.

Applications not supporting dynamic colours look harsh in comparison. On my device the dynamic colour theme is greenish. This reduces the contrast of font to background and is less harsh on the eyes. But apps not supporting it use a white background with black text. These apps use the maximal possible contrast ratio. (~~Because they do not know what they are doing~~).

By web design standards it is not recommended to use the maximal possible contrast.

Books and paper do not use 100% black letters on 100% white background.

That is basically my reasoning. And I think it fits here because it is related to the material components color support you want to implement for certain surfaces. If you think of dynamic colour support from the beginning it would simplify it by not needing to rewrite thinks later on. And in contrast it should not complicate things because it is just an official extension of material design.

idnovic avatar Oct 29 '25 21:10 idnovic

https://material-foundation.github.io/material-theme-builder/ is a very useful tool once you reach the generation phase.

We need to fix:

  • DeckPicker
    • FAB
    • sync icon
  • Settings - Category text color
  • Manage Note Types - FAB
  • Study Screen
    • General lack of color
    • Show Answer
  • Snackbars -background and text
  • Rename Flags
  • Manage Columns
  • Help

Selecting the theme will be difficult, the md_theme_primary comes out much darker than what we currently use for the app bar

david-allison avatar Jan 29 '26 23:01 david-allison

  • https://github.com/ankidroid/Anki-Android/pull/20271 contains what I feel to be good 'base' colors to use.

david-allison avatar Jan 31 '26 20:01 david-allison

The new background colors don't mix well with the colors chosen in https://github.com/ankidroid/Anki-Android/pull/20271:

Image

ZornHadNoChoice avatar Mar 18 '26 13:03 ZornHadNoChoice

I don't think this should be added to 2.24, the proper fix is to decide on a full/proper theme colors setup and we kind of need a full release cycle for this IMO.

@ZornHadNoChoice Would something like this be better as a temporary fix until the theme is handled?

Light/Plain

ImageImage

Black/Dark

ImageImage

lukstbit avatar Mar 19 '26 05:03 lukstbit

Sorry for the confusion. The above dialog needs to be fixed for 2.24, not the full issue

I'd go with less 'bright' colors across the board for the buttons, but the concept works

david-allison avatar Mar 19 '26 11:03 david-allison

Would something like this be better as a temporary fix until the theme is handled?

They're readable so, yes.

ZornHadNoChoice avatar Mar 19 '26 11:03 ZornHadNoChoice