-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feat] 마이페이지 개별 컴포넌트 구현 #43
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/sopt/dateroad/presentation/type/MyPageMenuType.kt
This file contains 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 org.sopt.dateroad.presentation.type | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.annotation.StringRes | ||
import org.sopt.dateroad.R | ||
|
||
enum class MyPageMenuType( | ||
@StringRes val titleRes: Int, | ||
@DrawableRes val iconRes: Int = R.drawable.ic_my_page_arrow | ||
) { | ||
FIRST( | ||
titleRes = R.string.my_page_menu_my_enroll_course | ||
), | ||
SECOND( | ||
titleRes = R.string.my_page_menu_point_guide | ||
), | ||
THIRD( | ||
titleRes = R.string.my_page_menu_question | ||
), | ||
FOURTH( | ||
titleRes = R.string.my_page_menu_logout | ||
) | ||
} |
29 changes: 29 additions & 0 deletions
29
app/src/main/java/org/sopt/dateroad/presentation/type/MyPagePointInfoType.kt
This file contains 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,29 @@ | ||
package org.sopt.dateroad.presentation.type | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.annotation.StringRes | ||
import org.sopt.dateroad.R | ||
|
||
enum class MyPagePointInfoType( | ||
@StringRes val titleRes: Int, | ||
@StringRes val descriptionRes: Int, | ||
@DrawableRes val imageRes: Int = R.drawable.img_my_page_point_info | ||
|
||
) { | ||
FIRST( | ||
titleRes = R.string.point_system_first_title, | ||
descriptionRes = R.string.point_system_first_description | ||
), | ||
SECOND( | ||
titleRes = R.string.point_system_second_title, | ||
descriptionRes = R.string.point_system_second_description | ||
), | ||
THIRD( | ||
titleRes = R.string.point_system_third_title, | ||
descriptionRes = R.string.point_system_third_description | ||
), | ||
FOURTH( | ||
titleRes = R.string.point_system_fourth_title, | ||
descriptionRes = R.string.point_system_fourth_description | ||
) | ||
} |
58 changes: 58 additions & 0 deletions
58
app/src/main/java/org/sopt/dateroad/presentation/ui/component/mypage/DateRoadMyPageButton.kt
This file contains 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,58 @@ | ||
package org.sopt.dateroad.presentation.ui.component.mypage | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Column | ||
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.padding | ||
import androidx.compose.foundation.layout.width | ||
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.platform.LocalContext | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import org.sopt.dateroad.presentation.type.MyPageMenuType | ||
import org.sopt.dateroad.ui.theme.DateRoadTheme | ||
|
||
@Composable | ||
fun DateRoadMyPageButton(myPageMenuType: MyPageMenuType, onClick: () -> Unit = {}) { | ||
Row( | ||
modifier = Modifier | ||
.padding(top = 19.dp, bottom = 20.dp) | ||
.fillMaxWidth() | ||
.clickable(onClick = onClick), | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Text(text = stringResource(id = myPageMenuType.titleRes), style = DateRoadTheme.typography.bodySemi15, color = DateRoadTheme.colors.black, modifier = Modifier.weight(1f)) | ||
Spacer(modifier = Modifier.width(20.dp)) | ||
Icon(painter = painterResource(id = myPageMenuType.iconRes), contentDescription = null) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun DateRoadMyPageButtonPreview() { | ||
val context = LocalContext.current | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(DateRoadTheme.colors.white) | ||
) { | ||
DateRoadMyPageButton(MyPageMenuType.FIRST, onClick = { | ||
}) | ||
DateRoadMyPageButton(MyPageMenuType.SECOND, onClick = { | ||
}) | ||
DateRoadMyPageButton(MyPageMenuType.THIRD, onClick = { | ||
}) | ||
DateRoadMyPageButton(MyPageMenuType.FOURTH, onClick = { | ||
}) | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...c/main/java/org/sopt/dateroad/presentation/ui/component/mypage/DateRoadMyPagePointInfo.kt
This file contains 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,72 @@ | ||
package org.sopt.dateroad.presentation.ui.component.mypage | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
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.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.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import org.sopt.dateroad.presentation.type.MyPagePointInfoType | ||
import org.sopt.dateroad.ui.theme.DateRoadTheme | ||
|
||
@Composable | ||
fun DateRoadMyPagePointInfo(myPagePointInfoType: MyPagePointInfoType) { | ||
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. 기기대응 진행해 주세요 |
||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.clip(RoundedCornerShape(14.dp)) | ||
.background(DateRoadTheme.colors.gray100) | ||
.padding(14.dp), | ||
verticalAlignment = Alignment.CenterVertically // Aligns items vertically centered | ||
) { | ||
Image(painter = painterResource(id = myPagePointInfoType.imageRes), contentDescription = null) | ||
Spacer(modifier = Modifier.width(10.dp)) | ||
Column { | ||
Text( | ||
text = stringResource(id = myPagePointInfoType.titleRes), | ||
style = DateRoadTheme.typography.bodyBold15, | ||
modifier = Modifier.fillMaxWidth() | ||
) | ||
Spacer(modifier = Modifier.height(10.dp)) | ||
Text( | ||
text = stringResource(id = myPagePointInfoType.descriptionRes), | ||
color = DateRoadTheme.colors.gray500, | ||
style = DateRoadTheme.typography.bodyMed13, | ||
modifier = Modifier.fillMaxWidth() | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun DateRoadMyPagePointInfoPreview() { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(DateRoadTheme.colors.white) | ||
.padding(horizontal = 16.dp) | ||
) { | ||
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.FIRST) | ||
Spacer(modifier = Modifier.height(16.dp)) | ||
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.SECOND) | ||
Spacer(modifier = Modifier.height(16.dp)) | ||
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.THIRD) | ||
Spacer(modifier = Modifier.height(16.dp)) | ||
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.FOURTH) | ||
} | ||
} |
This file contains 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,58 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="70dp" | ||
android:height="70dp" | ||
android:viewportWidth="70" | ||
android:viewportHeight="70"> | ||
<group> | ||
<clip-path | ||
android:pathData="M35,0L35,0A35,35 0,0 1,70 35L70,35A35,35 0,0 1,35 70L35,70A35,35 0,0 1,0 35L0,35A35,35 0,0 1,35 0z"/> | ||
<path | ||
android:pathData="M35,0L35,0A35,35 0,0 1,70 35L70,35A35,35 0,0 1,35 70L35,70A35,35 0,0 1,0 35L0,35A35,35 0,0 1,35 0z" | ||
android:fillColor="#4A3CEF"/> | ||
<path | ||
android:pathData="M-4.872,67.143a45.753,32.257 0,1 0,91.505 0a45.753,32.257 0,1 0,-91.505 0z" | ||
android:fillColor="#F4F8FF"/> | ||
<path | ||
android:pathData="M-2.363,31.14a7.559,9.294 106.879,1 0,17.788 5.397a7.559,9.294 106.879,1 0,-17.788 -5.397z" | ||
android:fillColor="#F4F8FF"/> | ||
<path | ||
android:pathData="M-3.59,29.861a7.559,9.294 129.513,1 0,14.341 11.827a7.559,9.294 129.513,1 0,-14.341 -11.827z" | ||
android:fillColor="#A8A0FF"/> | ||
<path | ||
android:pathData="M-4.872,56.088a45.753,32.257 0,1 0,91.505 0a45.753,32.257 0,1 0,-91.505 0z" | ||
android:fillColor="#F4F8FF"/> | ||
<path | ||
android:pathData="M36.826,46.376C40.478,48.375 47.688,54.134 47.314,61.186C52.915,53.625 58.659,40.078 36.826,46.376Z" | ||
android:fillColor="#6E61FF"/> | ||
<path | ||
android:pathData="M27.114,33.687L21.523,30.514L46.241,25.778L52.234,28.614L27.114,33.687Z" | ||
android:fillColor="#A8A0FF"/> | ||
<path | ||
android:pathData="M46.379,29.792L46.277,25.773L52.174,28.59L46.379,29.792Z" | ||
android:fillColor="#6E61FF"/> | ||
<path | ||
android:pathData="M6.3,51.565a1.097,1.865 0,1 0,2.194 0a1.097,1.865 0,1 0,-2.194 0z" | ||
android:fillColor="#A8A0FF"/> | ||
<path | ||
android:pathData="M13.981,56.503a1.097,1.755 0,1 0,2.194 0a1.097,1.755 0,1 0,-2.194 0z" | ||
android:fillColor="#A8A0FF"/> | ||
<path | ||
android:pathData="M27.792,26.815a10.99,6.524 123.595,1 1,12.134 -18.328a10.99,6.524 123.595,1 1,-12.134 18.328z" | ||
android:fillColor="#C6D968"/> | ||
<path | ||
android:pathData="M39.707,8.364L42.267,10.005L41.902,12.921L38.244,10.369L39.707,8.364Z" | ||
android:fillColor="#C6D968"/> | ||
<path | ||
android:pathData="M28.554,24.223L31.114,25.864L30.017,28.234L27.823,26.775L28.554,24.223Z" | ||
android:fillColor="#C6D968"/> | ||
<path | ||
android:pathData="M30.016,28.272a10.99,6.524 123.595,1 1,12.134 -18.328a10.99,6.524 123.595,1 1,-12.134 18.328z" | ||
android:fillColor="#E5F3AE"/> | ||
<path | ||
android:pathData="M31.284,26.603a8.647,5.133 123.595,1 1,9.547 -14.421a8.647,5.133 123.595,1 1,-9.547 14.421z" | ||
android:fillColor="#DFF37C"/> | ||
<path | ||
android:pathData="M37.593,19.203C38.632,18.767 39.214,18.205 39.214,17.216C39.214,16.239 38.863,15.47 37.857,15.47L35.514,16.343V20.082L37.593,19.203ZM33.784,25.081V15.47L38.148,14.016C40.119,14.016 40.863,15.1 40.863,16.925C40.863,18.762 39.699,20.028 37.646,20.804L35.514,21.702V24.295L33.784,25.081Z" | ||
android:fillColor="#ffffff"/> | ||
</group> | ||
</vector> |
This file contains 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
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.
없어도 될 것 같네요