diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanCategoryFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanCategoryFragment.kt index f9208c0b..9a1f7685 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanCategoryFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanCategoryFragment.kt @@ -5,15 +5,16 @@ import android.view.View import androidx.fragment.app.viewModels import org.sopt.pingle.R import org.sopt.pingle.databinding.FragmentPlanCategoryBinding +import org.sopt.pingle.presentation.type.CategoryType import org.sopt.pingle.util.base.BindingFragment class PlanCategoryFragment : BindingFragment(R.layout.fragment_plan_category) { - private val planViewModel by viewModels() + private val viewModel by viewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - binding.planViewModel = planViewModel + binding.planViewModel = viewModel binding.lifecycleOwner = this initLayout() @@ -26,12 +27,16 @@ class PlanCategoryFragment : private fun addListeners() { with(binding) { includePlanCategoryTypePlay.root.setOnClickListener { + viewModel.setSelectedCategory(CategoryType.PLAY) } includePlanCategoryTypeStudy.root.setOnClickListener { + viewModel.setSelectedCategory(CategoryType.STUDY) } includePlanCategoryTypeMulti.root.setOnClickListener { + viewModel.setSelectedCategory(CategoryType.MULTI) } includePlanCategoryTypeOthers.root.setOnClickListener { + viewModel.setSelectedCategory(CategoryType.OTHERS) } } }