From 1595212ea6a5346371846e8873d17ce926723dab Mon Sep 17 00:00:00 2001 From: mechanicjo Date: Sun, 29 Oct 2023 10:59:42 +0900 Subject: [PATCH] feat: Posting Screen frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit posting screen에서 간단한 component 추가하였습니다. 갤러리에서 사진 가져오기, 카메라 앱을 통한 이미지 촬영은 월요일에 구현 예정입니다. --- .../fooriend/ui/component/ProfileSection.kt | 7 +-- .../fooriend/ui/screen/PostingScreen.kt | 45 +++++++++++++++++-- .../fooriend/ui/screen/mypage/MyPageScreen.kt | 2 +- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/frontend/app/src/main/java/com/team13/fooriend/ui/component/ProfileSection.kt b/frontend/app/src/main/java/com/team13/fooriend/ui/component/ProfileSection.kt index 17339ed..bb698b9 100644 --- a/frontend/app/src/main/java/com/team13/fooriend/ui/component/ProfileSection.kt +++ b/frontend/app/src/main/java/com/team13/fooriend/ui/component/ProfileSection.kt @@ -41,6 +41,7 @@ fun ProfileSection( userProfileImageUrl : Int = R.drawable.profile_cat, isFooried : Boolean = false, onFollowClick : () -> Unit = {}, + isMyPage : Boolean = false, ) { var isFollowed by remember { mutableStateOf(isFooried) } Row( @@ -75,14 +76,14 @@ fun ProfileSection( horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically ) { - Text(text = "$followersCount Followers", color = MaterialTheme.colorScheme.primary) + Text(text = "Followers \n $followersCount", color = MaterialTheme.colorScheme.primary) Spacer(modifier = Modifier.width(16.dp)) - Text(text = "$followingCount Following", color = MaterialTheme.colorScheme.primary) + Text(text = "Following \n $followingCount", color = MaterialTheme.colorScheme.primary) } Spacer(modifier = Modifier.height(8.dp)) // 팔로우 버튼이 null이 아닌경우 == mypage에서 호출하지 않은 경우 - if(onFollowClick != {}){ + if(!isMyPage){ if(!isFollowed){ Button(onClick = onFollowClick) { Text(text = "Follow") diff --git a/frontend/app/src/main/java/com/team13/fooriend/ui/screen/PostingScreen.kt b/frontend/app/src/main/java/com/team13/fooriend/ui/screen/PostingScreen.kt index 397aba1..4f0e2cc 100644 --- a/frontend/app/src/main/java/com/team13/fooriend/ui/screen/PostingScreen.kt +++ b/frontend/app/src/main/java/com/team13/fooriend/ui/screen/PostingScreen.kt @@ -1,19 +1,34 @@ package com.team13.fooriend.ui.screen +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box 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.heightIn import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Close import androidx.compose.material3.Button import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.OutlinedButton import androidx.compose.material3.Text +import androidx.compose.material3.TextField import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +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.graphics.Color import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -22,6 +37,7 @@ fun PostingScreen( onCloseClick: () -> Unit = {}, onPostClick: () -> Unit = {}, ){ + val (content, contentValue) = remember { mutableStateOf("") } Column( modifier = Modifier.padding(16.dp) ){ @@ -38,15 +54,38 @@ fun PostingScreen( } } // 음식점 이름 - Text(text = "음식점 이름") + Text(text = "용찬 반점") // 리뷰 작성 textfield (최대 140자) - Text(text = "리뷰 작성") + TextField( + modifier = Modifier + .fillMaxWidth() + .heightIn(min = 100.dp), + value = content, + onValueChange = contentValue + ) // 사진 등록 (최대 ?장) Text(text = "사진 등록") + OutlinedButton( + onClick = { /*TODO*/ }, + shape = RoundedCornerShape(10.dp), + ) { + Text( + text = "사진 등록" + ) + } // 영수증 사진 첨부 Text(text = "영수증 사진 첨부") + OutlinedButton( + onClick = { /*TODO*/ }, + shape = RoundedCornerShape(10.dp), + ) { + Text( + text = "영수증 등록" + ) + } // 리뷰 등록 - Button(onClick = onPostClick) { + Spacer(modifier = Modifier.height(20.dp)) + Button(onClick = { onPostClick() }, modifier = Modifier.fillMaxWidth().align(Alignment.CenterHorizontally)){ Text(text = "리뷰 등록") } diff --git a/frontend/app/src/main/java/com/team13/fooriend/ui/screen/mypage/MyPageScreen.kt b/frontend/app/src/main/java/com/team13/fooriend/ui/screen/mypage/MyPageScreen.kt index efd83a1..01bccd5 100644 --- a/frontend/app/src/main/java/com/team13/fooriend/ui/screen/mypage/MyPageScreen.kt +++ b/frontend/app/src/main/java/com/team13/fooriend/ui/screen/mypage/MyPageScreen.kt @@ -61,7 +61,7 @@ fun MyPageScreen( } } // 프로필 섹션 - ProfileSection() + ProfileSection(isMyPage = true) Spacer(modifier = Modifier.height(16.dp))