ChuckerTeam / chucker

🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device)
Apache License 2.0
3.78k stars 330 forks source link

Can not force ltr in RTL languages #1191

Open DHosseiny opened 4 months ago

DHosseiny commented 4 months ago

:writing_hand: Describe the bug

Our app is targeting Android 13(targetSdk 33) and we are forcing the app to be Persian (an rtl language) at first, but users can change to English in settings. Before targeting API level 33 chucker showed its views LTR when our app was RTL. But now it is RTL and that is not convenient. I guess that is because we are calling AppCompatDelegate.setApplicationLocales(LocaleList) in new changes. Somehow I want to force Chucker to be LTR. Is there any way to force it to be LTR? or It can be added?

:bomb: Steps to reproduce

Create a sample app force app language in application class onCreate to rtl language like: AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags("fa")) go to chucker and it is RTL

:wrench: Expected behavior

Set to Be Ltr with ChuckerInterceptor

:camera: Screenshots

308144380-ac71f873-1e83-4edf-a68d-f03114578765

:iphone: Tech info

tested on android 13 and 14 device

:page_facing_up: Additional context

cortinico commented 3 months ago

You should be able to do so by adding this in your styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Chucker.BaseTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
      <item name="android:layoutDirection">ltr</item>
    </style>
</resources>