Skip to content
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

feature/mypage: 마이페이지 ui 구현 #32

Merged
merged 37 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5b6517a
feat: 이동봉사 중개자 프로필 ui 구현
kang9366 Nov 18, 2023
a47f07b
chore: pager 라이브러리 추가
kang9366 Nov 18, 2023
debdce1
feat: 정보를 표시하기 위한 Card 추가
kang9366 Nov 18, 2023
a05d266
update: 프로필 상세보기 버튼을 클릭하면 이동봉사 중개자 프로필 화면으로 이동하도록 구혀
kang9366 Nov 18, 2023
3f1f1c0
update: 프로필 상세보기 버튼을 클릭하면 이동봉사 중개자 프로필 화면으로 이동하도록 구혀
kang9366 Nov 18, 2023
bd6d110
update: 다른 화면에서 view를 재사용하기 위해 함수의 접근제한자 수정
kang9366 Nov 18, 2023
e7aeb0a
update: 프로필 상세보기 버튼을 클릭하면 이동봉사 중개자 프로필 화면으로 이동하도록 구현
kang9366 Nov 18, 2023
c16b39c
update: 프로필 상세보기 버튼을 클릭하면 이동봉사 중개자 프로필 화면으로 이동하도록 구현
kang9366 Nov 18, 2023
5232c04
update: 다른 화면에서 view를 재사용하기 위해 함수의 접근제한자 수정
kang9366 Nov 18, 2023
620f78b
style: 뱃지 아이콘 파일 추가
kang9366 Nov 18, 2023
dcbb80c
style: 저장 아이콘 파일 추가
kang9366 Nov 18, 2023
56cfbf0
style: 화살표 아이콘 파일 추가
kang9366 Nov 18, 2023
b3deb58
style: string 값 추가
kang9366 Nov 18, 2023
4b903e3
feat: 마이페이지 ui 구현
kang9366 Nov 18, 2023
573a5f4
update: 마이페이지 TopAppBar 구현을 위해 코드 수정
kang9366 Nov 19, 2023
a92de19
style: string value 추가
kang9366 Nov 19, 2023
dea4ac4
feat: 프로필 수정 ui 구현
kang9366 Nov 19, 2023
0eb835c
feat: 계정 정보 관리 ui 구현
kang9366 Nov 19, 2023
3e4f211
feat: 설정 ui 구현
kang9366 Nov 19, 2023
251a7d3
style: string value 추가
kang9366 Nov 19, 2023
34004f2
chore: 시작 activity 임시 수정
kang9366 Nov 19, 2023
fc6b2a4
update: NormalButton 추가
kang9366 Nov 19, 2023
895cb82
update: 수정된 경로 반영
kang9366 Nov 19, 2023
3a06773
update: 수정된 경로 반영
kang9366 Nov 19, 2023
ea31eeb
update: 수정된 경로 반영
kang9366 Nov 19, 2023
b543a40
update: 수정된 경로 반영
kang9366 Nov 19, 2023
a97a481
update: 새로 구현한 화면으로 이동할 수 있도록 구현
kang9366 Nov 19, 2023
2712610
update: 새로 구현한 화면으로 이동할 수 있도록 구현
kang9366 Nov 19, 2023
5f2991e
update: 새로 구현한 화면으로 이동할 수 있도록 구현
kang9366 Nov 19, 2023
051c8bf
update: 새로 구현한 화면으로 이동할 수 있도록 구현
kang9366 Nov 19, 2023
5da268f
style: 잠긴 배지 아이콘 파일 추가
kang9366 Nov 19, 2023
9c11c26
feat: 알림 화면 구현 (content는 추후에 추가할 예정)
kang9366 Nov 19, 2023
24cfe58
feat: 배지 모음 ui 구현
kang9366 Nov 19, 2023
2c6e609
update: 계정 정보 관리 화면으로 이동할 수 있도록 구현
kang9366 Nov 19, 2023
bd95c14
chore: ktlint 포매팅 적용
kang9366 Nov 19, 2023
a49a355
Merge branch 'develop' into feature/mypage
kang9366 Nov 19, 2023
397cc27
update: 잘못 들어간 코드 제거
kang9366 Nov 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.kusitms.connectdog.core.designsystem.component
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
Expand Down Expand Up @@ -71,6 +72,25 @@ fun ConnectDogIconBottomButton(
}
}

@Composable
fun NormalButton(
content: String,
color: Color = MaterialTheme.colorScheme.primary,
onClick: () -> Unit = {},
textColor: Color = MaterialTheme.colorScheme.onPrimary,
modifier: Modifier = Modifier
.fillMaxWidth()
.height(56.dp)
) {
ConnectDogBottomButton(
onClick = onClick,
content = content,
color = color,
modifier = modifier,
textColor = textColor
)
}

@Composable
fun ConnectDogOutlinedButton(
width: Int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
package com.kusitms.connectdog.core.designsystem.component

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
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.wrapContentHeight
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kusitms.connectdog.core.designsystem.theme.Gray3
import com.kusitms.connectdog.core.designsystem.theme.Gray7

@Composable
fun ConnectDogCard(
Expand All @@ -33,6 +42,36 @@ fun ConnectDogCard(
)
}

@Composable
fun ConnectDogInformationCard(
title: String,
content: String
) {
Box(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(4.dp))
.background(Gray7)
.padding(all = 10.dp)
) {
Column(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = title,
fontSize = 14.sp,
fontWeight = FontWeight.SemiBold
)
Spacer(modifier = Modifier.height(5.dp))
Text(
text = content,
fontSize = 14.sp,
color = Gray3
)
}
}
}

@Composable
fun ConnectDogExpandableCard(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ fun ConnectDogTopAppBar(
Text(
text = stringResource(id = titleRes),
color = contentColor,
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.align(Alignment.Center)
style = if (navigationType == TopAppBarNavigationType.MYPAGE) {
MaterialTheme.typography.titleLarge
} else { MaterialTheme.typography.titleMedium },
modifier = if (navigationType == TopAppBarNavigationType.MYPAGE) {
Modifier.align(Alignment.CenterStart).padding(start = 24.dp)
} else {
Modifier.align(Alignment.Center)
}
)
}
}
Expand All @@ -108,7 +114,7 @@ private fun HomeIcon(
)
}

enum class TopAppBarNavigationType { BACK, HOME, CLOSE }
enum class TopAppBarNavigationType { BACK, HOME, CLOSE, MYPAGE }

@Preview
@Composable
Expand Down
2 changes: 2 additions & 0 deletions feature/home/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ dependencies {
implementation(libs.androidx.lifecycle.runtimeCompose)
implementation(libs.androidx.lifecycle.viewModelCompose)
implementation(libs.androidx.lifecycle.viewModelKtx)
implementation(libs.accompanist.pager)
implementation(libs.accompanist.pager.indicators)

// compose
implementation(platform(libs.androidx.compose.bom))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.kusitms.connectdog.feature.home.screen.CompleteApplyScreen
import com.kusitms.connectdog.feature.home.screen.DetailScreen
import com.kusitms.connectdog.feature.home.screen.FilterSearchRoute
import com.kusitms.connectdog.feature.home.screen.HomeRoute
import com.kusitms.connectdog.feature.home.screen.IntermediatorProfileScreen
import com.kusitms.connectdog.feature.home.screen.ReviewScreen
import com.kusitms.connectdog.feature.home.screen.SearchScreen

Expand Down Expand Up @@ -68,6 +69,14 @@ fun NavController.navigateComplete() {
navigate(HomeRoute.complete)
}

fun NavController.navigateIntermediatorProfile() {
navigate(HomeRoute.intermediatorProfile)
}

fun NavController.navigateNotification() {
navigate(HomeRoute.notification)
}

fun NavGraphBuilder.homeNavGraph(
onBackClick: () -> Unit,
onNavigateToSearch: () -> Unit,
Expand All @@ -79,6 +88,8 @@ fun NavGraphBuilder.homeNavGraph(
onNavigateToCertification: () -> Unit,
onNavigateToApply: () -> Unit,
onNavigateToComplete: () -> Unit,
onNavigateToIntermediatorProfile: () -> Unit,
onNavigateToNotification: () -> Unit,
onShowErrorSnackBar: (throwable: Throwable?) -> Unit
) {
composable(route = HomeRoute.route) {
Expand All @@ -87,6 +98,7 @@ fun NavGraphBuilder.homeNavGraph(
onNavigateToFilterSearch,
onNavigateToReview,
onNavigateToDetail,
onNavigateToNotification,
onShowErrorSnackBar
)
}
Expand Down Expand Up @@ -147,7 +159,8 @@ fun NavGraphBuilder.homeNavGraph(
composable(route = HomeRoute.detail) {
DetailScreen(
onBackClick = onBackClick,
onCertificationClick = onNavigateToCertification
onCertificationClick = onNavigateToCertification,
onIntermediatorProfileClick = onNavigateToIntermediatorProfile
)
}

Expand All @@ -170,6 +183,18 @@ fun NavGraphBuilder.homeNavGraph(
onClick = onNavigateToSearch
)
}

composable(route = HomeRoute.intermediatorProfile) {
IntermediatorProfileScreen(
onBackClick = onBackClick
)
}

composable(route = HomeRoute.notification) {
// NotificationScreen(
// onClick = navigateNotification
// )
}
}

object HomeRoute {
Expand All @@ -182,4 +207,6 @@ object HomeRoute {
const val certification = "certification"
const val apply = "apply"
const val complete = "complete"
const val intermediatorProfile = "intermediatorProfile"
const val notification = "notification"
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.component.ConnectDogTopAppBar
import com.kusitms.connectdog.core.designsystem.component.NormalButton
import com.kusitms.connectdog.core.designsystem.component.NormalTextField
import com.kusitms.connectdog.core.designsystem.component.TopAppBarNavigationType
import com.kusitms.connectdog.core.designsystem.theme.Gray2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.ui.unit.sp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.component.ConnectDogTextFieldWithButton
import com.kusitms.connectdog.core.designsystem.component.ConnectDogTopAppBar
import com.kusitms.connectdog.core.designsystem.component.NormalButton
import com.kusitms.connectdog.core.designsystem.component.NormalTextField
import com.kusitms.connectdog.core.designsystem.component.TopAppBarNavigationType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.component.NormalButton
import com.kusitms.connectdog.core.designsystem.theme.ConnectDogTheme
import com.kusitms.connectdog.core.designsystem.theme.Gray2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Divider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -29,17 +28,17 @@ 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.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.kusitms.connectdog.core.designsystem.component.ConnectDogBottomButton
import com.kusitms.connectdog.core.designsystem.component.ConnectDogInformationCard
import com.kusitms.connectdog.core.designsystem.component.ConnectDogTag
import com.kusitms.connectdog.core.designsystem.component.ConnectDogTopAppBar
import com.kusitms.connectdog.core.designsystem.component.NetworkImage
import com.kusitms.connectdog.core.designsystem.component.NormalButton
import com.kusitms.connectdog.core.designsystem.component.TopAppBarNavigationType
import com.kusitms.connectdog.core.designsystem.theme.Gray1
import com.kusitms.connectdog.core.designsystem.theme.Gray2
Expand All @@ -56,7 +55,8 @@ internal fun DetailScreen(
imageUrl: String = "",
title: String = "인천 댕댕구 -> 서울 댕댕구",
content: String = "내용",
onCertificationClick: () -> Unit
onCertificationClick: () -> Unit,
onIntermediatorProfileClick: () -> Unit
) {
Scaffold(
topBar = {
Expand Down Expand Up @@ -84,30 +84,11 @@ internal fun DetailScreen(
)
Content(title, content)
DogInfo()
IntermediatorInfo()
IntermediatorInfo(onIntermediatorProfileClick)
}
}
}

@Composable
fun NormalButton(
content: String,
color: Color = PetOrange,
onClick: () -> Unit = {},
textColor: Color = MaterialTheme.colorScheme.onPrimary,
modifier: Modifier = Modifier
.fillMaxWidth()
.height(56.dp)
) {
ConnectDogBottomButton(
onClick = onClick,
content = content,
color = color,
modifier = modifier,
textColor = textColor
)
}

@Composable
fun BookmarkButton(onClick: () -> Unit = {}) {
val shape = RoundedCornerShape(12.dp)
Expand Down Expand Up @@ -220,7 +201,7 @@ fun DogInfo() {
Spacer(modifier = Modifier.height(8.dp))
DetailInfo("몸무게", "밍밍이")
Spacer(modifier = Modifier.height(20.dp))
Significant()
ConnectDogInformationCard(title = "특이사항", content = "특이사항")
}
Divider(
Modifier
Expand All @@ -231,34 +212,9 @@ fun DogInfo() {
}

@Composable
fun Significant() {
Box(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(4.dp))
.background(Gray7)
.padding(all = 10.dp)
) {
Column(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "특이사항",
fontSize = 14.sp,
fontWeight = FontWeight.SemiBold
)
Spacer(modifier = Modifier.height(5.dp))
Text(
text = "특이사항",
fontSize = 14.sp,
color = Gray3
)
}
}
}

@Composable
fun IntermediatorInfo() {
fun IntermediatorInfo(
onClick: () -> Unit
) {
Column(
modifier = Modifier
.fillMaxWidth()
Expand Down Expand Up @@ -296,7 +252,8 @@ fun IntermediatorInfo() {
modifier = Modifier
.width(100.dp)
.height(34.dp)
.align(Alignment.CenterVertically)
.align(Alignment.CenterVertically),
onClick = onClick
)
}
}
Expand Down
Loading