From 25313d11fe5c675a236e16f92340afada6e7a828 Mon Sep 17 00:00:00 2001 From: nrj022 <0602smj@gmail.com> Date: Wed, 21 Feb 2024 09:41:18 +0900 Subject: [PATCH] =?UTF-8?q?[UI]#24=20=EB=8F=99=ED=99=94=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20UI=20=EC=88=98=EC=B9=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/green/comma/ui/compose/PreviewFairytaleListItem.kt | 6 ++++-- .../com/green/comma/ui/fairytale/FairytaleDetailActivity.kt | 2 +- app/src/main/java/com/green/comma/ui/home/HomeFragment.kt | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/green/comma/ui/compose/PreviewFairytaleListItem.kt b/app/src/main/java/com/green/comma/ui/compose/PreviewFairytaleListItem.kt index 921e9d9..b37fb51 100644 --- a/app/src/main/java/com/green/comma/ui/compose/PreviewFairytaleListItem.kt +++ b/app/src/main/java/com/green/comma/ui/compose/PreviewFairytaleListItem.kt @@ -9,15 +9,17 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import coil.compose.AsyncImage @Composable -fun PreviewFairytaleListItem(imgUrl: String?){ +fun PreviewFairytaleListItem(imgUrl: String?, width: Dp, paddingEnd: Dp){ Surface( modifier = Modifier - .width(360.dp) + .width(width) .height(113.dp) + .padding(end = paddingEnd) .clickable { }, color = Color.White, onClick = {} diff --git a/app/src/main/java/com/green/comma/ui/fairytale/FairytaleDetailActivity.kt b/app/src/main/java/com/green/comma/ui/fairytale/FairytaleDetailActivity.kt index 3ddd788..d205826 100644 --- a/app/src/main/java/com/green/comma/ui/fairytale/FairytaleDetailActivity.kt +++ b/app/src/main/java/com/green/comma/ui/fairytale/FairytaleDetailActivity.kt @@ -83,7 +83,7 @@ class FairytaleDetailActivity : AppCompatActivity() { binding.composeViewFairytaleRecommend.apply { setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) setContent { - PreviewFairytaleListItem(imgUrl = detailData.recommendImageUrl) + PreviewFairytaleListItem(imgUrl = detailData.recommendImageUrl, 330.dp, 0.dp) } } } diff --git a/app/src/main/java/com/green/comma/ui/home/HomeFragment.kt b/app/src/main/java/com/green/comma/ui/home/HomeFragment.kt index 7d86c42..dbfd065 100644 --- a/app/src/main/java/com/green/comma/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/green/comma/ui/home/HomeFragment.kt @@ -124,9 +124,9 @@ class HomeFragment : Fragment() { setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) var itemCount = 2 setContent { - LazyRow(modifier = Modifier.padding(start = 20.dp)) { + LazyRow(modifier = Modifier.padding(start = 30.dp)) { items(itemCount) { item -> - PreviewFairytaleListItem(it.top2Fairytales[item].recommendImageUrl) + PreviewFairytaleListItem(it.top2Fairytales[item].recommendImageUrl, 300.dp, 20.dp) } } DisposableEffect(Unit) {