A fully functional Android app built entirely with Kotlin and Jetpack Compose
Fix punctuation and alignment for English text in RTL locales by forcing LTR text direction and left alignment globally in typography"
Mayokun Yusufdd17e11538fb
diff --git a/app/src/testDemo/screenshots/compactWidth_compactHeight_showsNavigationBar.png b/app/src/testDemo/screenshots/compactWidth_compactHeight_showsNavigationBar.pngindex 382eb032b..7a49b2c32 100644Binary files a/app/src/testDemo/screenshots/compactWidth_compactHeight_showsNavigationBar.png and b/app/src/testDemo/screenshots/compactWidth_compactHeight_showsNavigationBar.png differdiff --git a/app/src/testDemo/screenshots/compactWidth_expandedHeight_showsNavigationBar.png b/app/src/testDemo/screenshots/compactWidth_expandedHeight_showsNavigationBar.pngindex cde193ce9..ab20746cb 100644Binary files a/app/src/testDemo/screenshots/compactWidth_expandedHeight_showsNavigationBar.png and b/app/src/testDemo/screenshots/compactWidth_expandedHeight_showsNavigationBar.png differdiff --git a/app/src/testDemo/screenshots/compactWidth_mediumHeight_showsNavigationBar.png b/app/src/testDemo/screenshots/compactWidth_mediumHeight_showsNavigationBar.pngindex 4a8c93d96..926ce00f1 100644Binary files a/app/src/testDemo/screenshots/compactWidth_mediumHeight_showsNavigationBar.png and b/app/src/testDemo/screenshots/compactWidth_mediumHeight_showsNavigationBar.png differdiff --git a/app/src/testDemo/screenshots/expandedWidth_compactHeight_showsNavigationBar.png b/app/src/testDemo/screenshots/expandedWidth_compactHeight_showsNavigationBar.pngindex f0a85e137..d793bed51 100644Binary files a/app/src/testDemo/screenshots/expandedWidth_compactHeight_showsNavigationBar.png and b/app/src/testDemo/screenshots/expandedWidth_compactHeight_showsNavigationBar.png differdiff --git a/app/src/testDemo/screenshots/expandedWidth_expandedHeight_showsNavigationRail.png b/app/src/testDemo/screenshots/expandedWidth_expandedHeight_showsNavigationRail.pngindex 222fc21aa..b6f89e516 100644Binary files a/app/src/testDemo/screenshots/expandedWidth_expandedHeight_showsNavigationRail.png and b/app/src/testDemo/screenshots/expandedWidth_expandedHeight_showsNavigationRail.png differdiff --git a/app/src/testDemo/screenshots/expandedWidth_mediumHeight_showsNavigationRail.png b/app/src/testDemo/screenshots/expandedWidth_mediumHeight_showsNavigationRail.pngindex a33ad8863..2bf46ca4f 100644Binary files a/app/src/testDemo/screenshots/expandedWidth_mediumHeight_showsNavigationRail.png and b/app/src/testDemo/screenshots/expandedWidth_mediumHeight_showsNavigationRail.png differdiff --git a/app/src/testDemo/screenshots/insets_snackbar_expanded_expanded.png b/app/src/testDemo/screenshots/insets_snackbar_expanded_expanded.pngindex f5d5c2d18..becfe5715 100644Binary files a/app/src/testDemo/screenshots/insets_snackbar_expanded_expanded.png and b/app/src/testDemo/screenshots/insets_snackbar_expanded_expanded.png differdiff --git a/app/src/testDemo/screenshots/insets_snackbar_medium_medium.png b/app/src/testDemo/screenshots/insets_snackbar_medium_medium.pngindex 52a32c385..578ff0b6d 100644Binary files a/app/src/testDemo/screenshots/insets_snackbar_medium_medium.png and b/app/src/testDemo/screenshots/insets_snackbar_medium_medium.png differdiff --git a/app/src/testDemo/screenshots/mediumWidth_compactHeight_showsNavigationBar.png b/app/src/testDemo/screenshots/mediumWidth_compactHeight_showsNavigationBar.pngindex deeede5e4..64cf8f32f 100644Binary files a/app/src/testDemo/screenshots/mediumWidth_compactHeight_showsNavigationBar.png and b/app/src/testDemo/screenshots/mediumWidth_compactHeight_showsNavigationBar.png differdiff --git a/app/src/testDemo/screenshots/mediumWidth_expandedHeight_showsNavigationRail.png b/app/src/testDemo/screenshots/mediumWidth_expandedHeight_showsNavigationRail.pngindex 882e62760..679846fc1 100644Binary files a/app/src/testDemo/screenshots/mediumWidth_expandedHeight_showsNavigationRail.png and b/app/src/testDemo/screenshots/mediumWidth_expandedHeight_showsNavigationRail.png differdiff --git a/app/src/testDemo/screenshots/mediumWidth_mediumHeight_showsNavigationRail.png b/app/src/testDemo/screenshots/mediumWidth_mediumHeight_showsNavigationRail.pngindex 8ffe73e86..b8ddeb12b 100644Binary files a/app/src/testDemo/screenshots/mediumWidth_mediumHeight_showsNavigationRail.png and b/app/src/testDemo/screenshots/mediumWidth_mediumHeight_showsNavigationRail.png differdiff --git a/app/src/testDemo/screenshots/snackbar_compact_medium.png b/app/src/testDemo/screenshots/snackbar_compact_medium.pngindex 910cccfc2..ad12a4173 100644Binary files a/app/src/testDemo/screenshots/snackbar_compact_medium.png and b/app/src/testDemo/screenshots/snackbar_compact_medium.png differdiff --git a/app/src/testDemo/screenshots/snackbar_compact_medium_noSnackbar.png b/app/src/testDemo/screenshots/snackbar_compact_medium_noSnackbar.pngindex 8ad664d3a..bc466edcb 100644Binary files a/app/src/testDemo/screenshots/snackbar_compact_medium_noSnackbar.png and b/app/src/testDemo/screenshots/snackbar_compact_medium_noSnackbar.png differdiff --git a/app/src/testDemo/screenshots/snackbar_expanded_expanded.png b/app/src/testDemo/screenshots/snackbar_expanded_expanded.pngindex b429a7315..fc98037a6 100644Binary files a/app/src/testDemo/screenshots/snackbar_expanded_expanded.png and b/app/src/testDemo/screenshots/snackbar_expanded_expanded.png differdiff --git a/app/src/testDemo/screenshots/snackbar_medium_medium.png b/app/src/testDemo/screenshots/snackbar_medium_medium.pngindex 00e9e3051..1dfc73e5a 100644Binary files a/app/src/testDemo/screenshots/snackbar_medium_medium.png and b/app/src/testDemo/screenshots/snackbar_medium_medium.png differdiff --git a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/theme/Type.kt b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/theme/Type.ktindex 82d769863..9b461dc0c 100644--- a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/theme/Type.kt+++ b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/theme/Type.kt@@ -22,6 +22,8 @@ import androidx.compose.ui.text.font.FontWeightimport androidx.compose.ui.text.style.LineHeightStyleimport androidx.compose.ui.text.style.LineHeightStyle.Alignmentimport androidx.compose.ui.text.style.LineHeightStyle.Trim+import androidx.compose.ui.text.style.TextDirection+import androidx.compose.ui.text.style.TextAlignimport androidx.compose.ui.unit.sp/**@@ -33,30 +35,40 @@ internal val NiaTypography = Typography(fontSize = 57.sp,lineHeight = 64.sp,letterSpacing = (-0.25).sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),displayMedium = TextStyle(fontWeight = FontWeight.Normal,fontSize = 45.sp,lineHeight = 52.sp,letterSpacing = 0.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),displaySmall = TextStyle(fontWeight = FontWeight.Normal,fontSize = 36.sp,lineHeight = 44.sp,letterSpacing = 0.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),headlineLarge = TextStyle(fontWeight = FontWeight.Normal,fontSize = 32.sp,lineHeight = 40.sp,letterSpacing = 0.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),headlineMedium = TextStyle(fontWeight = FontWeight.Normal,fontSize = 28.sp,lineHeight = 36.sp,letterSpacing = 0.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),headlineSmall = TextStyle(fontWeight = FontWeight.Normal,@@ -67,6 +79,8 @@ internal val NiaTypography = Typography(alignment = Alignment.Bottom,trim = Trim.None,),+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),titleLarge = TextStyle(fontWeight = FontWeight.Bold,@@ -77,18 +91,24 @@ internal val NiaTypography = Typography(alignment = Alignment.Bottom,trim = Trim.LastLineBottom,),+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),titleMedium = TextStyle(fontWeight = FontWeight.Bold,fontSize = 18.sp,lineHeight = 24.sp,letterSpacing = 0.1.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),titleSmall = TextStyle(fontWeight = FontWeight.Medium,fontSize = 14.sp,lineHeight = 20.sp,letterSpacing = 0.1.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),// Default text stylebodyLarge = TextStyle(@@ -100,18 +120,24 @@ internal val NiaTypography = Typography(alignment = Alignment.Center,trim = Trim.None,),+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),bodyMedium = TextStyle(fontWeight = FontWeight.Normal,fontSize = 14.sp,lineHeight = 20.sp,letterSpacing = 0.25.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),bodySmall = TextStyle(fontWeight = FontWeight.Normal,fontSize = 12.sp,lineHeight = 16.sp,letterSpacing = 0.4.sp,+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),// Used for ButtonlabelLarge = TextStyle(@@ -123,6 +149,8 @@ internal val NiaTypography = Typography(alignment = Alignment.Center,trim = Trim.LastLineBottom,),+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),// Used for Navigation itemslabelMedium = TextStyle(@@ -134,6 +162,8 @@ internal val NiaTypography = Typography(alignment = Alignment.Center,trim = Trim.LastLineBottom,),+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),// Used for TaglabelSmall = TextStyle(@@ -145,5 +175,7 @@ internal val NiaTypography = Typography(alignment = Alignment.Center,trim = Trim.LastLineBottom,),+ textDirection = TextDirection.Ltr,+ textAlign = TextAlign.Left,),)diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.pngindex 3990aee3f..e4ecf6d95 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png differdiff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.pngindex 3b735462f..53891bdc1 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png differdiff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.pngindex bc9c7dbec..ba669e8f8 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png differdiff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.pngindex 2b16ff76f..e92ae0481 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png differdiff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.pngindex 7ea92f8a8..3ae1bee94 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.png differdiff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.pngindex b2faa3a28..0938678b2 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.png differdiff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.pngindex 4c30995b2..084d031a5 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png differdiff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.pngindex 05f1ba1ed..35f59e54c 100644Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.png differ