YarikSOffice / lingver

Manage your application locale and language.
https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758
MIT License
512 stars 61 forks source link

Layout Direction bug after split-screen mode #39

Open TurKurT656 opened 4 years ago

TurKurT656 commented 4 years ago

I've set the locale with this code: Lingver.getInstance().setLocale(requireContext(), "fa") It use RTL layout direction. Everything works great, but when I use the app in split screen mode and then maximize it again layout direction resets to LTR (but it uses farsi strings).

How can I fix the issue?

YarikSOffice commented 4 years ago

I'd highly appreciate it if you could create a small sample project reproducing the issue. Otherwise, it's hard to find out the cause of the issue without looking into details of your implementation.

Thanks in advance!

TurKurT656 commented 4 years ago

I've created a sample repo for this: LingverTest

TurKurT656 commented 4 years ago

Steps to generate bug:

1)

1

2)

2

3)

3

4)

4

5)

5
hamedsilver commented 4 years ago

I have the same issue too.

TurKurT656 commented 3 years ago

@YarikSOffice did you see the sample?

vahid-m commented 3 years ago

I have the same issue when app goes landscape. The layout direction changed to system setting after changing direction. The activity config in manifest is android:configChanges="keyboardHidden|orientation|screenSize"

Kolyall commented 3 years ago

UpdateLocaleDelegate class doesn't have this : config.setLayoutDirection(targetLocale), so just put it to fun updateResources

YarikSOffice commented 3 years ago

@Kolyall I don't think I'd help since config.setLayoutDirection is being invoked automatically within config.setLocale/setLocales call.

Screenshot 2021-01-26 at 11 12 42
YarikSOffice commented 3 years ago

I've given it a few tries, but haven't found a solution yet. Marking the bug as a known issue for now.

mnayef95 commented 3 years ago

Any update on this? Because it's happening with the deep link too

YarikSOffice commented 3 years ago

I haven't found any solution yet.

If you provide a sample project, I can check whether your issue is related to this bug.