From 706497c1ec3701b5fc76d859e2a35233635e9d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=ABsungmin?= Date: Fri, 25 Oct 2024 18:19:18 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20:=20#3=20=EC=9D=B4=EB=AF=B8=EC=A7=80+?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EA=B2=B9=EC=B9=A8=20Box=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/component/BoxOverlayImage.kt | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 app/src/main/java/org/sopt/and/presentation/component/BoxOverlayImage.kt diff --git a/app/src/main/java/org/sopt/and/presentation/component/BoxOverlayImage.kt b/app/src/main/java/org/sopt/and/presentation/component/BoxOverlayImage.kt new file mode 100644 index 0000000..137bde9 --- /dev/null +++ b/app/src/main/java/org/sopt/and/presentation/component/BoxOverlayImage.kt @@ -0,0 +1,54 @@ +package org.sopt.and.presentation.component + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import org.sopt.and.ui.theme.White + +@Composable +fun BoxOverlayImage( + imageRes: Int, + overlayText: String, + modifier: Modifier = Modifier +) { + Box( + modifier = modifier + .width(180.dp) + .height(220.dp) + .clip(RoundedCornerShape(12.dp)) + ) { + // 이미지 + Image( + painter = painterResource(id = imageRes), + contentDescription = "Overlay Image", + contentScale = ContentScale.Crop, + modifier = Modifier.fillMaxSize() + ) + // overlayText + Text( + text = overlayText, + color = White, + fontSize = 48.sp, + fontWeight = FontWeight.Bold, + fontStyle = FontStyle.Italic, + modifier = Modifier + .align(Alignment.BottomStart) + .padding(8.dp, top = 16.dp) + ) + } +}