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/#134 profile edit #137

Merged
merged 11 commits into from
Oct 28, 2024
Merged
9 changes: 9 additions & 0 deletions core/designsystem/src/main/res/drawable/ic_camera.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="11dp"
android:viewportWidth="12"
android:viewportHeight="11">
<path
android:pathData="M5.833,8.458C6.563,8.458 7.182,8.203 7.693,7.693C8.203,7.182 8.458,6.563 8.458,5.833C8.458,5.104 8.203,4.484 7.693,3.974C7.182,3.464 6.563,3.208 5.833,3.208C5.104,3.208 4.484,3.464 3.974,3.974C3.464,4.484 3.208,5.104 3.208,5.833C3.208,6.563 3.464,7.182 3.974,7.693C4.484,8.203 5.104,8.458 5.833,8.458ZM5.833,7.292C5.425,7.292 5.08,7.151 4.798,6.869C4.516,6.587 4.375,6.242 4.375,5.833C4.375,5.425 4.516,5.08 4.798,4.798C5.08,4.516 5.425,4.375 5.833,4.375C6.242,4.375 6.587,4.516 6.869,4.798C7.151,5.08 7.292,5.425 7.292,5.833C7.292,6.242 7.151,6.587 6.869,6.869C6.587,7.151 6.242,7.292 5.833,7.292ZM1.167,10.5C0.846,10.5 0.571,10.386 0.343,10.157C0.114,9.929 0,9.654 0,9.333V2.333C0,2.013 0.114,1.738 0.343,1.509C0.571,1.281 0.846,1.167 1.167,1.167H3.004L3.733,0.379C3.84,0.262 3.969,0.17 4.12,0.102C4.27,0.034 4.428,0 4.594,0H7.073C7.238,0 7.396,0.034 7.547,0.102C7.698,0.17 7.826,0.262 7.933,0.379L8.663,1.167H10.5C10.821,1.167 11.095,1.281 11.324,1.509C11.552,1.738 11.667,2.013 11.667,2.333V9.333C11.667,9.654 11.552,9.929 11.324,10.157C11.095,10.386 10.821,10.5 10.5,10.5H1.167Z"
android:fillColor="#131318"/>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.record.mypage.navigation.navigateToFollowing
import com.record.profile.navigation.ProfileRoute
import com.record.profile.navigation.navigateProfile
import com.record.search.navigation.navigateSearch
import com.record.setting.navigate.navigateProfileEdit
import com.record.setting.navigate.navigateSetting
import com.record.upload.navigation.UploadRoute
import com.record.upload.navigation.navigateToUpload
Expand Down Expand Up @@ -126,6 +127,10 @@ internal class MainNavigator(
navController.navigateSetting(navOptions { })
}

fun navigateProfileEdit() {
navController.navigateProfileEdit(navOptions { })
}

fun navigateDetail() {
navController.navigateDetail(navOptions { })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ internal fun MainScreen(

settingNavGraph(
padding = innerPadding,
navigateToLogin = { navigator.navigateLogin() },
popBackStack = navigator::popBackStackIfNotHome,
navigateToLogin = navigator::navigateLogin,
navigateToProfileEdit = navigator::navigateProfileEdit,
)

searchNavGraph(
Expand Down
172 changes: 172 additions & 0 deletions feature/setting/src/main/java/com/record/setting/ProfileEditRoute.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
package com.record.setting

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
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.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.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.record.designsystem.R
import com.record.designsystem.component.button.RecordyButton
import com.record.designsystem.component.textfield.RecordyValidateTextfield
import com.record.designsystem.theme.RecordyTheme
import com.record.ui.extension.customClickable

@Composable
fun ProfileEditRoute(
padding: PaddingValues,
modifier: Modifier,
popBackStack: () -> Unit,
) {
ProfileScreen(padding, modifier, popBackStack)
}

@Composable
fun ProfileScreen(
padding: PaddingValues,
modifier: Modifier,
popBackStack: () -> Unit,
) {
Column(
modifier = modifier
.fillMaxSize()
.padding(padding)
.background(color = RecordyTheme.colors.background),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Box(
modifier = Modifier
.background(color = Color.Transparent)
.fillMaxWidth()
.height(54.dp)
.padding(vertical = 15.dp),
) {
Icon(
ImageVector.vectorResource(id = R.drawable.ic_angle_left_24),
contentDescription = "๋’ค๋กœ๊ฐ€๊ธฐ",
tint = RecordyTheme.colors.gray01,
modifier = Modifier
.align(Alignment.CenterStart)
.customClickable {
popBackStack()
}
.padding(start = 20.dp),
)

Text(
modifier = Modifier.align(Alignment.Center),
text = "ํ”„๋กœํ•„์ˆ˜์ •",
color = Color.White,
style = RecordyTheme.typography.title3,
)
}
Spacer(
modifier = Modifier
.height(36.dp)
.fillMaxWidth(),
)

Box(
modifier = Modifier
.fillMaxWidth(0.3f)
.aspectRatio(1f),
) {
Box(
modifier = Modifier
.clip(CircleShape)
.background(color = RecordyTheme.colors.viskitYellow80)
.padding(2.dp)
.fillMaxWidth()
.aspectRatio(1f),
contentAlignment = Alignment.Center,
) {
Box(
modifier = Modifier
.clip(CircleShape)
.background(color = RecordyTheme.colors.background)
.fillMaxSize(),
contentAlignment = Alignment.Center,
) {
Image(
painter = painterResource(id = R.drawable.img_profileedit),
contentDescription = "ํ”„๋กœํ•„ ์‚ฌ์ง„",
contentScale = ContentScale.Crop,
modifier = Modifier
.fillMaxSize()
.clip(CircleShape),
)
}
}
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_camera),
contentDescription = "์‚ฌ์ง„ ๋ณ€๊ฒฝ",
tint = RecordyTheme.colors.background,
modifier = Modifier
.align(Alignment.BottomEnd)
.padding(end = 6.dp)
.padding(bottom = 6.dp)
.clip(CircleShape)
.background(RecordyTheme.colors.gray01)
.padding(6.dp),
)
}

Spacer(modifier = Modifier.height(24.dp))

Column(
horizontalAlignment = Alignment.Start,
modifier = Modifier.padding(horizontal = 20.dp),
) {
Text(
text = "๋‹‰๋„ค์ž„ ์ˆ˜์ •",
style = RecordyTheme.typography.title4,
color = Color.White,
)
Spacer(modifier = Modifier.height(12.dp))
RecordyValidateTextfield(
onValueChange = {
},
padding = PaddingValues(),
)
}

Spacer(modifier = Modifier.weight(1f))

RecordyButton(
enabled = false,
text = "๋‹ค์Œ",
modifier = Modifier
.padding(horizontal = 20.dp)
.padding(bottom = 14.dp),
)
}
}

@Preview
@Composable
fun PreviewProfileEdit() {
RecordyTheme {
Box(modifier = Modifier.fillMaxSize()) {
ProfileScreen(PaddingValues(), Modifier, {})
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ data class SettingState(

sealed interface SettingSideEffect : SideEffect {
data object Restart : SettingSideEffect
data object ProfileEdit : SettingSideEffect
}
Loading