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

Does not work with 'appcompat:1.1.0' #6

Closed
ValentinTaleb opened this issue Sep 26, 2019 · 6 comments
Closed

Does not work with 'appcompat:1.1.0' #6

ValentinTaleb opened this issue Sep 26, 2019 · 6 comments

Comments

@ValentinTaleb
Copy link

Everything works fine until you update appcompat from implementation 'androidx.appcompat:appcompat:1.0.2' to implementation 'androidx.appcompat:appcompat:1.1.0

How can we fix this problem?

(More information about this issue here: https://stackoverflow.com/questions/55265834/change-locale-not-work-after-migrate-to-androidx)

Thank you very much :)

@YarikSOffice
Copy link
Owner

Hi @ValentinTaleb
It would be helpful if you could provide a little more elaborate description.

  1. What is the issue exactly?
  2. What branch are you using? since there are 2 different approaches in the repository

@ValentinTaleb
Copy link
Author

ValentinTaleb commented Sep 26, 2019

Hi,

Sorry I didn't give a lot of information.

If I run the master branch on my device, everything is working perfectly and the language change as expected when I press the button to change the language.

As soon as I update the appcompat library in build.gradle (from implementation 'androidx.appcompat:appcompat:1.0.2' to implementation 'androidx.appcompat:appcompat:1.1.0), the language does not change anymore when you press the same button :)

@YarikSOffice
Copy link
Owner

YarikSOffice commented Oct 8, 2019

Hi @ValentinTaleb
According to the stackoverflow post and other issues on issuetracker.google.com, this is a bug related to the dark mode (happens on API 21-25).

Luckily, it's going to be fixed in the upcoming versions of appcompat (1.2.0-alphaXX and 1.1.1).

In meanwhile, you can use the workaround suggested in the stackoverflow post or use another technique for language change presented in this repository.

Thanks for your contribution!

@UriahShaulMandel
Copy link

If anyone encounters this issue, and is still waiting for 1.1.1 or 1.2.0, the following stackoverflow answer worked for me on 1.1.0 :
https://stackoverflow.com/a/61420643

@nicolabeghin
Copy link

nicolabeghin commented Aug 22, 2020

FYI: appcompat:1.2.0 has been released on August 19th 2020

https://developer.android.com/jetpack/androidx/releases/appcompat

Still cannot change language with versions > 1.2.0, but here's some input about https://stackoverflow.com/a/58004553/2378095

@YarikSOffice
Copy link
Owner

According to my tests, the version 1.2.0 indeed fixes the issue for this sample project.

However, if you use ContextWrapper or ContextThemeWrapper you need to implement a workaround according to the link mentioned by @nicolabeghin.

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

4 participants