How to make compose AlertDialog Rtl?

Viewed 32

How to change a composable's direction like AlertDialog's content based on device locale?

1 Answers

You can change the LayoutDirection like this:

    CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl ) {
        ...
    }

and you can change LayoutDirection.Rtl vs LayoutDirection.Ltr based on the locale, which you can get from

LocalContext.current.resources.configuration.locales
Related