collect icon indicating copy to clipboard operation
collect copied to clipboard

Icons/text use wrong colors immediately after changing themes

Open seadowg opened this issue 3 years ago • 0 comments

Software and hardware versions

Collect v2021.3, Android 11

Problem description

Some icons or text can end up using the previous theme's colors after changing between them in Collect (but not when changing the system theme while using "Use device theme"). An example is the x icon in the settings dialog:

Screenshot_1632429040 Screenshot_1632429092

Steps to reproduce the problem

  1. Open settings dialog
  2. Change theme to light or dark (whatever is the opposite of the current theme)
  3. Open settings dialog

Sometimes icons will be loaded with the previous theme's colors. The problem disappears after reopening the app.

Expected behavior

Icons should always use the current theme's colors.

Other information

Reason for "Won't fix"

This appears to be a bug in Android's appcompat library (https://issuetracker.google.com/issues/195570263) and it's not an issue that will affect many people and if it does, it only causes problems temporarily. This is especially true now that we use the system theme by default and this issue only exists on operating system versions that support system level dark/light mode. Hopefully the appcompat team will resolve this.

A possible workaround is to pull out specific light and dark themes for the app. This would require moving back to dynamically setting themes in Activity objects and also requires us to maintain three different themes (a day/night one, a light one and a dark one) which doesn't feel worth the cost.

Another possible workaround is to rework when AppCompatDelegate.setDefaultNightMode is called to force the light or dark mode. Ideally, we'd only call this in Application#onCreate but as we need to change themes when changing profiles, that's not possible. It's unclear if we'd end up with anything we could depend if we went down this road.

seadowg avatar Sep 27 '21 11:09 seadowg