-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/chips label component #41
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0d8ddd5
feat: test theme ์ถ๊ฐ
BEEEAM-J 6863881
Merge branch 'develop' into refactor/Beeeam-DesignSystem
BEEEAM-J a0e36c3
feat: contained label component ์ถ๊ฐ
BEEEAM-J 1084344
feat: outlined label component ์ถ๊ฐ
BEEEAM-J ef2af52
rename: chips component ํด๋ ๋ฐ ๋ณ์๋ช
์์
BEEEAM-J 11cce71
feat: Color chip ์ถ๊ฐ
BEEEAM-J a67d460
rename: Contained,Outlined chip ์ปดํฌ์ ๋ธ๋ช
์์
BEEEAM-J edfd21b
refactor: SuwikiChipType ์์
BEEEAM-J 98d8a29
remove: test theme ์ ๊ฑฐ
BEEEAM-J 724e7ac
refactor: ํด๋ฆญ ์ด๋ฒคํธ ์ธ์๋ช
๋ฐ ๋๋ค ์์
BEEEAM-J dfa60f0
refactor: Contained, Outlined, Color chip Stateless Composable๋ก ์์
BEEEAM-J ea4e674
refactor: Contained Chip ์ ์ ํ๋ ์กฐ๊ฑด์ ์์
BEEEAM-J b2db94c
refactor: SuwikiCheckedColorChip, SuwikiNonCheckedColorChip -> Suwikiโฆ
BEEEAM-J 1940b2b
refactor: Contained, Outlined Chip width๊ฐ ๋์ ์ผ๋ก ๋ณํ๋๋ก ์์
BEEEAM-J 469fe9b
Merge branch 'develop' into feature/chips-label-component
BEEEAM-J 445dc2f
refactor: Contained, Outlined Chip ๋ด๋ถ ํ
์คํธ ๋ฐฐ์น ๋ฐฉ๋ฒ ์์
BEEEAM-J eafbe22
refactor: ๋ถ๊ธฐ๊ฐ 2๊ฐ์ธ when -> if
BEEEAM-J c36f3d6
refactor: Color Chip Image painterResource id ์ค์ ๊ฐ์ํ
BEEEAM-J 0b0d704
refactor: Outlined Chip ์ ์ ์ ๊ตฌ๋ฌธ ์์
BEEEAM-J File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...stem/src/main/java/com/suwiki/core/designsystem/component/chips/SuwikiCheckedColorChip.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.suwiki.core.designsystem.component.chips | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
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 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.TestTheme | ||
|
||
@Composable | ||
fun SuwikiCheckedColorChip( | ||
onClicked: () -> Unit, | ||
) { | ||
Box( | ||
modifier = Modifier.size(40.dp), | ||
) { | ||
Image( | ||
painter = painterResource(id = R.drawable.ic_color_checked_chip), | ||
contentDescription = "", | ||
modifier = Modifier.clickable { onClicked() }, | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun SuwikiCheckedColorChipPreview() { | ||
TestTheme { | ||
Column( | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
SuwikiCheckedColorChip { } | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...esignsystem/src/main/java/com/suwiki/core/designsystem/component/chips/SuwikiColorChip.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.suwiki.core.designsystem.component.chips | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
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.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.TestTheme | ||
|
||
@Composable | ||
fun SuwikiColorChip() { | ||
var chipState by rememberSaveable { mutableStateOf(false) } | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
when (chipState) { | ||
true -> { | ||
SuwikiCheckedColorChip { chipState = !chipState } | ||
} | ||
false -> { | ||
SuwikiNonCheckedColorChip { chipState = !chipState } | ||
} | ||
} | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
@Preview(showBackground = true, backgroundColor = 0xFFFFFF) | ||
@Composable | ||
fun SuwikiColorChipPreview() { | ||
TestTheme { | ||
Column( | ||
modifier = Modifier.size(300.dp), | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
SuwikiColorChip() | ||
} | ||
} | ||
} |
111 changes: 111 additions & 0 deletions
111
...nsystem/src/main/java/com/suwiki/core/designsystem/component/chips/SuwikiContainedChip.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
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.Column | ||
import androidx.compose.foundation.layout.size | ||
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 | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.F6 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.TestTheme | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.blue10 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.blue100 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.c95 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.green10 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.green100 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.orange10 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.orange100 | ||
enum class SuwikiLabelType(val type: String) { | ||
ORANGE("orange"), | ||
BLUE("blue"), | ||
GREEN("green"), | ||
} | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@Composable | ||
fun SuwikiContainedChip(type: SuwikiLabelType, text: String) { | ||
var chipState by remember { mutableStateOf(false) } | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
val backgroundColor: Color | ||
val contentColor: Color | ||
|
||
when (chipState) { | ||
false -> { | ||
backgroundColor = F6 | ||
contentColor = c95 | ||
} | ||
true -> { | ||
when (type) { | ||
SuwikiLabelType.ORANGE -> { | ||
backgroundColor = orange10 | ||
contentColor = orange100 | ||
} | ||
SuwikiLabelType.BLUE -> { | ||
backgroundColor = blue10 | ||
contentColor = blue100 | ||
} | ||
SuwikiLabelType.GREEN -> { | ||
backgroundColor = green10 | ||
contentColor = green100 | ||
} | ||
} | ||
} | ||
} | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
SuwikiContainedChipItem( | ||
text = text, | ||
backgroundColor = backgroundColor, | ||
contentColor = contentColor, | ||
onBtnClicked = { chipState = !chipState }, | ||
) | ||
} | ||
|
||
@Composable | ||
fun SuwikiContainedChipItem( | ||
text: String, | ||
backgroundColor: Color, | ||
contentColor: Color, | ||
onBtnClicked: () -> Unit, | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) { | ||
Box( | ||
modifier = Modifier | ||
.clip(RoundedCornerShape(5.dp)) | ||
.background(color = backgroundColor) | ||
.clickable { onBtnClicked() } | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.size(41.dp, 26.dp), | ||
) { | ||
Text( | ||
text = text, | ||
color = contentColor, | ||
modifier = Modifier | ||
.align(Alignment.Center), | ||
fontSize = 12.sp, | ||
) | ||
} | ||
} | ||
|
||
@Preview(showBackground = true, backgroundColor = 0xFFFFFF) | ||
@Composable | ||
fun SuwikiContainedChipPreview() { | ||
TestTheme { | ||
Column( | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
SuwikiContainedChip(SuwikiLabelType.ORANGE, "label") | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...m/src/main/java/com/suwiki/core/designsystem/component/chips/SuwikiNonCheckedColorChip.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.suwiki.core.designsystem.component.chips | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
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 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.TestTheme | ||
|
||
@Composable | ||
fun SuwikiNonCheckedColorChip( | ||
onClicked: () -> Unit, | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) { | ||
Box( | ||
modifier = Modifier.size(40.dp), | ||
) { | ||
Image( | ||
painter = painterResource(id = R.drawable.ic_color_chip), | ||
contentDescription = "", | ||
modifier = Modifier.clickable { onClicked() }, | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun SuwikiNonCheckedColorChipPreview() { | ||
TestTheme { | ||
Column( | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
SuwikiNonCheckedColorChip { } | ||
} | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
...gnsystem/src/main/java/com/suwiki/core/designsystem/component/chips/SuwikiOutlinedChip.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
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.Column | ||
import androidx.compose.foundation.layout.size | ||
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 | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.DA | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.Main | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.TestTheme | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.c95 | ||
import com.suwiki.core.designsystem.component.chips.ui.theme.white | ||
|
||
@Composable | ||
fun SuwikiOutlinedChip(text: String) { | ||
var labelState by remember { mutableStateOf(false) } | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
val backgroundColor: Color | ||
val contentColor: Color | ||
|
||
when (labelState) { | ||
false -> { | ||
backgroundColor = DA | ||
contentColor = c95 | ||
} | ||
true -> { | ||
backgroundColor = Main | ||
contentColor = Main | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
SuwikiOutlinedChipItem( | ||
text = text, | ||
backgroundColor = backgroundColor, | ||
contentColor = contentColor, | ||
onBtnClicked = { labelState = !labelState }, | ||
) | ||
} | ||
|
||
@Composable | ||
fun SuwikiOutlinedChipItem( | ||
text: String, | ||
backgroundColor: Color, | ||
contentColor: Color, | ||
onBtnClicked: () -> Unit, | ||
) { | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Box( | ||
modifier = Modifier | ||
.clip(RoundedCornerShape(5.dp)) | ||
.clickable { onBtnClicked() } | ||
.size(41.dp, 26.dp) | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.background(color = white) | ||
.border(width = 1.dp, color = backgroundColor, shape = RoundedCornerShape(5.dp)), | ||
) { | ||
Text( | ||
text = text, | ||
color = contentColor, | ||
modifier = Modifier | ||
.align(Alignment.Center), | ||
fontSize = 12.sp, | ||
) | ||
} | ||
} | ||
|
||
@Preview(showBackground = true, backgroundColor = 0xFFFFFF) | ||
@Composable | ||
fun SuwikiOutlinedChipPreview() { | ||
TestTheme { | ||
Column( | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
) { | ||
SuwikiOutlinedChip("label") | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...gnsystem/src/main/java/com/suwiki/core/designsystem/component/chips/ui/theme/TestColor.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.suwiki.core.designsystem.component.chips.ui.theme | ||
|
||
import androidx.compose.ui.graphics.Color | ||
|
||
val Purple80 = Color(0xFFD0BCFF) | ||
val PurpleGrey80 = Color(0xFFCCC2DC) | ||
val Pink80 = Color(0xFFEFB8C8) | ||
|
||
val Purple40 = Color(0xFF6650a4) | ||
val PurpleGrey40 = Color(0xFF625b71) | ||
val Pink40 = Color(0xFF7D5260) | ||
|
||
val Main = Color(0xFF346CFD) | ||
val DA = Color(0xFFDADADA) | ||
val F6 = Color(0xFFF6F6F6) | ||
val c95 = Color(0xFF959595) | ||
val orange10 = Color(0xFFFFF3EB) | ||
val orange100 = Color(0xFFFD873B) | ||
val blue10 = Color(0xFFECEDFF) | ||
val blue100 = Color(0xFF3D4EFB) | ||
val green10 = Color(0xFFEAF8EC) | ||
val green100 = Color(0xFF2DB942) | ||
val white = Color(0xFFFFFFFF) | ||
BEEEAM-J marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.