Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/chips label component #41

Merged
merged 19 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0d8ddd5
feat: test theme ์ถ”๊ฐ€
BEEEAM-J Nov 30, 2023
6863881
Merge branch 'develop' into refactor/Beeeam-DesignSystem
BEEEAM-J Nov 30, 2023
a0e36c3
feat: contained label component ์ถ”๊ฐ€
BEEEAM-J Dec 3, 2023
1084344
feat: outlined label component ์ถ”๊ฐ€
BEEEAM-J Dec 3, 2023
ef2af52
rename: chips component ํด๋” ๋ฐ ๋ณ€์ˆ˜๋ช… ์ˆ˜์ •
BEEEAM-J Dec 4, 2023
11cce71
feat: Color chip ์ถ”๊ฐ€
BEEEAM-J Dec 4, 2023
a67d460
rename: Contained,Outlined chip ์ปดํฌ์ €๋ธ”๋ช… ์ˆ˜์ •
BEEEAM-J Dec 4, 2023
edfd21b
refactor: SuwikiChipType ์ˆ˜์ •
BEEEAM-J Dec 5, 2023
98d8a29
remove: test theme ์ œ๊ฑฐ
BEEEAM-J Dec 5, 2023
724e7ac
refactor: ํด๋ฆญ ์ด๋ฒคํŠธ ์ธ์ž๋ช… ๋ฐ ๋žŒ๋‹ค ์ˆ˜์ •
BEEEAM-J Dec 5, 2023
dfa60f0
refactor: Contained, Outlined, Color chip Stateless Composable๋กœ ์ˆ˜์ •
BEEEAM-J Dec 5, 2023
ea4e674
refactor: Contained Chip ์ƒ‰ ์ •ํ•˜๋Š” ์กฐ๊ฑด์‹ ์ˆ˜์ •
BEEEAM-J Dec 5, 2023
b2db94c
refactor: SuwikiCheckedColorChip, SuwikiNonCheckedColorChip -> Suwikiโ€ฆ
BEEEAM-J Dec 5, 2023
1940b2b
refactor: Contained, Outlined Chip width๊ฐ€ ๋™์ ์œผ๋กœ ๋ณ€ํ•˜๋„๋ก ์ˆ˜์ •
BEEEAM-J Dec 5, 2023
469fe9b
Merge branch 'develop' into feature/chips-label-component
BEEEAM-J Dec 5, 2023
445dc2f
refactor: Contained, Outlined Chip ๋‚ด๋ถ€ ํ…์ŠคํŠธ ๋ฐฐ์น˜ ๋ฐฉ๋ฒ• ์ˆ˜์ •
BEEEAM-J Dec 5, 2023
eafbe22
refactor: ๋ถ„๊ธฐ๊ฐ€ 2๊ฐœ์ธ when -> if
BEEEAM-J Dec 5, 2023
c36f3d6
refactor: Color Chip Image painterResource id ์„ค์ • ๊ฐ„์†Œํ™”
BEEEAM-J Dec 5, 2023
0b0d704
refactor: Outlined Chip ์ƒ‰ ์ •์˜ ๊ตฌ๋ฌธ ์ˆ˜์ •
BEEEAM-J Dec 5, 2023
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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
package com.suwiki.core.designsystem.component.chips

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.suwiki.core.designsystem.R

@Composable
fun SuwikiColorChip(
isChecked: Boolean,
onClick: () -> Unit = {},
) {
when (isChecked) {
true -> {
SuwikiCheckedColorChip(onClick = onClick)
}
false -> {
SuwikiNonCheckedColorChip(onClick = onClick)
}
Box(
modifier = Modifier.size(40.dp),
) {
Image(
painter = when (isChecked) {
true -> {
painterResource(id = R.drawable.ic_color_checked_chip)
}
false -> {
painterResource(id = R.drawable.ic_color_chip)
}
},
BEEEAM-J marked this conversation as resolved.
Show resolved Hide resolved
contentDescription = "",
modifier = Modifier.clickable(onClick = onClick),
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ package com.suwiki.core.designsystem.component.chips

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
Expand All @@ -22,7 +24,6 @@ enum class SuwikiChipType {
ORANGE,
BLUE,
GREEN,
// DISABLE
}

@Composable
Expand All @@ -32,46 +33,36 @@ fun SuwikiContainedChip(
type: SuwikiChipType,
text: String,
) {
val backgroundColor: Color
val contentColor: Color

when (isChecked) {
true -> {
val (backgroundColor, contentColor) = when {
isChecked -> {
when (type) {
SuwikiChipType.ORANGE -> {
backgroundColor = Color(0xFFFFF3EB)
contentColor = Color(0xFFFD873B)
}
SuwikiChipType.BLUE -> {
backgroundColor = Color(0xFFECEDFF)
contentColor = Color(0xFF3D4EFB)
}
SuwikiChipType.GREEN -> {
backgroundColor = Color(0xFFEAF8EC)
contentColor = Color(0xFF2DB942)
}
SuwikiChipType.ORANGE -> Color(0xFFFFF3EB) to Color(0xFFFD873B)
SuwikiChipType.BLUE -> Color(0xFFECEDFF) to Color(0xFF3D4EFB)
SuwikiChipType.GREEN -> Color(0xFFEAF8EC) to Color(0xFF2DB942)
}
}
false -> {
backgroundColor = Color(0xFFF6F6F6)
contentColor = Color(0xFF959595)
}
else -> Color(0xFFF6F6F6) to Color(0xFF959595)
}
BEEEAM-J marked this conversation as resolved.
Show resolved Hide resolved

Box(
modifier = Modifier
.clip(RoundedCornerShape(5.dp))
.background(color = backgroundColor)
.clickable(onClick = onClick)
.size(41.dp, 26.dp),
.height(26.dp)
) {
Text(
text = text,
color = contentColor,
Column(
BEEEAM-J marked this conversation as resolved.
Show resolved Hide resolved
modifier = Modifier
.align(Alignment.Center),
fontSize = 12.sp,
)
.padding(top = 4.dp, bottom = 4.dp, start = 6.dp, end = 6.dp)
BEEEAM-J marked this conversation as resolved.
Show resolved Hide resolved
.height(18.dp),
verticalArrangement = Arrangement.Center,
) {
Text(
text = text,
color = contentColor,
fontSize = 12.sp,
)
}
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package com.suwiki.core.designsystem.component.chips
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -44,17 +46,22 @@ fun SuwikiOutlinedChip(
modifier = Modifier
.clip(RoundedCornerShape(5.dp))
.clickable(onClick = onClick)
.size(41.dp, 26.dp)
.height(26.dp)
.background(color = Color(0xFFFFFFFF))
.border(width = 1.dp, color = borderLineColor, shape = RoundedCornerShape(5.dp)),
) {
Text(
text = text,
color = contentColor,
Column(
BEEEAM-J marked this conversation as resolved.
Show resolved Hide resolved
modifier = Modifier
.align(Alignment.Center),
fontSize = 12.sp,
)
.padding(top = 4.dp, bottom = 4.dp, start = 6.dp, end = 6.dp)
BEEEAM-J marked this conversation as resolved.
Show resolved Hide resolved
.height(18.dp),
verticalArrangement = Arrangement.Center,
) {
Text(
text = text,
color = contentColor,
fontSize = 12.sp,
)
}
}
}

Expand Down
Loading