Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NightMode not working anymore since LocaleChangerAppCompatDelegate inroduction in v1.1 #20

Open
c0dehunter opened this issue Mar 24, 2021 · 0 comments

Comments

@c0dehunter
Copy link

c0dehunter commented Mar 24, 2021

I am using AppCompatDelegate.setDefaultNightMode(b ? AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO); to toggle between dark and normal mode in my app's settings. It seems the new LocaleChangerAppCompatDelegate is causing this functionality to malfunction (the app stays in weird state and colors are not correct).

If I remove this from MainActivity it works well:

private LocaleChangerAppCompatDelegate localeChangerAppCompatDelegate;

@NonNull
@Override
public AppCompatDelegate getDelegate() {
    if (localeChangerAppCompatDelegate == null) {
        localeChangerAppCompatDelegate = new LocaleChangerAppCompatDelegate(super.getDelegate());
    }

    return localeChangerAppCompatDelegate;
}

I am using LocaleChanger 1.1 and AppCompat 1.2.0 (latest).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant