Skip to content

Commit

Permalink
#68 feat : home navigation 화면 전환 연결 완료
Browse files Browse the repository at this point in the history
Co-authored-by: plashdof <[email protected]>
Co-authored-by: BENDENG1 <[email protected]>
  • Loading branch information
3 people committed Nov 21, 2023
1 parent f088684 commit 3ba2585
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import androidx.databinding.BindingAdapter
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import androidx.navigation.NavController
import androidx.navigation.NavDirections
import androidx.navigation.fragment.findNavController
import com.avengers.nibobnebob.NavGraphDirections
import com.avengers.nibobnebob.R
Expand Down Expand Up @@ -56,6 +55,9 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(R.layout.fragment_home),
super.onViewCreated(view, savedInstanceState)

binding.vm = viewModel
binding.ivTest.setOnClickListener {
findNavController().toSearchRestaurant()
}
initMapView()
}

Expand Down Expand Up @@ -198,19 +200,24 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(R.layout.fragment_home),
}

private fun goReviewTest(test: Int) {
findNavController().toSearchRestaurant()
findNavController().toRestaurantDetail()
}

private fun NavController.toAddRestaurant(){
private fun NavController.toAddRestaurant() {
val action = NavGraphDirections.globalToAddMyRestaurantFragment()
navigate(action)
}

private fun NavController.toSearchRestaurant(){
private fun NavController.toSearchRestaurant() {
val action = HomeFragmentDirections.actionHomeFragmentToRestaurantSearchFragment()
navigate(action)
}

private fun NavController.toRestaurantDetail() {
val action = NavGraphDirections.globalToRestaurantDetailFragment()
navigate(action)
}


}

Expand Down

0 comments on commit 3ba2585

Please sign in to comment.