Skip to content

Commit

Permalink
#210 내 이미지 변경 바텀시트 타입 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Aug 21, 2023
1 parent 8d49372 commit ce8f1b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,21 @@ class MyPageFragment :
is MyPageViewModel.MyPageEvent.Login -> navigateWithUri("medilens://main/intro_nav/login")
is MyPageViewModel.MyPageEvent.SignUp -> navigateWithUri("medilens://main/intro_nav/signUp")
is MyPageViewModel.MyPageEvent.NavigateToMyCommentList -> navigateWithUri("medilens://main/comments_nav/myCommentsListFragment")
is MyPageViewModel.MyPageEvent.NavigateToMyPageMore -> showMyPageBottomSheet()
is MyPageViewModel.MyPageEvent.NavigateToMyPageMore -> showMyPageBottomSheet(MyPageMoreBottomSheetFragment.BottomSheetType.DEFAULT)
is MyPageViewModel.MyPageEvent.ClickMyImage -> showMyPageBottomSheet(MyPageMoreBottomSheetFragment.BottomSheetType.IMAGE)
}

private fun showMyPageBottomSheet() {
private fun showMyPageBottomSheet(bottomSheetType: MyPageMoreBottomSheetFragment.BottomSheetType) {
if (myPageMoreBottomSheet == null) {
showMyPageMoreBottomSheet()
}
}
myPageMoreBottomSheet = MyPageMoreBottomSheetFragment(bottomSheetType) {
myPageMoreBottomSheet = null
}

private fun showMyPageMoreBottomSheet() {
myPageMoreBottomSheet = MyPageMoreBottomSheetFragment {
myPageMoreBottomSheet = null
myPageMoreBottomSheet!!.show(
parentFragmentManager,
MyPageMoreBottomSheetFragment.TAG,
)
}

myPageMoreBottomSheet!!.show(
parentFragmentManager,
MyPageMoreBottomSheetFragment.TAG,
)
}

private fun guestModeScreen() = binding.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import dagger.hilt.android.AndroidEntryPoint
import com.android.mediproject.core.common.viewmodel.repeatOnStarted

@AndroidEntryPoint
class MyPageMoreBottomSheetFragment(private val backCallback: () -> Unit) :
class MyPageMoreBottomSheetFragment(private val bottomSheetType: BottomSheetType, private val backCallback: () -> Unit) :
BottomSheetDialogFragment() {

companion object {
Expand All @@ -34,6 +34,10 @@ class MyPageMoreBottomSheetFragment(private val backCallback: () -> Unit) :
LOGOUT(304)
}

enum class BottomSheetType {
DEFAULT, IMAGE
}

private var _binding: FragmentMyPageMoreBottomSheetBinding? = null
val binding get() = _binding!!
private val fragmentViewModel: MyPageMoreBottomSheetViewModel by viewModels()
Expand Down

0 comments on commit ce8f1b0

Please sign in to comment.