diff --git a/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt b/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt index a144627c..fe51e2e4 100644 --- a/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt +++ b/snapshots/sample/app/src/main/kotlin/com/emergetools/snapshots/sample/ui/TextRowWithIcon.kt @@ -40,8 +40,8 @@ fun TextRowWithIconPreviewFromMain() { @Composable fun TextRowWithIconPreviewFromMainJustMultiPreview() { TextRowWithIcon( - titleText = "Title", - subtitleText = "Subtitle" + titleText = stringResource(com.emergetools.snapshots.sample.R.string.sample_title), + subtitleText = stringResource(com.emergetools.snapshots.sample.R.string.sample_subtitle) ) } diff --git a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/SnapshotVariantProvider.kt b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/SnapshotVariantProvider.kt index 24e9edff..792e9cc2 100644 --- a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/SnapshotVariantProvider.kt +++ b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/SnapshotVariantProvider.kt @@ -4,6 +4,7 @@ import android.content.res.Configuration import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Density import com.emergetools.snapshots.shared.ComposePreviewSnapshotConfig @@ -19,11 +20,12 @@ fun SnapshotVariantProvider( val localConfiguration = Configuration(LocalConfiguration.current).apply { config.uiMode?.let { uiMode = it } - config.locale?.let { setLocale(Locale(it)) } + val locale = config.locale?.let { Locale(it) } ?: Locale.getDefault() + setLocale(locale) } val providedValues = arrayOf( - LocalConfiguration provides localConfiguration, + LocalContext provides LocalContext.current.createConfigurationContext(localConfiguration), config.fontScale?.let { LocalDensity provides fontScaleDensity } ) CompositionLocalProvider(