-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#23] 프로필 화면 UI 구현 #24
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 all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2b00145
[Feat/#23] RatingBadge Component
sonyerim 065b74b
[Feat/#23] UserProfile Component
sonyerim 46393e4
[Feat/#23] UserInfo Component
sonyerim 531cd42
[Feat/#23] HistorySummaryCard Component
sonyerim 29ed280
[Feat/#23] ProfileScreen UI
sonyerim 6d11f67
[Feat/#23] ProfileScreen 뒤로가기 기능
sonyerim 13fcace
[Feat/#23] BadgeButton Component
sonyerim c34e3da
[Refactor/#23] RatingBadge 클릭 제거 및 최소 너비 지정
sonyerim 1291cc7
[Refactor/#23] 기기 대응 비율 확장 함수 적용
sonyerim b308b4e
[Feat/#23] PotiDivider shape 추가
sonyerim cf18af9
[Refactor/#23] string resource 추출
sonyerim 1dad075
[Refactor/#23] ProfileUiState
sonyerim afbd900
[Refactor/#23] HistorySummaryCard items 구조 적용
sonyerim 28186c7
[Refactor/#23] 코드 리뷰 반영
sonyerim dce68d8
[Refactor/#27] 코드 리뷰 반영
sonyerim d73271e
Merge branch 'develop' into feat/#23-profile-ui
sonyerim 01c815c
[Refactor/#23] 뷰모델 연결
sonyerim 6452dd8
Merge branch 'develop' into feat/#23-profile-ui
sonyerim 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
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
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
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/poti/android/domain/model/user/UserProfile.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,19 @@ | ||
| package com.poti.android.domain.model.user | ||
|
|
||
| data class UserProfile( | ||
| val userId: Long, | ||
| val email: String, | ||
| val nickname: String, | ||
| val profileImageUrl: String, | ||
| val ratingAvg: Double, | ||
| val activityMessage: String, | ||
| val joinedAt: String, | ||
| val hasFavoriteArtist: Boolean, | ||
| val recruitSummary: HistorySummary, | ||
| ) | ||
|
|
||
| data class HistorySummary( | ||
| val total: Int, | ||
| val inProgress: Int, | ||
| val completed: Int, | ||
| ) |
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
78 changes: 78 additions & 0 deletions
78
app/src/main/java/com/poti/android/presentation/user/component/BadgeButton.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,78 @@ | ||
| package com.poti.android.presentation.user.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.heightIn | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.shape.CircleShape | ||
| import androidx.compose.material3.Icon | ||
| 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.graphics.vector.ImageVector | ||
| import androidx.compose.ui.res.vectorResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.poti.android.R | ||
| import com.poti.android.core.common.extension.noRippleClickable | ||
| import com.poti.android.core.designsystem.theme.PotiTheme | ||
|
|
||
| @Composable | ||
| fun BadgeButton( | ||
| bias: String, | ||
| onClick: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Row( | ||
| modifier = modifier | ||
| .heightIn(min = 40.dp) | ||
| .clip(CircleShape) | ||
| .background(PotiTheme.colors.poti200) | ||
| .noRippleClickable(onClick) | ||
| .padding(vertical = 8.dp) | ||
| .padding(start = 16.dp, end = 8.dp), | ||
| horizontalArrangement = Arrangement.Center, | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| ) { | ||
| Text( | ||
| text = bias, | ||
| color = PotiTheme.colors.poti800, | ||
| style = PotiTheme.typography.body14m, | ||
| ) | ||
|
|
||
| Icon( | ||
| imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_right_sm), | ||
| contentDescription = null, | ||
| modifier = Modifier.size(20.dp), | ||
| tint = PotiTheme.colors.poti800, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun BadgeButtonPreview() { | ||
| PotiTheme { | ||
| Column( | ||
| modifier = Modifier.padding(16.dp), | ||
| verticalArrangement = Arrangement.spacedBy(12.dp), | ||
| ) { | ||
| BadgeButton( | ||
| bias = "나의 최애 선택하기", | ||
| onClick = {}, | ||
| modifier = Modifier, | ||
| ) | ||
|
|
||
| BadgeButton( | ||
| bias = "아이브", | ||
| onClick = {}, | ||
| modifier = Modifier, | ||
| ) | ||
| } | ||
| } | ||
| } |
173 changes: 173 additions & 0 deletions
173
app/src/main/java/com/poti/android/presentation/user/component/HistorySummaryCard.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,173 @@ | ||
| package com.poti.android.presentation.user.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.interaction.MutableInteractionSource | ||
| import androidx.compose.foundation.interaction.collectIsPressedAsState | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| 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.layout.widthIn | ||
| import androidx.compose.foundation.shape.CircleShape | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.material3.VerticalDivider | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.poti.android.R | ||
| import com.poti.android.core.common.extension.noRippleClickable | ||
| import com.poti.android.core.designsystem.theme.PotiTheme | ||
| import com.poti.android.domain.model.user.HistorySummary | ||
|
|
||
| enum class HistorySummaryType { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3: 이 친구들은 어디 쓰여용?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 음 서버 연결할 때 쓰일까봐 만들어뒀는데 지금은 안 쓰이니까 일단 지울게용 |
||
| ALL, | ||
| IN_PROGRESS, | ||
| FINISHED, | ||
| } | ||
|
|
||
| @Composable | ||
| fun HistorySummaryCard( | ||
| title: String, | ||
| summary: HistorySummary, | ||
| onItemClick: (HistorySummaryType) -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Column( | ||
| modifier = modifier, | ||
| verticalArrangement = Arrangement.Center, | ||
| horizontalAlignment = Alignment.Start, | ||
| ) { | ||
| Text( | ||
| text = title, | ||
| color = PotiTheme.colors.black, | ||
| style = PotiTheme.typography.body16sb, | ||
| ) | ||
|
|
||
| Spacer(Modifier.height(12.dp)) | ||
|
|
||
| Row( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .clip(RoundedCornerShape(12.dp)) | ||
| .background(PotiTheme.colors.gray100) | ||
| .padding(8.dp), | ||
| horizontalArrangement = Arrangement.spacedBy(8.dp), | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| ) { | ||
| HistoryItem( | ||
| title = stringResource(R.string.user_history_all), | ||
| count = summary.total, | ||
| onClick = { onItemClick(HistorySummaryType.ALL) }, | ||
| modifier = Modifier.weight(1f), | ||
| ) | ||
|
|
||
| VerticalDivider( | ||
| modifier = Modifier | ||
| .height(56.dp) | ||
| .clip(CircleShape), | ||
| thickness = 1.dp, | ||
| color = PotiTheme.colors.gray300, | ||
| ) | ||
|
|
||
| HistoryItem( | ||
| title = stringResource(R.string.user_history_ongoing), | ||
| count = summary.inProgress, | ||
| onClick = { onItemClick(HistorySummaryType.IN_PROGRESS) }, | ||
| modifier = Modifier.weight(1f), | ||
| ) | ||
|
|
||
| VerticalDivider( | ||
| modifier = Modifier | ||
| .height(56.dp) | ||
| .clip(CircleShape), | ||
| thickness = 1.dp, | ||
| color = PotiTheme.colors.gray300, | ||
| ) | ||
|
|
||
| HistoryItem( | ||
| title = stringResource(R.string.user_history_ended), | ||
| count = summary.completed, | ||
| onClick = { onItemClick(HistorySummaryType.FINISHED) }, | ||
| modifier = Modifier.weight(1f), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| private fun HistoryItem( | ||
| title: String, | ||
| count: Int, | ||
| onClick: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| val interactionSource = remember { MutableInteractionSource() } | ||
| val isPressed by interactionSource.collectIsPressedAsState() | ||
| val backgroundColor = if (isPressed) PotiTheme.colors.gray300 else PotiTheme.colors.gray100 | ||
|
|
||
| Column( | ||
| modifier = modifier | ||
| .widthIn(92.dp) | ||
| .clip(RoundedCornerShape(12.dp)) | ||
| .background(backgroundColor) | ||
| .noRippleClickable( | ||
| interactionSource = interactionSource, | ||
| onClick = onClick, | ||
| ) | ||
| .padding(vertical = 18.5.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| verticalArrangement = Arrangement.spacedBy(8.dp), | ||
| ) { | ||
| Text( | ||
| text = count.toString(), | ||
| color = PotiTheme.colors.poti600, | ||
| style = PotiTheme.typography.title18sb, | ||
| ) | ||
| Text( | ||
| text = title, | ||
| color = PotiTheme.colors.gray800, | ||
| style = PotiTheme.typography.caption12m, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun HistorySummaryCardPreview() { | ||
| val summary = HistorySummary( | ||
| total = 7, | ||
| inProgress = 2, | ||
| completed = 5, | ||
| ) | ||
|
|
||
| PotiTheme { | ||
| Column( | ||
| modifier = Modifier.padding(16.dp), | ||
| verticalArrangement = Arrangement.spacedBy(12.dp), | ||
| ) { | ||
| HistorySummaryCard( | ||
| title = "참여 내역", | ||
| summary = summary, | ||
| onItemClick = {}, | ||
| modifier = Modifier.width(328.dp), | ||
| ) | ||
|
|
||
| HistorySummaryCard( | ||
| title = "참여 내역", | ||
| summary = summary, | ||
| onItemClick = {}, | ||
| ) | ||
| } | ||
| } | ||
| } | ||
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.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 92
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 135
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 92
🏁 Script executed:
# PotiNavHost.kt 파일 전체 확인 cat -n ./app/src/main/java/com/poti/android/presentation/main/PotiNavHost.ktRepository: team-poti/POTI-ANDROID
Length of output: 2115
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 890
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 1325
🏁 Script executed:
# ProfileNavigation.kt 전체 파일 확인 cat -n app/src/main/java/com/poti/android/presentation/user/profile/navigation/ProfileNavigation.ktRepository: team-poti/POTI-ANDROID
Length of output: 1290
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 353
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 1379
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 473
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 8484
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 2264
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 1518
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 575
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 2409
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 434
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 48
🏁 Script executed:
Repository: team-poti/POTI-ANDROID
Length of output: 389
명시적인 람다로 래핑하여 타입 안전성을 명확히 하세요.
navController::popBackStack은Boolean을 반환하지만,onPopBackStack은() -> Unit타입입니다. 반환값을 명시적으로 무시하는 람다로 래핑하면 의도가 더 분명하고 타입 일관성도 개선됩니다.🔧 제안 변경
🤖 Prompt for AI Agents