https://kotlinlang.org logo
#compose
Title
# compose
a

ascii

10/12/2023, 5:08 AM
Building upon Elias' thread just above mine, I too have encountered a similar Preview bug, but with locale & layout direction instead.
Building upon Elias' thread above, I too have encountered a similar Preview bug, but with locale & layout direction instead. This:
Copy code
@Preview("Default")            // locale defaults to ""
@Preview("RTL", locale = "ar") // Arabic for RTL
@Composable
fun Something() {
    Text(stringResource(R.string.loading))
}
gives us that:
image.png
Explicitly using
locale = "en"
makes it go away, but I don't see why it should, when we can clearly see that strings are already correctly localized. Just that layout direction is picked up from "ar" (or perhaps the last @Preview annotation).
Switching the order makes me believe it is indeed the last Preview annotation that borks it up.
A couple of refreshes later — adding a space and deleting it — this is what happens. Now it's picking up the string from
ar
, but layout direction from
""
(default).
I'd create an issue, but :/
i

Ian Lake

10/12/2023, 5:52 AM
All bugs filed against Android Studio go into the root component - that's how it gets into their triage process and moved by the Studio team to the correct subcomponent. So just file it there
a

ascii

10/12/2023, 6:23 AM