Closed AlirezaIvaz closed 1 year ago
Thanks for reporting this. I have to look closely into this problem. If anyone has bandwidth to look into it and send a fix would be really appreaciated š
I think it's similar to #926. There the configuration changes not available at the already created fragment. I will have a look and try to fix it next days.
almost a year, any fixes on this would be appreciated
Yes you are right! I already tried to find the problem, but not sure where the problem for this behavior is. Maybe you have any suggestion for this? If not you need to wait ;-)
As mentioned, we're welcome to receive a PR with this fix š
Hi
I had to add a hack which used to work earlier before android N, fortunately that works even now, I added below code to my activity attachBaseContext method and it all started working
@Override
protected void attachBaseContext(Context newBase) {
Resources resources = getApplicationContext().getResources();
Configuration configuration = new Configuration(resources.getConfiguration());
Locale locale = new Locale(LocaleUtil.getLanguage(), "");
configuration.setLocale(locale);
getApplicationContext().getResources().updateConfiguration(configuration, getApplicationContext().getResources().getDisplayMetrics());
}
The real problem is with the below code in AppIntroBase.kt which uses application context for locale detection while as per android, we should use base context or say Activity context to detect the locale
internal val isRtl: Boolean
get() = LayoutUtil.isRtl(applicationContext)
Hope this helps
I think your hints are the missing thing. I will have a look again, thank you!
š Describe the bug
When the default language of the system is Persian (RTL), the intro is displayed without any problems and correctly. But when the language of the system is not Persian (e.g. English) and we change the language of the app to Persian manually, the intro is still LTR and the slide shows the beginning and the end incorrectly. If you pay attention to the screenshots, you will understand better. I have tried all the old and new methods but in all of them this problem persists. Of course, there are no problems with other activities and they are displayed correctly.
š£ Steps to reproduce
Adding this code in activity:
Of course, I tried many other codes, and this was the simplest code available.
š· Screenshots
This screenshot is when the language of the system itself is Persian:
But this screenshot is when the system language is English and I manually changed the app language to Persian
š± Tech info