Skip to content

Dynamic Colors doesn't update #560

Description

@BigJonGoodwin

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

  1. Select the Dynamic colors keyboard theme.
  2. 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.
  3. Open LeanType settings: the new colors are shown correctly.
  4. Open the keyboard in any text field: it still shows the previous palette.
  5. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions