From 54ed83031c974c9f8dadb06033a2ee27ed741a42 Mon Sep 17 00:00:00 2001 From: pluu Date: Sat, 10 Feb 2024 23:17:06 +0900 Subject: [PATCH] Use, LocalInspectionMode --- .../episode/ui/compose/EpisodeItemUi.kt | 23 ++++++++++++++----- .../webtoon/weekly/ui/day/WeeklyItemUi.kt | 22 +++++++++++++----- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/features/ui-episode/src/main/java/com/pluu/webtoon/episode/ui/compose/EpisodeItemUi.kt b/features/ui-episode/src/main/java/com/pluu/webtoon/episode/ui/compose/EpisodeItemUi.kt index 6665ea0a..ee5d4af8 100644 --- a/features/ui-episode/src/main/java/com/pluu/webtoon/episode/ui/compose/EpisodeItemUi.kt +++ b/features/ui-episode/src/main/java/com/pluu/webtoon/episode/ui/compose/EpisodeItemUi.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight @@ -39,6 +40,7 @@ import com.pluu.webtoon.episode.R import com.pluu.webtoon.episode.compose.ImageInCircle import com.pluu.webtoon.model.EpisodeInfo import com.pluu.webtoon.ui.compose.theme.AppTheme +import com.pluu.webtoon.ui.compose.theme.md_theme_light_primary import com.pluu.webtoon.utils.applyAgent @Composable @@ -63,12 +65,20 @@ internal fun EpisodeItemUi( .height(100.dp) .clickable { onClicked(item) } ) { - Image( - modifier = Modifier.fillMaxSize(), - painter = painter, - contentScale = ContentScale.Crop, - contentDescription = null, - ) + if (LocalInspectionMode.current) { + Box( + modifier = Modifier + .fillMaxSize() + .background(md_theme_light_primary) + ) + } else { + Image( + modifier = Modifier.fillMaxSize(), + painter = painter, + contentScale = ContentScale.Crop, + contentDescription = null, + ) + } when (painter.state) { is AsyncImagePainter.State.Loading -> { @@ -203,6 +213,7 @@ private fun PreviewEpisodeItemUiOverlayUi() { EpisodeItemUiOverlayUi( modifier = Modifier .width(200.dp) + .background(md_theme_light_primary) .wrapContentHeight(unbounded = true), item = item, isRead = true diff --git a/features/ui-weekly/src/main/java/com/pluu/webtoon/weekly/ui/day/WeeklyItemUi.kt b/features/ui-weekly/src/main/java/com/pluu/webtoon/weekly/ui/day/WeeklyItemUi.kt index ae328b18..57bcc2ef 100644 --- a/features/ui-weekly/src/main/java/com/pluu/webtoon/weekly/ui/day/WeeklyItemUi.kt +++ b/features/ui-weekly/src/main/java/com/pluu/webtoon/weekly/ui/day/WeeklyItemUi.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight @@ -43,6 +44,7 @@ import com.pluu.webtoon.model.Status import com.pluu.webtoon.model.ToonInfo import com.pluu.webtoon.model.ToonInfoWithFavorite import com.pluu.webtoon.ui.compose.theme.AppTheme +import com.pluu.webtoon.ui.compose.theme.md_theme_light_primary import com.pluu.webtoon.utils.applyAgent import com.pluu.webtoon.weekly.R @@ -81,12 +83,20 @@ internal fun WeeklyItemUi( } Box(modifier = backgroundModifier) { - Image( - modifier = Modifier.fillMaxSize(), - painter = painter, - contentScale = ContentScale.Crop, - contentDescription = null, - ) + if (LocalInspectionMode.current) { + Box( + modifier = Modifier + .fillMaxSize() + .background(md_theme_light_primary) + ) + } else { + Image( + modifier = Modifier.fillMaxSize(), + painter = painter, + contentScale = ContentScale.Crop, + contentDescription = null, + ) + } when (painter.state) { is AsyncImagePainter.State.Loading -> {