-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 바텀 네비게이션 도입 및 기존 캘린더 및 마이페이지 화면 fragment 로 전환 #293
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
… activityviewmodel 사용을 위한 라이브러리 추가 및 프래그먼트용 토스트 확장 함수 생성.
…으나 메뉴 프래그먼트가 보이지 않음.
* add: bottomSheetDialogFragment * refactor: ListAdapter로 변경 * change: bottomSheet clickListener * chore: 전체 리뷰에서 삭제하면 리스트 재호출 안되는거 수정 * chore: 전체 리뷰에서 삭제하면 리스트 재호출 안되는거 수정 * chore: 왼쪽 정렬, 워딩 수정 "리뷰 설정" * chore: 오탈자 수정 * chore: apply로 바로 받아서 쓰기
# Conflicts: # app/src/main/AndroidManifest.xml # app/src/main/res/values/strings.xml
kangyuri1114
left a comment
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.
아니면 리뷰 쪽 기능들을 cafeteria 안으로 패키징 해야할 것 같아요. |
|
conflict 한번 확인해주세용! @kangyuri1114 |
HI-JIN2
left a comment
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.
정말 정말 수고 많으셨습니다!! 마치 새차한 기분이에요.. 시원해요.
몇가지 코멘트 달아두었습니다! 확인해보시고 반영할만한거는 반영해주세용!
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| object ServiceModule { |
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.
아아 xxxService만 따로 뺀거군요. 뭔가 하고 한참 봤네요
| // override fun onCreateOptionsMenu(menu: Menu?): Boolean { | ||
| // menuInflater.inflate(R.menu.menu_main, menu) | ||
| // return true | ||
| // } | ||
|
|
||
| // override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
| // return when (item.itemId) { | ||
| // R.id.action_setting -> { | ||
| // val intent = Intent(this, MyPageActivity::class.java) // 인텐트를 생성해줌, | ||
| // startActivity(intent) // 화면 전환을 시켜줌 | ||
| // true | ||
| // } | ||
| // | ||
| // else -> super.onOptionsItemSelected(item) | ||
| // } | ||
| // } | ||
|
|
||
| // Permission -- |
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.
이거 안쓰는거면 지워도 될 것 같아용
|
|
||
| _uiState.update { | ||
| it.copy( | ||
| toastMessage = "로그아웃 되었습니다.", |
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.
요거 R.string으로 바꿔주셍용
| private val data = MutableLiveData<LocalDate>() | ||
|
|
||
| fun setData(dataToSend: LocalDate) { | ||
| data.value = dataToSend | ||
|
|
||
| Log.d("setdata", dataToSend.toString()) | ||
| } | ||
|
|
||
| fun getData(): LiveData<LocalDate> { | ||
| return data | ||
| } | ||
|
|
||
| } |
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.
이게 아마 오늘 날짜 받아오는것 같은데.. mainviewmodel에서 하긴 좀 애매해보이네요..
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.
허허.. 저도 이 날짜 받아오는 부분은 리팩하고싶은데.. 다음 pr로 넘겨보겠슴다...
| private val mainViewModel by activityViewModels<MainViewModel>() | ||
| private val infoViewModel: InfoViewModel by activityViewModels() | ||
| private val menuViewModel by viewModels<MenuViewModel>() |
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.
요거 형식 통일하면 좋을 것 같아용~
| menuViewModel.uiState.collect { state -> | ||
| when (state) { | ||
| is UiState.Init -> { | ||
| Log.d("Debug", "UI State: Init") |
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.
로그는 Timber로 바꿔주세용~ 의미 없는 로그면 지워주시고용
|
|
||
| if (response.isSuccessful) { | ||
| Log.d("post", "onResponse 성공" + response.body()) | ||
| Timber.tag("post").d("onResponse 성공" + response.body()) |
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.
이거 제가 작성한 코드인것 같긴한데, Timber면은 tag 지워주세욥!
| fun loginOut() { | ||
| viewModelScope.launch { | ||
| logoutUseCase() //Todo 반환값이 쓰이는게 아니면 이렇게 해도 되나? | ||
|
|
||
| _uiState.update { | ||
| it.copy( | ||
| toastMessage = "로그아웃 되었습니다.", | ||
| isLoginOuted = true | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| fun signOut() { | ||
| viewModelScope.launch { | ||
| signOutUseCase().onStart { | ||
| _uiState.update { it.copy(loading = true) } | ||
| }.onCompletion { | ||
| _uiState.update { it.copy(loading = false, error = true) } | ||
| }.catch { e -> | ||
| _uiState.update { it.copy(error = true, toastMessage = "정보를 불러올 수 없습니다.") } | ||
| Timber.e(e.toString()) | ||
| }.collectLatest { result -> | ||
| Timber.d(result.toString()) | ||
| if (result.result == true) { | ||
| logoutUseCase() | ||
| _uiState.update { | ||
| it.copy( | ||
| isSignOuted = true, | ||
| toastMessage = "탈퇴가 완료되었습니다." | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
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.
회원탈퇴는 회원탈퇴뷰모델이 따로있어 여기 회원탈퇴 함수를 사용하지 않아 지웠습니다
| fun logOut() { | ||
| viewModelScope.launch { | ||
| logoutUseCase() //Todo 반환값이 쓰이는게 아니면 이렇게 해도 되나? | ||
|
|
||
| _uiState.update { | ||
| it.copy( | ||
| toastMessage = "로그아웃 되었습니다.", | ||
| isLoggedOut = 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.
로그아웃이 왜 여기있죠?!
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.
HI-JIN2
left a comment
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.
굿굿입니다!
| // 아래 함수를 View 에서는 사용이 어려워 util 로 빼지 않음 | ||
| private fun BottomNavigationView.setOnSingleItemSelectedListener( | ||
| minInterval: Long = 2000L, | ||
| onSingleItemSelected: (item: MenuItem) -> Boolean | ||
| ) { | ||
| var lastClickTime = 0L | ||
|
|
||
| setOnItemSelectedListener { item -> | ||
| val currentClickTime = SystemClock.uptimeMillis() | ||
| if (currentClickTime - lastClickTime > minInterval) { | ||
| lastClickTime = currentClickTime | ||
| onSingleItemSelected(item) | ||
| } else { | ||
| 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.
오호 이거 baseActivity에 할 줄 알았는데, mainActivity에 하셨군요!👍
근데 이제 compose로 짜면 base activity도 의미 없을 것 같아요 그죠?



Summary
develop~feat/set-bottom-navigation브랜치까지의 작업 내용MainActivity 내부 3개의 bottomNavi 화면이 도입될 fragment를 넣는 구조로 수정
화면명 수정 및 새 화면 추가
feat/set-bottom-navigation에서 중복 메뉴 호출 및 이전 메뉴 화면 누적되어 반환하던 오류 수정을 위한 브랜치인 feat/fix-bottom-navi-error 작업내용observe()를 매번 날짜 변경 시마다 호출하며, 메뉴 항목(Section)이 중복으로totalMenuList에 누적됨collectFixedMenuData,collectMealData함수로 관심사 분리Describe your changes
default.mp4
Issue
To reviewers
feat/set-bottom-navigation 브랜치 pr에서 오류가 나고 있기 때문에 해당 pr을 바로 develop으로 머지하는 게 좋을 것 같아 이전 작업 내용도 해당 pr에 같이 정리했습니다.
근데 원래 로딩 속도가 오래걸려 uistate를 넣었는데 서버 고친 후로 너무 빨라져서 uistate에 마땅히 할 로직이 없는데 어떻게 할까요?