-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
# Conflicts: # app/src/main/java/com/mashup/dorabangs/navigation/MainNavHost.kt # feature/home/src/main/java/com/mashup/dorabangs/feature/home/HomeScreen.kt # feature/home/src/main/java/com/mashup/dorabangs/feature/navigation/HomeNavigation.kt
...ure/home/src/main/java/com/mashup/dorabangs/feature/navigation/HomeCreateFolderNavigation.kt
Outdated
Show resolved
Hide resolved
val folderManageType = navBackStackEntry.arguments?.getString("folderManageType") ?: FolderManageType.CHANGE.name | ||
StorageFolderManageRoute( | ||
folderManageType = folderManageType, | ||
onClickBackIcon = onClickBackIcon, |
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.
여기부터 name으로 주고 있넹 type으로 못주나
여기서 name -> 뷰모델에서 타입으로 넣던뎅
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.
흠 나도 이부분 고민됐는데 navArgument 받으려면
type = NavType.StringType
요부분때매 string으로 받았거든ㅠㅠ
좀 더 방법을 생각해보겟쑴당🫡
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.
@Ahn-seokjoo @ddyeon
커스텀 타입을 전달할 수 있는 방법을 물어보는건가 ??
Compose Navigation에 safeArg가 있긴 해
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.
굿굿 저런식으로 하면 될듯~ 상점 1점 드립니다
디테일 조금 더 잡아서 수정 올려쒀요 묵주 호묵 확인부탁 |
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.
@ddyeon
고생했어 다묵이
firstItemName: Int, | ||
secondItemName: 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.
@ddyeon
리소스 어노테이션 붙이면 더 좋을듯 ~~
|
||
LaunchedEffect(key1 = Unit) { | ||
if (isVisibleBottomSheet) { | ||
viewModel.setVisibleMovingFolderBottomSheet(true) | ||
} | ||
} | ||
|
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.
@ddyeon
viewModel에 있는 데이터를 업데이트 하는 것 보다는 ViewModel의 SavedStateHandle에서 데이터를 받는게 더 좋아보여 ~
hiltViewModel이 그런거 해주는 녀석일거야
val isVisibleBottomSheet = backStackEntry.savedStateHandle.getStateFlow( | ||
"isVisibleMovingBottomSheet", | ||
initialValue = false, | ||
).collectAsState().value |
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.
@ddyeon
flow로 넘기고 collet해서 받는 방법이 필요한 이유가 뭐야 ??
그냥 Boolean 값을 가져오면 안되나?
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.
없는 것 같습니다. viewmodel에서 collect할 일이 없을 것 같아소 get으로 변경하겠숨당~
LaunchedEffect(key1 = Unit) { | ||
folderManageViewModel.setFolderManageType(folderManageType) | ||
} |
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.
@ddyeon
이부분도 savedStateHandle에서 바로 받는게 좋을듯 ??
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.
initial 부분이라 savedStateHandle로 주자는거야 ? ? 아님 저런 set get ㅎ함수를 사용하지 말자? @fbghgus123
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.
@Ahn-seokjoo
어차피 ViewModel에서 지지고 볶고 할 데이터를 굳이 Compose 단까지 가져오지 말자는 말.
ViewModel을 hiltViewModel()로 만들면 SavedStateHandle에서 백 스택 엔트리에 저장된 데이터를 가져올 수 잇음 ~~
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.
음. 저 LaunchEffect 용도가 initial data set해주는 용도같아서 나도 무러본거였엉
initialSet이면 호현말대루 savedstatehandle로 받음 편한뎅 그냥 다른곳에서ㅏ도 set해주려는거면 저 set함수 자체는 필요하지 않나 싶어서 무러봤슴
initialize가 목적이라면 나도 찬성이야~
enum class FolderManageType(@StringRes val title: Int) { | ||
CREATE(R.string.storage_create_folder_title), | ||
CHANGE(R.string.storage_edit_folder_title), | ||
} |
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.
@ddyeon
이거는 무엇을 위한 구분이야?
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.
폴더 생성과 폴더 이름 변경을 같은 페이지로 쓰고 있어서 tilte만 바꿔주는용도!!
@@ -152,7 +152,7 @@ fun StorageListItem( | |||
androidx.core.R.drawable.ic_call_answer | |||
} |
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.
@ddyeon
미리 분기 처리해놓은거 좋앗다 ??
navigateToStorageDetail: (StorageFolderItem) -> Unit = {}, | ||
navigateToFolderManage: (FolderManageType) -> Unit, |
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.
@ddyeon
디폴트가 있고 없고의 차이는 뭐야 ??
아래는 필수라는건가?
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.
프리뷰야뭐 {} 넣어주면 되는데, 사용할때 누구나 안에까지 본다는 가정을 하면 안될 것 같아서 난 반드시 필요한 건 default 안넣긴행
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 folderManageType = navBackStackEntry.arguments?.getString("folderManageType") ?: FolderManageType.CHANGE.name | ||
StorageFolderManageRoute( | ||
folderManageType = folderManageType, | ||
onClickBackIcon = onClickBackIcon, |
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.
@Ahn-seokjoo @ddyeon
커스텀 타입을 전달할 수 있는 방법을 물어보는건가 ??
Compose Navigation에 safeArg가 있긴 해
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 | ||
|
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.
여기서 결국은 Navcontroller.previousBackStackEntry
을 사용하는거여서 MainNavHost에서 지금 navcontroller받고있는데 이걸 previousBackStackEntry 넘기는 걸로 바뀌면 못찾네용,,???!!!
그래서 일단은 navcontroller 받는걸로 했는뎀 불만 있는 사람 이유 찾아죠ㅠㅠㅎ
@fbghgus123 @Ahn-seokjoo
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.
ㅋㅋㅋ 일단 난 뭔 소린지 이해 못했어.
개요
작업 내용
(묵주가 만들어둔 화면덕분에 잘 재활용 함ㅎㅎ 근데 alert는 API붙이면서 수정할게용)
시연 화면 (option)
To Reviers
Close
close #60