Skip to content

Commit

Permalink
Use, LocalInspectionMode
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluu committed Feb 10, 2024
1 parent 686db0e commit 54ed830
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 -> {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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 -> {
Expand Down

0 comments on commit 54ed830

Please # to comment.