-
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
#21: 편집 화면 전까지 회원가입 화면 추가 #25
Changes from all commits
3f85aec
2a4890a
6087dc3
df0cbd4
5c71714
67ad16c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.bff.wespot.model | ||
|
||
data class SchoolItem( | ||
val id: String, | ||
val name: String, | ||
val address: String, | ||
) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
package com.bff.wespot.ui | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.clickable | ||
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.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.wrapContentHeight | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.School | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Surface | ||
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.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import com.bff.wespot.designsystem.theme.StaticTypeScale | ||
import com.bff.wespot.designsystem.theme.WeSpotTheme | ||
import com.bff.wespot.designsystem.theme.WeSpotThemeManager | ||
import com.bff.wespot.designsystem.util.OrientationPreviews | ||
|
||
@Composable | ||
fun SchoolListItem( | ||
schoolName: String, | ||
address: String, | ||
selected: Boolean, | ||
onClick: () -> Unit = { } | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.wrapContentHeight() | ||
.padding(vertical = 8.dp) | ||
.clip(WeSpotThemeManager.shapes.medium) | ||
Comment on lines
+44
to
+46
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. 그냥 궁금한 내용인데요.! 디자인 시스템 내의 아이템 내 버티컬 패딩이 아닌, LazyColuimn 내에 contentPadding을 사용할 수도 있지 않을까요 ? 승원장의 생각도 궁금하네용~ 나중에 패딩 값 다른 리스트 나오면 대처하기 쉽지 않을까요 ? 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. 제 생각에는 다른 패팅 값이 있는 리스트가 나올 수가 없다고 생각하여 여기에 적용하긴 했어요. |
||
.border( | ||
width = 1.dp, | ||
color = if(selected) { | ||
WeSpotThemeManager.colors.primaryColor | ||
} else { | ||
WeSpotThemeManager.colors.cardBackgroundColor | ||
}, | ||
shape = WeSpotThemeManager.shapes.medium | ||
) | ||
.background(WeSpotThemeManager.colors.cardBackgroundColor) | ||
.clickable { onClick.invoke() } | ||
flash159483 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) { | ||
Row( | ||
modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp), | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.size(56.dp) | ||
.clip(CircleShape) | ||
.background(Color.White), | ||
contentAlignment = Alignment.Center | ||
) { | ||
Icon( | ||
imageVector = Icons.Default.School, | ||
contentDescription = stringResource(id = R.string.school_icon) | ||
) | ||
} | ||
|
||
Column( | ||
modifier = Modifier.padding(top = 4.dp, bottom = 4.dp, start = 16.dp), | ||
verticalArrangement = Arrangement.spacedBy(4.dp) | ||
) { | ||
Text(text = schoolName, style = StaticTypeScale.Default.body2, maxLines = 1) | ||
Text( | ||
text = address, | ||
style = StaticTypeScale.Default.body6, | ||
color = WeSpotThemeManager.colors.txtSubColor, | ||
maxLines = 1 | ||
) | ||
} | ||
} | ||
Box( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(end = 14.dp, top = 14.dp), | ||
contentAlignment = Alignment.TopEnd | ||
) { | ||
Icon( | ||
painter = painterResource(id = R.drawable.exclude), | ||
contentDescription = "", | ||
tint = if (selected) { | ||
WeSpotThemeManager.colors.primaryColor | ||
} else { | ||
WeSpotThemeManager.colors.disableIcnColor | ||
} | ||
) | ||
} | ||
} | ||
} | ||
|
||
@OrientationPreviews | ||
@Composable | ||
private fun SchoolListItemPreview() { | ||
WeSpotTheme { | ||
Surface(modifier = Modifier.fillMaxSize()) { | ||
Column { | ||
repeat(10) { | ||
SchoolListItem( | ||
schoolName = "역삼 중학교", | ||
address = "서울특별시 강남구 도곡로 43길 10", | ||
selected = false | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.bff.wespot.ui | ||
|
||
import androidx.compose.foundation.layout.navigationBarsPadding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.ModalBottomSheet | ||
import androidx.compose.material3.SheetState | ||
import androidx.compose.material3.rememberStandardBottomSheetState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.bff.wespot.designsystem.theme.WeSpotThemeManager | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun WSBottomSheet( | ||
closeSheet: () -> Unit, | ||
sheetState: SheetState = rememberStandardBottomSheetState(), | ||
content: @Composable () -> Unit | ||
) { | ||
ModalBottomSheet( | ||
onDismissRequest = closeSheet, | ||
sheetState = sheetState, | ||
shape = RoundedCornerShape(topStart = 25.dp, topEnd = 25.dp), | ||
containerColor = WeSpotThemeManager.colors.bottomSheetColor, | ||
dragHandle = null, | ||
modifier = Modifier.navigationBarsPadding() | ||
) { | ||
content.invoke() | ||
} | ||
Comment on lines
+16
to
+30
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. 🥰🥰 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. dragHandle은 어떤 속성인가요 ?? 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. bottomsheet 위에 있는 조금만한 막대기에요. 디자인에 없어서 null로 설정했어요. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="20dp" | ||
android:height="20dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20"> | ||
<path | ||
android:pathData="M10,20C15.523,20 20,15.523 20,10C20,4.477 15.523,0 10,0C4.477,0 0,4.477 0,10C0,15.523 4.477,20 10,20ZM14.74,7.673C15.111,7.264 15.081,6.632 14.673,6.26C14.264,5.889 13.632,5.919 13.26,6.327L8.966,11.051L6.707,8.793C6.317,8.402 5.683,8.402 5.293,8.793C4.902,9.183 4.902,9.817 5.293,10.207L8.293,13.207C8.486,13.401 8.75,13.506 9.024,13.5C9.297,13.493 9.556,13.375 9.74,13.173L14.74,7.673Z" | ||
android:fillColor="#76777D" | ||
android:fillType="evenOdd"/> | ||
</vector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="school_icon">school icon</string> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
package com.bff.wespot.auth.screen | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.imePadding | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.text.KeyboardOptions | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.focus.FocusRequester | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.input.KeyboardType | ||
import androidx.compose.ui.unit.dp | ||
import androidx.lifecycle.viewmodel.compose.viewModel | ||
import com.bff.wespot.auth.R | ||
import com.bff.wespot.auth.state.AuthAction | ||
import com.bff.wespot.auth.viewmodel.AuthViewModel | ||
import com.bff.wespot.designsystem.component.button.WSButton | ||
import com.bff.wespot.designsystem.component.header.WSTopBar | ||
import com.bff.wespot.designsystem.component.input.WsTextField | ||
import com.bff.wespot.designsystem.theme.StaticTypeScale | ||
import com.bff.wespot.designsystem.theme.WeSpotThemeManager | ||
import kotlinx.coroutines.delay | ||
import org.orbitmvi.orbit.compose.collectAsState | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun ClassScreen(viewModel: AuthViewModel = viewModel()) { | ||
val keyboard = LocalSoftwareKeyboardController.current | ||
flash159483 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
val state by viewModel.collectAsState() | ||
val action = viewModel::onAction | ||
Comment on lines
+41
to
+43
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. collectAsState보다 collectAsStateWithLifecycle()은 어떨까요 ??? 따로 사용하신 이유가 있을까요!? 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. 없던데요 orbit viewModel에는 그 api가 없어요 |
||
val focusRequester = remember { FocusRequester() } | ||
|
||
Scaffold( | ||
topBar = { | ||
WSTopBar(title = stringResource(id = R.string.register), canNavigateBack = true) | ||
}, | ||
modifier = Modifier.padding(horizontal = 20.dp), | ||
) { | ||
Column( | ||
modifier = | ||
Modifier | ||
.fillMaxSize() | ||
.padding(it), | ||
verticalArrangement = Arrangement.spacedBy(12.dp), | ||
Comment on lines
+53
to
+57
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. 승원짱 원래 이렇게 작성하시는거에요? 아니면 린트가 이렇게 쓰라고 하던가요 ??
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. 린트가 시킨건데 아직 변경사항 #13 머지안해서 그런거라 머지하시면 한꺼번에 바꿀거에요 |
||
) { | ||
Text( | ||
text = stringResource(id = R.string.get_class), | ||
style = StaticTypeScale.Default.header1, | ||
) | ||
|
||
Text( | ||
text = stringResource(id = R.string.cannot_change_class_after_register), | ||
style = StaticTypeScale.Default.body6, | ||
color = Color(0xFF7A7A7A), | ||
) | ||
Comment on lines
+66
to
+68
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. 승원찡 가끔 하드코딩된 컬러 값이 있던데, 따로 사용하시는 이유가 있을까용? 디자인시스템 내에 등록하기 일회성이라서 애매한 색상들일까요 ? 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. 디자인에 이렇게 나와있어서 하드코딩했어요.. |
||
|
||
WsTextField( | ||
value = | ||
if (state.classNumber != -1) { | ||
state.classNumber.toString() | ||
} else { | ||
"" | ||
}, | ||
onValueChange = { classNumber -> | ||
if (classNumber.isEmpty()) { | ||
action(AuthAction.OnClassNumberChanged(-1)) | ||
return@WsTextField | ||
} | ||
action(AuthAction.OnClassNumberChanged(classNumber.toInt())) | ||
}, | ||
placeholder = stringResource(id = R.string.enter_number), | ||
focusRequester = focusRequester, | ||
keyBoardOption = KeyboardOptions(keyboardType = KeyboardType.Number), | ||
) | ||
|
||
if (state.classNumber != -1 && state.classNumber !in 1..20) { | ||
Text( | ||
text = stringResource(id = R.string.class_number_error), | ||
color = WeSpotThemeManager.colors.dangerColor, | ||
style = StaticTypeScale.Default.body8, | ||
) | ||
} | ||
} | ||
} | ||
|
||
Box( | ||
modifier = | ||
Modifier | ||
.fillMaxSize() | ||
.imePadding(), | ||
contentAlignment = Alignment.BottomCenter, | ||
) { | ||
WSButton( | ||
onClick = { }, | ||
text = stringResource(id = R.string.next), | ||
enabled = state.classNumber in 1..20, | ||
) { | ||
it.invoke() | ||
} | ||
} | ||
|
||
LaunchedEffect(focusRequester) { | ||
focusRequester.requestFocus() | ||
delay(10) | ||
keyboard?.show() | ||
} | ||
Comment on lines
+115
to
+119
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. 오 승원님 항상 LaunchEffect를 마지막에 쓰시나요? 저는 항상 맨 앞에서 사용했어서 문의드립니당 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. LaunchEffect의 위치는 고정이 없지만, 제가 알기로는 보기 편하게 launcheffect를 최대한 끝에 적는게 좋다는 걸로 알고 있어요 |
||
} |
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.
우왕 이거 무슨 설정이에요 ?
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.
keyboard가 올라오면 화면을 사이즈를 맞춰서 button이 키보드 위에 올라오게 하는 옵션이에요