Skip to content

[Scrum-124] 카테고리 생성/수정 화면 구현 #180

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

Merged
merged 14 commits into from
Mar 1, 2025
Merged

Conversation

HyomK
Copy link
Member

@HyomK HyomK commented Feb 27, 2025

작업 내용

  • MnBottomSheet 내부 패딩 제거
  • MnBottomSheet headerContent 추가
  • 카테고리 생성/추가 화면구현
  • 카테고리 아이콘 바텀 시트 구현
  • pomodoroSettingBottom 라우팅 적용

체크리스트

  • 빌드 확인
  • MnBottomSheet 변경내용 확인
  • 카테고리 생성/추가 정책대로 구현되었는지 확인

동작 화면

2025-02-28.12.30.00.mov

살려주세요

)
},
goToCategoryCreate = {
navHostController.navigate(CategorySetting(categoryNo = null))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

카테고리 생성의 경우 categoryNo 가 없기 때문에 해당 값으로 수정/생성 화면 분기 처리

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오키 이 부분은 서버랑 협의가 나면 조금 더 수정이 될 수도 있겠다!


import com.mohanyang.presentation.R

enum class CategoryIcon(val id: String, val resourceId: Int) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서버와 이후 id 값 정책 통일 필요

) {
val borderColor = if (isSelected) MnTheme.backgroundColorScheme.accent1 else Color.Transparent

Box(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4열 정사각형을 유지하면서 56.dp 를 지키는 방법 시도하다가 결국 Box 두개를 써버렸는데 더 좋은 방법이 있을까요

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 리뷰를 놓쳤었네 지금 확인 중이야!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것저것 도전을 해보았는데 잘 안되네 이건 Box 2개가 그냥 나을거 같아,,,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋㅋ 오케이..

Copy link
Collaborator

@lee-ji-hoon lee-ji-hoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아이콘 추가 노가다 고생 많았어!~~!!!

전체적인 기능에는 문제 없고 그냥 몇 개 챙겨볼만한 것들만 리뷰를 달아뒀으니 반영하고 바로 들어가도 될거 같으니 approve 하겠읍니다

)
},
goToCategoryCreate = {
navHostController.navigate(CategorySetting(categoryNo = null))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오키 이 부분은 서버랑 협의가 나면 조금 더 수정이 될 수도 있겠다!

Comment on lines +109 to +110
val routeData = backStackEntry.toRoute<CategorySetting>()
CategorySettingRoute(categoryNo = routeData.categoryNo) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이제 그냥 routeData를 그냥 viewModel의 savedStateHandle 에 넣는 형태로 통일을 할까 하는데 효민쓰 생각은 어때?

뭔가 categoryNo 라는 값을 viewModel에 state에 넣고서 viewModel 에서도 쓸 일이 생길 때 바로 쓸 수 있지 않을까?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 좋아요 통일합시다 !

@Preview
@Composable
private fun PreviewCategoryBottomSheet() {
CategoryIconBottomSheet(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 MnTheme 해줘야 할거 같은데!

categorySettingViewModel: CategorySettingViewModel = hiltViewModel(),
onBackClick: () -> Unit,
) {
var showDialog by remember { mutableStateOf(false) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rememberSaveable 이면 더 좋을거 같네!

}

@Composable
fun CategorySettingScreen(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 Screen은 private이여도 될거 같으~! 외부에 노출 되는건 CategorySettingRoute 로 합시다!

val focusManager = LocalFocusManager.current
val keyboardController = LocalSoftwareKeyboardController.current

var name by remember { mutableStateOf(categoryName) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 saveable로 갑시다~!

}
Box(
modifier = Modifier
.absoluteOffset(x = 52.dp, y = 44.dp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

많은 사연이 있어 보이네

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... 봐주십쇼..

contentPadding = PaddingValues(MnSpacing.xLarge),
) {
items(icons.size) { index ->
val icon = icons[index]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 icon 말고 iconId 라고 명확하게 표기해주면 더 좋을거 겉아~!

updateState {
copy(
categoryNo = event.categoryNo,
categoryName = event.categoryName ?: "",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

categoryName 은 nullable 하지 않아서 ?: "" 빼도 될 것 같네

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정하면서 체크를 깜빡했네 감사함다

}
}

fun validateCategoryName(name: String): ValidationResult {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘만 Event 안하고 ViewModel에서 그냥 public fun으로 한 이유가 있을까?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이름 변경할 때 event로 처리하면 updatestate 로 내부 ui state 를 변경해야 할 것 같은데 실제로는 validation 역할만 하고 있어서 직접 함수 호출하도록 했는데 event 가 맞을까 이부분은 나도 고민한 부분

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 아니면 validate만 하는 것이라면 그냥 object로 하나 빼서 ui에서 호출해도 괜찮을듯~!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빼서 만들까하다가 조건처리가 하나라 투머친가 하고 넣었는데 또 정책이 생길 수도 있으니까 빼는걸로 합시다 ㄱㄱ

val categoryNo: Int? = null,
val categoryName: String = "",
val selectedCategoryIcon: Int = CategoryIcon.DEFAULT.resourceId,
val categoryIcons: List<Int> = CategoryIcon.entries.map { it.resourceId }.toImmutableList(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toImmutableList 로 했지만 일반 List로 타입을 지정해둬서 ImmutableList가 안 되어어서 수정 필요해보여!

@HyomK HyomK merged commit 90e2669 into develop Mar 1, 2025
1 check passed
@HyomK HyomK deleted the SCRUM-124 branch March 1, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants