From f693a326232403122bf816cf09bff330c035dcff Mon Sep 17 00:00:00 2001 From: wateralsie Date: Tue, 16 Apr 2024 17:40:50 +0900 Subject: [PATCH] #212 Add dining container click listener --- .../koin/ui/main/fragment/DiningContainerFragment.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/koin/src/main/java/in/koreatech/koin/ui/main/fragment/DiningContainerFragment.kt b/koin/src/main/java/in/koreatech/koin/ui/main/fragment/DiningContainerFragment.kt index 8be0868e9..fbc1fe8c8 100644 --- a/koin/src/main/java/in/koreatech/koin/ui/main/fragment/DiningContainerFragment.kt +++ b/koin/src/main/java/in/koreatech/koin/ui/main/fragment/DiningContainerFragment.kt @@ -15,6 +15,7 @@ import `in`.koreatech.koin.domain.model.dining.Dining import `in`.koreatech.koin.domain.util.DiningUtil import `in`.koreatech.koin.domain.util.ext.arrange import `in`.koreatech.koin.domain.util.ext.typeFilter +import `in`.koreatech.koin.ui.main.activity.MainActivity import `in`.koreatech.koin.ui.main.viewmodel.MainActivityViewModel import `in`.koreatech.koin.util.ext.observeLiveData @@ -31,8 +32,13 @@ class DiningContainerFragment : Fragment(R.layout.fragment_dining_container) { initViewModel() } - private fun initView() { - + private fun initView() = with(binding) { + diningContainer.setOnClickListener { + if (activity is MainActivity) { + val mainActivity = activity as MainActivity + mainActivity.callDrawerItem(R.id.navi_item_dining) + } + } } private fun initViewModel() = with(viewModel) {