Skip to content

Commit

Permalink
[mod] #61 viewModel에 categoryType 저장 확인
Browse files Browse the repository at this point in the history
  • Loading branch information
HAJIEUN02 committed Jan 8, 2024
1 parent 9c72461 commit 859ca1d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<FragmentPlanCategoryBinding>(R.layout.fragment_plan_category) {
private val planViewModel by viewModels<PlanViewModel>()
private val viewModel by viewModels<PlanViewModel>()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.planViewModel = planViewModel
binding.planViewModel = viewModel
binding.lifecycleOwner = this

initLayout()
Expand All @@ -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)
}
}
}
Expand Down

0 comments on commit 859ca1d

Please sign in to comment.