-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#25] participant-state, state-guide, callout-info 컴포넌트 구현 #30
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 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ad61165
[feat/#25] state-guide implement
cmj7271 865caa6
[feat/#25] callout-info implement
cmj7271 40d6b4e
[feat/#25] participant-state implement
cmj7271 9779a9a
[fix/#25] apply ktlint
cmj7271 2e0b495
[fix/#25] 코리 반영
cmj7271 88db02f
[feat/#25] apply ktlint
cmj7271 591c861
[feat/#25] participant-state 디자인 반영
cmj7271 ebd6eae
[chore/#25] apply ktlint
cmj7271 cce3def
[refactor/#25] participant-state 리팩토링
cmj7271 eaf0db3
[fix/#25] callout text strings.sml 로 분리
cmj7271 ab22936
[fix/#25] apply ktlint
cmj7271 bfb0b94
[fix/#25] 다른 브렌치 작업물 제거
cmj7271 4ab0fb3
[fix/#25] 코드리뷰 반영
cmj7271 523d83d
[fix/#25] apply ktlint
cmj7271 9fd42dc
Merge branch 'develop' into feat/#25-history-component
cmj7271 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
app/src/main/java/com/poti/android/presentation/history/component/HistoryCalloutInfo.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,96 @@ | ||
| package com.poti.android.presentation.history.component | ||
|
|
||
| import android.content.ClipData | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| 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.rememberCoroutineScope | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.platform.ClipEntry | ||
| import androidx.compose.ui.platform.LocalClipboard | ||
| import androidx.compose.ui.text.style.TextDecoration | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.poti.android.core.common.extension.noRippleClickable | ||
| import com.poti.android.core.designsystem.theme.PotiTheme | ||
| import com.poti.android.core.designsystem.theme.PotiTheme.colors | ||
| import kotlinx.coroutines.launch | ||
|
|
||
| @Composable | ||
| fun HistoryCalloutInfo( | ||
| text: String, | ||
| modifier: Modifier = Modifier, | ||
| copyable: Boolean = true, | ||
| ) { | ||
| val clipboardManager = LocalClipboard.current | ||
| val localScope = rememberCoroutineScope() | ||
|
|
||
| Box( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .clip(RoundedCornerShape(8.dp)) | ||
| .background(colors.gray100), | ||
| ) { | ||
| Row( | ||
| modifier = Modifier | ||
| .padding(horizontal = 16.dp, vertical = 12.dp) | ||
| .fillMaxWidth(), | ||
| horizontalArrangement = Arrangement.SpaceBetween, | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| ) { | ||
| Text( | ||
| text = text, | ||
| style = PotiTheme.typography.body14m, | ||
| color = colors.black, | ||
| modifier = Modifier.weight(1f), | ||
| ) | ||
|
|
||
| if (copyable) { | ||
| Text( | ||
| text = "복사", | ||
|
||
| style = PotiTheme.typography.body14m.copy(textDecoration = TextDecoration.Underline), | ||
| color = colors.gray700, | ||
| modifier = Modifier | ||
| .noRippleClickable { | ||
| val clipData = ClipData.newPlainText("", text) | ||
| val clipEntry = ClipEntry(clipData) | ||
| localScope.launch { | ||
| clipboardManager.setClipEntry(clipEntry) | ||
| } | ||
| } | ||
| .padding(start = 12.dp), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun HistoryCalloutInfoPreview() { | ||
| PotiTheme { | ||
| HistoryCalloutInfo( | ||
| text = "정보", | ||
| copyable = true, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun HistoryCalloutInfoNoCopyPreview() { | ||
| PotiTheme { | ||
| HistoryCalloutInfo( | ||
| text = "정보 (복사 불가능)", | ||
| copyable = false, | ||
| ) | ||
| } | ||
| } | ||
79 changes: 79 additions & 0 deletions
79
...main/java/com/poti/android/presentation/history/component/HistoryParticipantStateLabel.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,79 @@ | ||
| package com.poti.android.presentation.history.component | ||
|
|
||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.text.TextStyle | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.poti.android.core.designsystem.theme.PotiTheme | ||
| import com.poti.android.core.designsystem.theme.PotiTheme.colors | ||
| import com.poti.android.core.designsystem.theme.PotiTheme.typography | ||
|
|
||
| enum class ParticipantStateLabelColor { | ||
| RED, | ||
| BLUE, | ||
| GRAY, | ||
| } | ||
|
|
||
| val ParticipantStateLabelColor.color: Color | ||
| @Composable get() = when (this) { | ||
| ParticipantStateLabelColor.RED -> colors.sementicRed | ||
| ParticipantStateLabelColor.BLUE -> colors.poti600 | ||
| ParticipantStateLabelColor.GRAY -> colors.gray700 | ||
| } | ||
|
|
||
| enum class ParticipantStateLabelSize { | ||
| LARGE, | ||
| SMALL, | ||
| } | ||
|
|
||
| val ParticipantStateLabelSize.style: TextStyle | ||
| @Composable get() = when (this) { | ||
| ParticipantStateLabelSize.LARGE -> typography.body16sb | ||
| ParticipantStateLabelSize.SMALL -> typography.body14sb | ||
| } | ||
|
|
||
| @Composable | ||
| fun HistoryParticipantStateLabel( | ||
| text: String, | ||
| sizeType: ParticipantStateLabelSize, | ||
| colorType: ParticipantStateLabelColor, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Text( | ||
| text = text, | ||
| style = sizeType.style, | ||
| color = colorType.color, | ||
| modifier = modifier, | ||
| ) | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun HistoryParticipantStateLabelPreview() { | ||
| PotiTheme { | ||
| Column( | ||
| verticalArrangement = Arrangement.spacedBy(10.dp), | ||
| ) { | ||
| HistoryParticipantStateLabel( | ||
| text = "입금 대기", | ||
| sizeType = ParticipantStateLabelSize.LARGE, | ||
| colorType = ParticipantStateLabelColor.RED, | ||
| ) | ||
| HistoryParticipantStateLabel( | ||
| text = "입금 완료", | ||
| sizeType = ParticipantStateLabelSize.SMALL, | ||
| colorType = ParticipantStateLabelColor.GRAY, | ||
| ) | ||
| HistoryParticipantStateLabel( | ||
| text = "모집 완료", | ||
| sizeType = ParticipantStateLabelSize.SMALL, | ||
| colorType = ParticipantStateLabelColor.BLUE, | ||
| ) | ||
| } | ||
| } | ||
| } |
44 changes: 44 additions & 0 deletions
44
app/src/main/java/com/poti/android/presentation/history/component/HistoryStateGuide.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.poti.android.presentation.history.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| 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.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.poti.android.core.designsystem.theme.PotiTheme | ||
| import com.poti.android.core.designsystem.theme.PotiTheme.colors | ||
| import com.poti.android.core.designsystem.theme.PotiTheme.typography | ||
|
|
||
| @Composable | ||
| fun HistoryStateGuide( | ||
| text: String, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Text( | ||
| text = text, | ||
| style = typography.body14sb, | ||
| color = colors.poti600, | ||
| textAlign = TextAlign.Center, | ||
| modifier = modifier | ||
| .clip(RoundedCornerShape(8.dp)) | ||
| .background(colors.poti200) | ||
| .padding(vertical = 12.dp), | ||
| ) | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun HistoryStateGuidePreview() { | ||
| PotiTheme { | ||
| HistoryStateGuide( | ||
| text = "상태 메세지를 입력하세요", | ||
| modifier = Modifier.width(343.dp), | ||
| ) | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p1: 기기 대응 확장함수 써주심 좋습니다!