Skip to content

Commit

Permalink
#210 내 이미지 변경 bottomsheet 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Aug 21, 2023
1 parent 22bdc5c commit c8fd9bc
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,23 @@ class MyPageMoreBottomSheetFragment(private val bottomSheetType: BottomSheetType

private fun setBottomSheetType() {
when (bottomSheetType) {
BottomSheetType.DEFAULT -> {}
BottomSheetType.IMAGE -> {}
BottomSheetType.DEFAULT -> defaultBottomSheetVisible()
BottomSheetType.IMAGE ->imageBottomSheetVisible()
}
}

private fun defaultBottomSheetVisible() {
binding.changeUserImageTV.visibility = View.GONE
}

private fun imageBottomSheetVisible() = binding.apply {
changeNickNameTV.visibility = View.GONE
changePasswordTV.visibility = View.GONE
withdrawalTV.visibility = View.GONE
logoutTV.visibility = View.GONE
changeUserImageTV.visibility = View.VISIBLE
}

private fun setBinding() {
binding.apply {
viewModel = fragmentViewModel.apply {
Expand All @@ -105,7 +117,7 @@ class MyPageMoreBottomSheetFragment(private val bottomSheetType: BottomSheetType
BottomSheetFlag.CHANGE_PASSWORD -> completeBottomSheetChangePassword()
BottomSheetFlag.WITHDRAWAL -> completeBottomSheetWithdrawal()
BottomSheetFlag.LOGOUT -> completeBottomSheetLogout()
BottomSheetFlag.CHANGE_USER_IMAGE -> {}
BottomSheetFlag.CHANGE_USER_IMAGE -> completeBottomSheetChangeUserImage()
}
}
}
Expand All @@ -127,6 +139,10 @@ class MyPageMoreBottomSheetFragment(private val bottomSheetType: BottomSheetType
setFragmentResult(TAG, bundleOf(TAG to BottomSheetFlag.LOGOUT.value))
}

private fun completeBottomSheetChangeUserImage() {
setFragmentResult(TAG, bundleOf(TAG to BottomSheetFlag.CHANGE_USER_IMAGE.value))
}

private fun handleFlag(flag: BottomSheetFlag) {
when (flag) {
BottomSheetFlag.CHANGE_NICKNAME -> highlight(binding.changeNickNameTV)
Expand Down

0 comments on commit c8fd9bc

Please sign in to comment.