Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Dark Mode Problem With MODE_NIGHT_FOLLOW_SYSTEM Selected #52

Closed
berkayturanci opened this issue Mar 25, 2020 · 1 comment
Closed

Dark Mode Problem With MODE_NIGHT_FOLLOW_SYSTEM Selected #52

berkayturanci opened this issue Mar 25, 2020 · 1 comment
Labels

Comments

@berkayturanci
Copy link

berkayturanci commented Mar 25, 2020

There is an error on the library where if user want to use Dark Mode with flag MODE_NIGHT_FOLLOW_SYSTEM.

MODE_NIGHT_NO, MODE_NIGHT_YES or MODE_NIGHT_AUTO_BATTERY works fine and only problem occurs due to the selection of MODE_NIGHT_FOLLOW_SYSTEM.

Once system dark mode is changed, the application did not restarted with proper dark mode theme in MODE_NIGHT_FOLLOW_SYSTEM selected.

The problem caused due to the Application class method overriding.

Causes Error:

    @Override
    protected void attachBaseContext(Context base) {
        deviceLanguage = Util.getDeviceLanguage();
        super.attachBaseContext(localizationDelegate.attachBaseContext(base));
    }

Not Causes Error, but Language changing doesn't work in this way:

    @Override
    protected void attachBaseContext(Context base) {
        localizationDelegate.setDefaultLanguage(base, MainApp.getDeviceLanguage());
        localizationDelegate.attachBaseContext(base);
        super.attachBaseContext(base);
    }

Version: 1.2.4

@akexorcist akexorcist added the bug label Apr 15, 2020
@akexorcist
Copy link
Owner

Fixed on 1.2.5.

Thank you so much for your feedback.

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

No branches or pull requests

2 participants