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

홈과 보관함 폴더 생성/이름 변경 UI 및 navigation 추가 #67

Merged
merged 23 commits into from
Jul 11, 2024

Conversation

ddyeon
Copy link
Member

@ddyeon ddyeon commented Jul 7, 2024

개요

이슈 링크 혹은 PR 내용 요약

  • 홈과 보관함에서 사용되는 "새폴더 추가"와 "폴더 이름 변경" UI 만들었습니다.

작업 내용

실제 작업 내용

  • 홈과 보관함 페이지가 비슷하지만 각각 화면에서 사용하여 따로 만들어주었습니당~~
    (묵주가 만들어둔 화면덕분에 잘 재활용 함ㅎㅎ 근데 alert는 API붙이면서 수정할게용)
  • 홈화면 -> 바텀시트 -> 새 폴더 추가 누르면 나오고
  • 보관함 -> 맨위 topbar나 각 아이템 맨오른쪾 아이콘 누르면 이동합니당

시연 화면 (option)

실행 스크린샷 혹은 영상 첨부

새폴더추가 폴더이름변경
스크린샷 2024-07-07 오후 6 16 47 스크린샷 2024-07-07 오후 6 19 33

To Reviers

리뷰어들에게 전할 말

  • 현재 다이얼로그 뜰때 딤처리 안되는데 제가 수정해보겠습니당~
  • 폴더생성 API는 오늘 밤 계속 될 예정..coming,,soon,,

Close

close #60

@ddyeon ddyeon self-assigned this Jul 7, 2024
@ddyeon ddyeon added the feature develop feature label Jul 7, 2024
Comment on lines +30 to +33
val folderManageType = navBackStackEntry.arguments?.getString("folderManageType") ?: FolderManageType.CHANGE.name
StorageFolderManageRoute(
folderManageType = folderManageType,
onClickBackIcon = onClickBackIcon,
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기부터 name으로 주고 있넹 type으로 못주나
여기서 name -> 뷰모델에서 타입으로 넣던뎅

Copy link
Member Author

Choose a reason for hiding this comment

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

흠 나도 이부분 고민됐는데 navArgument 받으려면
type = NavType.StringType 요부분때매 string으로 받았거든ㅠㅠ
좀 더 방법을 생각해보겟쑴당🫡

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Ahn-seokjoo @ddyeon
커스텀 타입을 전달할 수 있는 방법을 물어보는건가 ??
Compose Navigation에 safeArg가 있긴 해

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

Choose a reason for hiding this comment

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

굿굿 저런식으로 하면 될듯~ 상점 1점 드립니다

@ddyeon
Copy link
Member Author

ddyeon commented Jul 8, 2024

디테일 조금 더 잡아서 수정 올려쒀요 묵주 호묵 확인부탁

Copy link
Collaborator

@fbghgus123 fbghgus123 left a comment

Choose a reason for hiding this comment

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

@ddyeon
고생했어 다묵이

Comment on lines +24 to +25
firstItemName: Int,
secondItemName: Int,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ddyeon
리소스 어노테이션 붙이면 더 좋을듯 ~~

Comment on lines 67 to 73

LaunchedEffect(key1 = Unit) {
if (isVisibleBottomSheet) {
viewModel.setVisibleMovingFolderBottomSheet(true)
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ddyeon
viewModel에 있는 데이터를 업데이트 하는 것 보다는 ViewModel의 SavedStateHandle에서 데이터를 받는게 더 좋아보여 ~
hiltViewModel이 그런거 해주는 녀석일거야

Comment on lines 32 to 35
val isVisibleBottomSheet = backStackEntry.savedStateHandle.getStateFlow(
"isVisibleMovingBottomSheet",
initialValue = false,
).collectAsState().value
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ddyeon
flow로 넘기고 collet해서 받는 방법이 필요한 이유가 뭐야 ??
그냥 Boolean 값을 가져오면 안되나?

Copy link
Member Author

Choose a reason for hiding this comment

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

없는 것 같습니다. viewmodel에서 collect할 일이 없을 것 같아소 get으로 변경하겠숨당~

Comment on lines +33 to +35
LaunchedEffect(key1 = Unit) {
folderManageViewModel.setFolderManageType(folderManageType)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ddyeon
이부분도 savedStateHandle에서 바로 받는게 좋을듯 ??

Copy link
Collaborator

Choose a reason for hiding this comment

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

initial 부분이라 savedStateHandle로 주자는거야 ? ? 아님 저런 set get ㅎ함수를 사용하지 말자? @fbghgus123

Copy link
Collaborator

@fbghgus123 fbghgus123 Jul 9, 2024

Choose a reason for hiding this comment

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

@Ahn-seokjoo
어차피 ViewModel에서 지지고 볶고 할 데이터를 굳이 Compose 단까지 가져오지 말자는 말.
ViewModel을 hiltViewModel()로 만들면 SavedStateHandle에서 백 스택 엔트리에 저장된 데이터를 가져올 수 잇음 ~~

Copy link
Collaborator

Choose a reason for hiding this comment

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

음. 저 LaunchEffect 용도가 initial data set해주는 용도같아서 나도 무러본거였엉
initialSet이면 호현말대루 savedstatehandle로 받음 편한뎅 그냥 다른곳에서ㅏ도 set해주려는거면 저 set함수 자체는 필요하지 않나 싶어서 무러봤슴

initialize가 목적이라면 나도 찬성이야~

Comment on lines +6 to +9
enum class FolderManageType(@StringRes val title: Int) {
CREATE(R.string.storage_create_folder_title),
CHANGE(R.string.storage_edit_folder_title),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ddyeon
이거는 무엇을 위한 구분이야?

Copy link
Member Author

Choose a reason for hiding this comment

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

폴더 생성과 폴더 이름 변경을 같은 페이지로 쓰고 있어서 tilte만 바꿔주는용도!!

@@ -152,7 +152,7 @@ fun StorageListItem(
androidx.core.R.drawable.ic_call_answer
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ddyeon
미리 분기 처리해놓은거 좋앗다 ??

Comment on lines 15 to 16
navigateToStorageDetail: (StorageFolderItem) -> Unit = {},
navigateToFolderManage: (FolderManageType) -> Unit,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ddyeon
디폴트가 있고 없고의 차이는 뭐야 ??
아래는 필수라는건가?

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

Choose a reason for hiding this comment

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

프리뷰야뭐 {} 넣어주면 되는데, 사용할때 누구나 안에까지 본다는 가정을 하면 안될 것 같아서 난 반드시 필요한 건 default 안넣긴행

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 +30 to +33
val folderManageType = navBackStackEntry.arguments?.getString("folderManageType") ?: FolderManageType.CHANGE.name
StorageFolderManageRoute(
folderManageType = folderManageType,
onClickBackIcon = onClickBackIcon,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Ahn-seokjoo @ddyeon
커스텀 타입을 전달할 수 있는 방법을 물어보는건가 ??
Compose Navigation에 safeArg가 있긴 해

Comment on lines 15 to 25
fun NavGraphBuilder.homeCreateFolderNavigation(
navController: NavController,
onClickBackIcon: () -> Unit,
) {
composable(
route = NavigationRoute.HomeScreen.HomeCreateFolder.route,
) {
navController.currentBackStackEntry?.let { backStackEntry ->
val homeViewModel: HomeViewModel = hiltViewModel(backStackEntry)
homeViewModel.savedStateHandle["isVisibleMovingBottomSheet"] = true

Copy link
Member Author

Choose a reason for hiding this comment

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

여기서 결국은 Navcontroller.previousBackStackEntry을 사용하는거여서 MainNavHost에서 지금 navcontroller받고있는데 이걸 previousBackStackEntry 넘기는 걸로 바뀌면 못찾네용,,???!!!

그래서 일단은 navcontroller 받는걸로 했는뎀 불만 있는 사람 이유 찾아죠ㅠㅠㅎ
@fbghgus123 @Ahn-seokjoo

Copy link
Collaborator

Choose a reason for hiding this comment

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

ㅋㅋㅋ 일단 난 뭔 소린지 이해 못했어.

@ddyeon ddyeon merged commit fa64dd3 into develop Jul 11, 2024
2 checks passed
@ddyeon ddyeon deleted the feature/create-folder-ui branch July 14, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature develop feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

보관함에서 폴더 생성 네비게이션 연결 및 화면 구현
3 participants