Skip to content

Commit

Permalink
Merge pull request #81 from everymeals/feature/mypage
Browse files Browse the repository at this point in the history
[feature/mypage] 마이페이지 메인 화면 뷰 구성
  • Loading branch information
SsongSik authored Nov 6, 2023
2 parents 513eba3 + fa857eb commit 86ae3b6
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,251 @@
package com.everymeal.presentation.ui.mypage

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
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.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Divider
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarColors
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.everymeal.presentation.R
import com.everymeal.presentation.ui.theme.EveryMealTypography
import com.everymeal.presentation.ui.theme.Gray100
import com.everymeal.presentation.ui.theme.Gray200
import com.everymeal.presentation.ui.theme.Gray400
import com.everymeal.presentation.ui.theme.Gray600
import com.everymeal.presentation.ui.theme.Gray800
import com.everymeal.presentation.ui.theme.Gray900


@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MyPageScreen(

) {
Text(
text = "MyPageScreen",
)
Scaffold(
topBar = {
TopAppBar(
title = { },
colors = TopAppBarDefaults.topAppBarColors(
containerColor = Color.White,
)
)
}
) { innerPadding ->
LazyColumn(
modifier = Modifier.padding(innerPadding),
) {
item(key = "My Information") {
Spacer(modifier = Modifier.padding(8.dp))
MyInformation(Modifier.padding(horizontal = 20.dp))
Divider(
modifier = Modifier.padding(20.dp),
color = Gray200,
thickness = 1.dp
)
}

item(key = "My Activities") {
MyActivities(Modifier.padding(horizontal = 20.dp))
Spacer(modifier = Modifier.padding(24.dp))
Divider(
color = Gray100,
thickness = 12.dp
)
Spacer(modifier = Modifier.padding(24.dp))
}

item(key = "My Settings") {
MySettings(Modifier.padding(horizontal = 20.dp))
Spacer(modifier = Modifier.padding(24.dp))
}
}
}
}

@Composable
fun MyInformation(
modifier: Modifier = Modifier
) {
Column (
modifier = modifier
) {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.my_page_bean_image),
contentDescription = null,
)
Text(
text = stringResource(id = R.string.my_page_univ_correct),
style = EveryMealTypography.Title1,
modifier = Modifier.padding(start = 16.dp)
)
Spacer(Modifier.weight(1f))
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.icon_arrow_right),
contentDescription = null,
modifier = Modifier.size(24.dp)
)
}
Spacer(modifier = Modifier.padding(16.dp))
Row (
modifier = Modifier
.background(Gray100, RoundedCornerShape(8.dp))
.padding(14.dp)
) {
Image(
modifier = Modifier.size(44.dp),
painter = painterResource(id = R.drawable.icon_school),
contentDescription = null
)
Spacer(modifier = Modifier.padding(10.dp))
Column {
Text(
text = stringResource(id = R.string.my_page_univ_need),
style = EveryMealTypography.Title3,
color = Gray900
)
Spacer(modifier = Modifier.padding(2.dp))
Text(
text = stringResource(id = R.string.my_page_if_need_can_function),
style = EveryMealTypography.Body3,
color = Gray600,
maxLines = 2
)
}
}
}
}

@Composable
fun MyActivities(
modifier: Modifier = Modifier
) {
Column (
modifier = modifier
) {
Text(
text = stringResource(id = R.string.my_page_my_activities),
style = EveryMealTypography.Title1,
color = Gray900
)
MyTabMenu(
menuTitle = "저장",
onClick = { }
)
MyTabMenu(
menuTitle = "리뷰 내역",
onClick = { }
)
MyTabMenu(
menuTitle = "사진 내역",
onClick = { }
)
}
}

@Composable
fun MySettings(
modifier: Modifier = Modifier
) {
Column (
modifier = modifier
) {
Text(
text = stringResource(id = R.string.my_page_settings),
style = EveryMealTypography.Title1,
color = Gray900
)
MyTabMenu(
menuTitle = "문의하기",
onClick = { }
)
MyTabMenu(
menuTitle = "서비스 약관",
onClick = { }
)
MyTabMenu(
menuTitle = "오픈소스 라이센스",
onClick = { }
)
MyTabMenu(
menuTitle = "오픈소스 라이센스",
isAppVersion = true,
onClick = { }
)
MyTabMenu(
menuTitle = "탈퇴하기",
onClick = { }
)
}
}

@Composable
fun MyTabMenu(
modifier: Modifier = Modifier,
menuTitle: String,
isAppVersion: Boolean = false,
onClick: () -> Unit,
) {
Column (
modifier = modifier
.fillMaxWidth()
.padding(top = 24.dp)
.clickable(onClick = onClick)
.padding(vertical = 3.dp)
) {
Row (
modifier = modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = menuTitle,
style = EveryMealTypography.Body2,
color = Gray800
)
if(isAppVersion) {
Text(
text = "1.0.0",
style = EveryMealTypography.Body2,
color = Gray400
)
} else {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.icon_arrow_right),
contentDescription = null,
modifier = Modifier.size(20.dp),
tint = Gray400
)
}
}
}
}

@Preview
Expand Down
13 changes: 13 additions & 0 deletions presentation/src/main/res/drawable/my_page_bean_image.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="60dp"
android:height="60dp"
android:viewportWidth="60"
android:viewportHeight="60">
<path
android:pathData="M30,0L30,0A30,30 0,0 1,60 30L60,30A30,30 0,0 1,30 60L30,60A30,30 0,0 1,0 30L0,30A30,30 0,0 1,30 0z"
android:fillColor="#F2F4F6"/>
<path
android:pathData="M35.701,23.751C35.701,24.501 35.554,25.244 35.267,25.937C34.98,26.63 34.559,27.259 34.029,27.79C33.499,28.32 32.869,28.741 32.176,29.028C31.483,29.315 30.741,29.463 29.991,29.463C28.476,29.463 27.024,28.861 25.952,27.79C24.881,26.72 24.279,25.267 24.279,23.752C24.279,23.003 24.427,22.26 24.714,21.567C25.001,20.874 25.421,20.244 25.952,19.714C27.022,18.643 28.475,18.041 29.99,18.041C31.504,18.041 32.957,18.642 34.028,19.713C35.099,20.784 35.701,22.237 35.701,23.751ZM29.99,31.21C21.766,31.21 18.567,36.443 18.567,38.878C18.567,41.312 25.377,41.961 29.99,41.961C34.603,41.961 41.413,41.312 41.413,38.878C41.413,36.443 38.214,31.21 29.99,31.21Z"
android:fillColor="#B0B8C1"
android:fillType="evenOdd"/>
</vector>
6 changes: 6 additions & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,10 @@
<string name="restaurant_review">리뷰 작성하기</string>
<string name="register_review">리뷰가 등록되었어요</string>

<!-- 마이페이지 화면 -->
<string name="my_page_univ_correct">인증하기</string>
<string name="my_page_univ_need">학교 인증이 필요해요</string>
<string name="my_page_if_need_can_function">학교를 인증하면 리뷰 작성, 사진 등록 등 에브리밀을 다양하게 이용할 수 있어요!</string>
<string name="my_page_my_activities">나의 활동</string>
<string name="my_page_settings">설정</string>
</resources>

0 comments on commit 86ae3b6

Please sign in to comment.