CatimaLoyalty / Android

Catima, a Loyalty Card & Ticket Manager for Android
https://catima.app
GNU General Public License v3.0
868 stars 151 forks source link

respect android system theme fully #950

Closed KraXen72 closed 1 year ago

KraXen72 commented 2 years ago

currently the FABs don't respect android12 system theme: Screenshot_20220723-223650_Catima.png Screenshot_20220723-223706_Catima.png
in comparison, here is my android system theme:
Screenshot_20220723-223723_Auxio.png

TheLastProject commented 2 years ago

Just a few questions:

  1. What manufacturer is your device from? Google has decided to only allowlist certain manufacturers for Android 12 Material colours (see https://www.androidpolice.com/material-you-android-13-allowlist/ for more info)
  2. You're showing different colours on the main and view screen, I think that may be an already fixed bug which will be part of the next release: https://github.com/CatimaLoyalty/Android/commit/c35fe166edffe369576f713898f4b6b2658dfa8a
  3. What theme are you using in Catima settings? Is it "System"?

It's really hard to get this stuff right, I honestly don't understand why anything is even "not correct" because I just use the default Android components and don't manually change colours. But if someone can improve things and with documentation prove that that's the correct way to do it that would be welcome.

KraXen72 commented 2 years ago

i'm using Theme: Dark, Theme color: system. on Samsung Galaxy M21 android 12 update

KraXen72 commented 2 years ago

the second screensht is Auxio, another open source app. you could maybe take a look at it's monet/a12 colors implementation?https://github.com/OxygenCobalt/Auxio

TheLastProject commented 2 years ago

Samsung devices are only supported for Material Colours if they have at least "OneUI 40100". This is a restriction on Google's side. I'm not sure if that number is displayed anywhere, but I'd assume this would be a "OneUI 4.1.0" version number or something in the settings. Are you sure your OneUI version is new enough to be supported?

I also just released Catima 2.18.1, which should have fixed the second point I listed. Maybe that's relevant?

KraXen72 commented 2 years ago

i have oneui 4.1

KraXen72 commented 2 years ago

Edit by TheLastProject: Removed screenshot with text "App not installed as package conflicts with an existing package."

Altonss commented 2 years ago

Edit by TheLastProject: Removed screenshot with text "App not installed as package conflicts with an existing package."

You probably already have Catima installed via another source (Google Play or FDroid) that's why the installation via apk is failing I think. (Be carefull, if you have overseen, some personnal information is visible on your screenshot).

KraXen72 commented 2 years ago

thanks i forgot i had photos there, i tried to update from fdroid but the update was not there yet

TheLastProject commented 2 years ago

i have oneui 4.1

Hmm, that sounds like it'll probably be version code "40100". So probably supported then.

i tried to update from fdroid but the update was not there yet

It'll take a few days for F-Droid to update, see https://gitlab.com/fdroid/wiki/-/wikis/FAQ#how-long-does-it-take-for-my-app-to-show-up-on-website-and-client for more info. Because F-Droid signs the app with its own signature you can't switch to the GitHub version without manually uninstalling Catima (but you could use Catima's import/export feature to keep your data).

Given I probably can't get into fixing this if it's still not perfect in the latest release any time soon anyway as there's a huge backlog of issues I personally find more important (although PRs with documentation from Google as to why the change is the correct change would be welcome) I wouldn't worry about updating right now, it can wait :)

the4anoni commented 2 years ago

I am using version 2.20.0 from IzzyOnDroid repo, and I don't have option to respect material You theme. Galaxy S10, Android 13 LineageOS.

TheLastProject commented 2 years ago

I am using version 2.20.0 from IzzyOnDroid repo, and I don't have option to respect material You theme. Galaxy S10, Android 13 LineageOS.

Settings -> Theme color -> System should use Material You colours when Google's "Material Components" library says it's supported. In your case, you seem to be running into hacky Google code returning unsupported on all Samsung devices which doesn't have OneUI (so: custom ROMs like LineageOS): https://github.com/material-components/material-components-android/issues/2677.

Google promised they would fix this for Android 13, but looking at https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/color/DynamicColors.java#L55-L72, if I understand this code correctly they still haven't. I've asked Google for an update on this issue here: https://github.com/material-components/material-components-android/issues/2677#issuecomment-1265383193

the4anoni commented 2 years ago

I am using version 2.20.0 from IzzyOnDroid repo, and I don't have option to respect material You theme. Galaxy S10, Android 13 LineageOS.

Settings -> Theme color -> System should use Material You colours when Google's "Material Components" library says it's supported. In your case, you seem to be running into hacky Google code returning unsupported on all Samsung devices which doesn't have OneUI (so: custom ROMs like LineageOS): material-components/material-components-android#2677.

Google promised they would fix this for Android 13, but looking at https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/color/DynamicColors.java#L55-L72, if I understand this code correctly they still haven't. I've asked Google for an update on this issue here: material-components/material-components-android#2677 (comment)

I don't see system as option at all. Every other app (FairMail, LibreTube) do have working Material You.