As said by claude
Describe the bug
When the system Material You palette changes while LeanType is running, the keyboard with the Dynamic colors theme keeps showing the old colors. LeanType's settings screen updates to the new palette right away, but the keyboard doesn't update until LeanType is force-stopped.
To Reproduce
- Select the Dynamic colors keyboard theme.
- Change the system Material You palette. In my case, ColorBlendr (Shizuku mode) re-applies colors each time Paperize sets a new static wallpaper. Changing colors manually in ColorBlendr gives the same result.
- Open LeanType settings: the new colors are shown correctly.
- Open the keyboard in any text field: it still shows the previous palette.
- Force-stop LeanType and open the keyboard again: the new colors appear.
Expected behavior
The keyboard picks up the new system palette the next time it's shown, like the settings screen does.
Screenshots
N/A
App version & Flavor
[version, e.g. v4.2.x] / standard
Device Info
- Model: Samsung Galaxy Z Fold 6
- OS version: [Android version] / One UI [version]
Additional context (possible cause)
From reading the source, this might be the cause (unconfirmed):
DynamicColors (latin/common/Colors.kt) reads system_accent* / system_neutral* once in its constructor.
KeyboardSwitcher.updateKeyboardThemeAndContextThemeWrapper() checks mColors.haveColorsChanged(context) on onStartInputView, but the context passed in is displayContext, which is created once in onInitializeInterface() and reused.
- If that long-lived context keeps returning the old
system_* values after the theme overlay changes, haveColorsChanged() returns false and the theme never reloads. The settings activity gets a fresh context, so it isn't affected.
Workaround: force-stopping LeanType loads the current colors.
As said by claude
Describe the bug
When the system Material You palette changes while LeanType is running, the keyboard with the Dynamic colors theme keeps showing the old colors. LeanType's settings screen updates to the new palette right away, but the keyboard doesn't update until LeanType is force-stopped.
To Reproduce
Expected behavior
The keyboard picks up the new system palette the next time it's shown, like the settings screen does.
Screenshots
N/A
App version & Flavor
[version, e.g. v4.2.x] / standard
Device Info
Additional context (possible cause)
From reading the source, this might be the cause (unconfirmed):
DynamicColors(latin/common/Colors.kt) readssystem_accent*/system_neutral*once in its constructor.KeyboardSwitcher.updateKeyboardThemeAndContextThemeWrapper()checksmColors.haveColorsChanged(context)ononStartInputView, but the context passed in isdisplayContext, which is created once inonInitializeInterface()and reused.system_*values after the theme overlay changes,haveColorsChanged()returns false and the theme never reloads. The settings activity gets a fresh context, so it isn't affected.Workaround: force-stopping LeanType loads the current colors.