Skip to content

Commit c8010bb

Browse files
committed
Respect RTL locale in settings sheet
1 parent ab1d0da commit c8010bb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎app/src/main/java/com/example/ui/components/CodeinSheets.kt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ fun CodeinSettingsSheet(
5353
isConnected: Boolean
5454
) {
5555
val context = LocalContext.current
56-
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Ltr) {
56+
// Keep settings controls aligned with the user's language instead of forcing
57+
// English layout direction on Persian/Arabic devices.
58+
val settingsDirection = if (
59+
context.resources.configuration.locales[0].language in setOf("fa", "ar", "he", "ur")
60+
) LayoutDirection.Rtl else LayoutDirection.Ltr
61+
CompositionLocalProvider(LocalLayoutDirection provides settingsDirection) {
5762
ModalBottomSheet(
5863
onDismissRequest = onDismiss,
5964
sheetState = sheetState,

0 commit comments

Comments
 (0)