From 1757a5d7a7c93dc3e61adaefccfe0329a086226b Mon Sep 17 00:00:00 2001 From: crownjoe Date: Mon, 8 Jan 2024 19:27:10 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT/#26]=20=EC=97=AC=ED=96=89=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EB=B7=B0=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BottomSheetDateContentFragment.kt | 20 +++++++------------ .../createtrip/CreateTripActivity.kt | 3 --- .../going/presentation/auth/LoginActivity.kt | 0 .../going/presentation/auth/LoginViewModel.kt | 0 4 files changed, 7 insertions(+), 16 deletions(-) rename presentation/src/{main => test}/java/com/going/presentation/auth/LoginActivity.kt (100%) rename presentation/src/{main => test}/java/com/going/presentation/auth/LoginViewModel.kt (100%) diff --git a/presentation/src/main/java/com/going/presentation/createtrip/BottomSheetDateContentFragment.kt b/presentation/src/main/java/com/going/presentation/createtrip/BottomSheetDateContentFragment.kt index bf3d2b48..d6b6ba96 100644 --- a/presentation/src/main/java/com/going/presentation/createtrip/BottomSheetDateContentFragment.kt +++ b/presentation/src/main/java/com/going/presentation/createtrip/BottomSheetDateContentFragment.kt @@ -7,18 +7,17 @@ import com.going.presentation.R import com.going.presentation.databinding.FragmentBottomSheetDateContentBinding import com.going.ui.base.BaseBottomSheet import com.going.ui.extension.setOnSingleClickListener + class DateBottomSheet(val viewModel: CreateTripViewModel, val isStart: Boolean) : BaseBottomSheet(R.layout.fragment_bottom_sheet_date_content) { override fun onStart() { super.onStart() dialog?.window?.setBackgroundDrawableResource(R.color.transparent) - } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - initFinishBtnClickListener() } @@ -36,23 +35,18 @@ class DateBottomSheet(val viewModel: CreateTripViewModel, val isStart: Boolean) viewModel.StartMonth.value = binding.dpCreateTripDate.month + 1 viewModel.StartDay.value = binding.dpCreateTripDate.dayOfMonth viewModel.checkStartDateAvailable() - } else { - if (viewModel.StartYear.value?.let { binding.dpCreateTripDate.year > it } ?: true) { - viewModel.EndYear.value = binding.dpCreateTripDate.year - viewModel.EndMonth.value = binding.dpCreateTripDate.month + 1 - viewModel.EndDay.value = binding.dpCreateTripDate.dayOfMonth - viewModel.checkEndDateAvailable() - } else { - } + } else if (viewModel.StartYear.value?.let { binding.dpCreateTripDate.year > it } ?: true) { + viewModel.EndYear.value = binding.dpCreateTripDate.year + viewModel.EndMonth.value = binding.dpCreateTripDate.month + 1 + viewModel.EndDay.value = binding.dpCreateTripDate.dayOfMonth + viewModel.checkEndDateAvailable() } } - - private fun initFinishBtnClickListener(){ + private fun initFinishBtnClickListener() { binding.btnCreateTripFinish.setOnSingleClickListener { sendDateInfo() dismiss() } } - } diff --git a/presentation/src/main/java/com/going/presentation/createtrip/CreateTripActivity.kt b/presentation/src/main/java/com/going/presentation/createtrip/CreateTripActivity.kt index 8dffd193..41855444 100644 --- a/presentation/src/main/java/com/going/presentation/createtrip/CreateTripActivity.kt +++ b/presentation/src/main/java/com/going/presentation/createtrip/CreateTripActivity.kt @@ -90,7 +90,6 @@ class CreateTripActivity : viewModel.isNameAvailable.value == NameState.Blank && counter == binding.tvNameCounter -> R.color.red_500 to R.drawable.shape_rect_4_red500_line else -> R.color.gray_700 to R.drawable.shape_rect_4_gray700_line } - setCounterColor(counter, color) setBackground(background) } @@ -132,7 +131,6 @@ class CreateTripActivity : binding.tvCreateTripStartDate.setOnSingleClickListener { val bottomSheetDialog = DateBottomSheet(viewModel, true) bottomSheetDialog.show(supportFragmentManager, bottomSheetDialog.tag) - } } @@ -140,7 +138,6 @@ class CreateTripActivity : binding.tvCreateTripEndDate.setOnSingleClickListener { val bottomSheetDialog = DateBottomSheet(viewModel, false) bottomSheetDialog.show(supportFragmentManager, bottomSheetDialog.tag) - } } diff --git a/presentation/src/main/java/com/going/presentation/auth/LoginActivity.kt b/presentation/src/test/java/com/going/presentation/auth/LoginActivity.kt similarity index 100% rename from presentation/src/main/java/com/going/presentation/auth/LoginActivity.kt rename to presentation/src/test/java/com/going/presentation/auth/LoginActivity.kt diff --git a/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt b/presentation/src/test/java/com/going/presentation/auth/LoginViewModel.kt similarity index 100% rename from presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt rename to presentation/src/test/java/com/going/presentation/auth/LoginViewModel.kt