From 9091abf09ef252be1eeac67cfd16fff4a8522a62 Mon Sep 17 00:00:00 2001 From: Keisuke Takagi Date: Wed, 8 Feb 2023 22:52:45 +0900 Subject: [PATCH] Provide true to LocalInspectionMode --- .../nowinandroid/core/ui/NewsResourceCard.kt | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt index ae6cadbfa..90d2266f0 100644 --- a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt +++ b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt @@ -35,6 +35,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -301,14 +302,18 @@ private fun ExpandedNewsResourcePreview( @PreviewParameter(UserNewsResourcePreviewParameterProvider::class) userNewsResources: List, ) { - NiaTheme { - Surface { - NewsResourceCardExpanded( - userNewsResource = userNewsResources[0], - isBookmarked = true, - onToggleBookmark = {}, - onClick = {}, - ) + CompositionLocalProvider( + LocalInspectionMode provides true + ) { + NiaTheme { + Surface { + NewsResourceCardExpanded( + userNewsResource = userNewsResources[0], + isBookmarked = true, + onToggleBookmark = {}, + onClick = {}, + ) + } } } }