Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions common/resource/src/main/res/drawable/ic_detail_rigt.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="17dp"
android:viewportWidth="16"
android:viewportHeight="17">
<path
android:pathData="M6,13.834L11.333,8.5L6,3.167"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#454545"
android:strokeLineCap="round"/>
<path
android:pathData="M6,13.834L11.333,8.5L6,3.167"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#454545"
android:strokeLineCap="round"/>
</vector>
14 changes: 14 additions & 0 deletions common/resource/src/main/res/drawable/img_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:pathData="M16,0L16,0A16,16 0,0 1,32 16L32,16A16,16 0,0 1,16 32L16,32A16,16 0,0 1,0 16L0,16A16,16 0,0 1,16 0z"
android:fillColor="#ffffff"
android:fillAlpha="0.9"/>
<path
android:pathData="M10.862,10.862C11.122,10.602 11.544,10.602 11.805,10.862L16,15.057L20.195,10.862C20.456,10.602 20.878,10.602 21.138,10.862C21.398,11.123 21.398,11.545 21.138,11.805L16.943,16L21.138,20.196C21.398,20.456 21.398,20.878 21.138,21.138C20.878,21.399 20.456,21.399 20.195,21.138L16,16.943L11.805,21.138C11.544,21.399 11.122,21.399 10.862,21.138C10.602,20.878 10.602,20.456 10.862,20.196L15.057,16L10.862,11.805C10.602,11.545 10.602,11.123 10.862,10.862Z"
android:fillColor="#1A1A1A"
android:fillType="evenOdd"/>
</vector>
13 changes: 13 additions & 0 deletions common/resource/src/main/res/drawable/img_management.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="49dp"
android:height="32dp"
android:viewportWidth="49"
android:viewportHeight="32">
<path
android:pathData="M16,0L33,0A16,16 0,0 1,49 16L49,16A16,16 0,0 1,33 32L16,32A16,16 0,0 1,0 16L0,16A16,16 0,0 1,16 0z"
android:fillColor="#ffffff"
android:fillAlpha="0.9"/>
<path
android:pathData="M19.342,10.219V10.998C19.342,11.859 19.342,13.104 19.055,14.648L17.346,14.484C17.571,13.295 17.626,12.386 17.64,11.641H12.943V10.219H19.342ZM12.205,15.551C12.902,15.551 13.689,15.551 14.516,15.53V13.09H16.252V15.476C17.496,15.421 18.761,15.325 19.93,15.154L20.025,16.412C17.435,16.891 14.523,16.938 12.356,16.945L12.205,15.551ZM14.037,21.539V17.793H15.787V20.145H22.773V21.539H14.037ZM20.6,18.627V9.316H22.391V13.104H23.895V14.566H22.391V18.627H20.6ZM34.9,9.316V21.785H33.164V9.316H34.9ZM25.125,11.764V10.356H31.045V15.154H26.943V17.438C28.844,17.424 30.45,17.328 32.275,17.027L32.426,18.435C30.382,18.798 28.529,18.873 26.26,18.873H25.139V13.773H29.268V11.764H25.125Z"
android:fillColor="#000000"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
package com.idiotfrogs.designsystem.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
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.ButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import com.idiotfrogs.designsystem.component.button.MSButton
import com.idiotfrogs.designsystem.theme.MSTheme

@Composable
fun MSDialog(
title: String,
content: String,
onConfirm: () -> Unit,
onCancel: () -> Unit,
modifier: Modifier = Modifier,
confirmText: String = "ํ™•์ธ",
cancelText: String = "์ทจ์†Œ",
radius: Dp = 24.dp,
confirmButtonColor: Color = MSTheme.color.primaryNormal, // ๊ธฐ๋ณธ ์ดˆ๋ก์ƒ‰
cancelButtonColor: Color = MSTheme.color.greyG1, // ๊ธฐ๋ณธ ํšŒ์ƒ‰
confirmTextColor: Color = MSTheme.color.white,
cancelTextColor: Color = MSTheme.color.greyG4,
) {
Dialog(onDismissRequest = onCancel) {
Box(modifier = modifier.fillMaxWidth()) {
Column(
modifier = Modifier
.clip(RoundedCornerShape(radius))
.background(MSTheme.color.white)
.padding(20.dp)
) {
MSText(
text = title,
fontSize = 20.dp,
)
Spacer(modifier = Modifier.height(8.dp))
MSText(
text = content,
fontSize = 16.dp,
fontWeight = FontWeight.Normal
)
Spacer(modifier = Modifier.height(24.dp))
Row(modifier = Modifier.fillMaxWidth()) {
MSButton(
modifier = Modifier.weight(1f),
onClick = onCancel,
colors = ButtonDefaults.buttonColors(
containerColor = cancelButtonColor
),
pressColors = ButtonDefaults.buttonColors(
containerColor = cancelButtonColor
),
contentPadding = PaddingValues(11.dp)
) {
MSText(
text = cancelText,
fontSize = 16.dp,
color = cancelTextColor
)
}
Spacer(Modifier.width(8.dp))
MSButton(
modifier = Modifier.weight(1f),
onClick = onConfirm,
colors = ButtonDefaults.buttonColors(
containerColor = confirmButtonColor
),
pressColors = ButtonDefaults.buttonColors(
containerColor = confirmButtonColor
),
contentPadding = PaddingValues(11.dp)
) {
MSText(
text = confirmText,
fontSize = 16.dp,
color = confirmTextColor
)
}
}
}
}
}
}

@Preview
@Composable
fun MSDialogPreview() {
Column(
modifier = Modifier
.fillMaxSize()
.background(MSTheme.color.white)
) {
MSDialog(
title = "์ œ๋ชฉ",
content = "๋‚ด์šฉ",
onCancel = {},
onConfirm = {}
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
package com.idiotfrogs.designsystem.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.blur
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.skydoves.landscapist.glide.GlideImage
import com.idiotfrogs.resource.R

@Composable
fun MSGalleryLayout(images: List<String>, isSeal: Boolean) {
Box(
modifier = Modifier
.width(if (images.size != 1) 284.dp else 142.dp)
.clip(RoundedCornerShape(16.dp))
.blur(if (isSeal) 8.dp else 0.dp)
) {
when (images.size) {
1 -> SingleImage(images[0])
2 -> RowImages(images, isFirstRow = true)
3 -> RowImages(images, isFirstRow = false)
4 -> TwoByTwo(images)
else -> PatternRowsBigFirst(images)
}
}
}

@Composable
fun SingleImage(image: String) {
GlideImage(
imageModel = { image },
modifier = Modifier
.fillMaxWidth()
.height(160.dp),
loading = {
Image(
painter = painterResource(R.drawable.img_sample),
contentDescription = "Loading",
contentScale = ContentScale.Crop,
)
},
failure = {
Image(
painter = painterResource(R.drawable.img_sample),
contentDescription = "Failure",
contentScale = ContentScale.Crop,
)
}
)
}

@Composable
fun RowImages(images: List<String>, isFirstRow: Boolean) {
val width = when (images.size) {
1 -> 284.dp
2 -> 142.dp
3 -> (284f / 3f).dp
else -> 0.dp
}
val height = if (isFirstRow) 160.dp else 107.dp

Row(modifier = Modifier.fillMaxWidth()) {
images.forEach { image ->
GlideImage(
imageModel = { image },
modifier = Modifier
.width(width)
.height(height),
loading = {
Image(
painter = painterResource(R.drawable.img_sample),
contentDescription = "Loading",
contentScale = ContentScale.Crop,
)
},
failure = {
Image(
painter = painterResource(R.drawable.img_sample),
contentDescription = "Failure",
contentScale = ContentScale.Crop,
)
}
)
}
}
}

@Composable
fun TwoByTwo(images: List<String>) {
Column(modifier = Modifier.fillMaxWidth()) {
for (row in 0 until 2) {
RowImages(images.subList(row * 2, row * 2 + 2), isFirstRow = false)
}
}
}

@Composable
fun PatternRowsBigFirst(images: List<String>) {
Column(
modifier = Modifier.fillMaxWidth()) {
var index = 0
val total = images.size
var rowIndex = 0

while (index < total) {
val remaining = total - index
val rowSize = when {
remaining == 4 -> 2
remaining >= 3 -> 3
else -> remaining
}

val subList = images.subList(index, index + rowSize)
RowImages(subList, isFirstRow = false)

index += rowSize
rowIndex++
}
}
}
Loading