-
Notifications
You must be signed in to change notification settings - Fork 0
[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
Conversation
...src/main/java/com/pomonyang/mohanyang/presentation/designsystem/bottomsheet/MnBottomSheet.kt
Show resolved
Hide resolved
...src/main/java/com/pomonyang/mohanyang/presentation/designsystem/bottomsheet/MnBottomSheet.kt
Show resolved
Hide resolved
) | ||
}, | ||
goToCategoryCreate = { | ||
navHostController.navigate(CategorySetting(categoryNo = null)) |
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.
카테고리 생성의 경우 categoryNo 가 없기 때문에 해당 값으로 수정/생성 화면 분기 처리
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.
오키 이 부분은 서버랑 협의가 나면 조금 더 수정이 될 수도 있겠다!
|
||
import com.mohanyang.presentation.R | ||
|
||
enum class CategoryIcon(val id: String, val resourceId: Int) { |
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.
서버와 이후 id 값 정책 통일 필요
) { | ||
val borderColor = if (isSelected) MnTheme.backgroundColorScheme.accent1 else Color.Transparent | ||
|
||
Box( |
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.
4열 정사각형을 유지하면서 56.dp 를 지키는 방법 시도하다가 결국 Box 두개를 써버렸는데 더 좋은 방법이 있을까요
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.
이것저것 도전을 해보았는데 잘 안되네 이건 Box 2개가 그냥 나을거 같아,,,
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.
ㅋㅋㅋ 오케이..
...n/java/com/pomonyang/mohanyang/presentation/screen/home/category/CategorySettingViewModel.kt
Show resolved
Hide resolved
...n/java/com/pomonyang/mohanyang/presentation/screen/home/category/CategorySettingViewModel.kt
Outdated
Show resolved
Hide resolved
...ava/com/pomonyang/mohanyang/presentation/screen/home/category/PomodoroCategoryBottomSheet.kt
Show resolved
Hide resolved
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.
아이콘 추가 노가다 고생 많았어!~~!!!
전체적인 기능에는 문제 없고 그냥 몇 개 챙겨볼만한 것들만 리뷰를 달아뒀으니 반영하고 바로 들어가도 될거 같으니 approve 하겠읍니다
) | ||
}, | ||
goToCategoryCreate = { | ||
navHostController.navigate(CategorySetting(categoryNo = null)) |
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.
오키 이 부분은 서버랑 협의가 나면 조금 더 수정이 될 수도 있겠다!
val routeData = backStackEntry.toRoute<CategorySetting>() | ||
CategorySettingRoute(categoryNo = routeData.categoryNo) { |
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.
이제 그냥 routeData를 그냥 viewModel의 savedStateHandle
에 넣는 형태로 통일을 할까 하는데 효민쓰 생각은 어때?
뭔가 categoryNo
라는 값을 viewModel에 state에 넣고서 viewModel 에서도 쓸 일이 생길 때 바로 쓸 수 있지 않을까?
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.
음 좋아요 통일합시다 !
@Preview | ||
@Composable | ||
private fun PreviewCategoryBottomSheet() { | ||
CategoryIconBottomSheet( |
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.
여기도 MnTheme
해줘야 할거 같은데!
categorySettingViewModel: CategorySettingViewModel = hiltViewModel(), | ||
onBackClick: () -> Unit, | ||
) { | ||
var showDialog by remember { mutableStateOf(false) } |
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.
rememberSaveable
이면 더 좋을거 같네!
} | ||
|
||
@Composable | ||
fun CategorySettingScreen( |
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.
이 Screen은 private이여도 될거 같으~! 외부에 노출 되는건 CategorySettingRoute
로 합시다!
val focusManager = LocalFocusManager.current | ||
val keyboardController = LocalSoftwareKeyboardController.current | ||
|
||
var name by remember { mutableStateOf(categoryName) } |
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.
여기도 saveable로 갑시다~!
} | ||
Box( | ||
modifier = Modifier | ||
.absoluteOffset(x = 52.dp, y = 44.dp) |
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.
... 봐주십쇼..
contentPadding = PaddingValues(MnSpacing.xLarge), | ||
) { | ||
items(icons.size) { index -> | ||
val icon = icons[index] |
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.
여기 icon 말고 iconId 라고 명확하게 표기해주면 더 좋을거 겉아~!
updateState { | ||
copy( | ||
categoryNo = event.categoryNo, | ||
categoryName = event.categoryName ?: "", |
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.
categoryName 은 nullable 하지 않아서 ?: ""
빼도 될 것 같네
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.
수정하면서 체크를 깜빡했네 감사함다
} | ||
} | ||
|
||
fun validateCategoryName(name: String): ValidationResult { |
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.
얘만 Event 안하고 ViewModel에서 그냥 public fun으로 한 이유가 있을까?
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.
이름 변경할 때 event로 처리하면 updatestate 로 내부 ui state 를 변경해야 할 것 같은데 실제로는 validation 역할만 하고 있어서 직접 함수 호출하도록 했는데 event 가 맞을까 이부분은 나도 고민한 부분
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.
음 아니면 validate만 하는 것이라면 그냥 object로 하나 빼서 ui에서 호출해도 괜찮을듯~!
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.
빼서 만들까하다가 조건처리가 하나라 투머친가 하고 넣었는데 또 정책이 생길 수도 있으니까 빼는걸로 합시다 ㄱㄱ
val categoryNo: Int? = null, | ||
val categoryName: String = "", | ||
val selectedCategoryIcon: Int = CategoryIcon.DEFAULT.resourceId, | ||
val categoryIcons: List<Int> = CategoryIcon.entries.map { it.resourceId }.toImmutableList(), |
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.
toImmutableList 로 했지만 일반 List로 타입을 지정해둬서 ImmutableList가 안 되어어서 수정 필요해보여!
작업 내용
체크리스트
동작 화면
2025-02-28.12.30.00.mov
살려주세요