Skip to content

Commit

Permalink
#68 feat : home 화면간 navigate test
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 d5c3abb commit f303be1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Aos/.idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.avengers.nibobnebob.presentation.ui.global.restaurant_add

import android.os.Bundle
import android.view.View
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import com.avengers.nibobnebob.R
import com.avengers.nibobnebob.databinding.FragmentAddMyRestaurantBinding
Expand All @@ -10,7 +11,7 @@ import com.avengers.nibobnebob.presentation.ui.main.MainViewModel

class AddMyRestaurantFragment : BaseFragment<FragmentAddMyRestaurantBinding>(R.layout.fragment_add_my_restaurant) {

override val parentViewModel: MainViewModel by viewModels()
override val parentViewModel: MainViewModel by activityViewModels()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package com.avengers.nibobnebob.presentation.ui.global.restaurant_detail

import android.os.Bundle
import android.view.View
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import com.avengers.nibobnebob.R
import com.avengers.nibobnebob.databinding.FragmentRestaurantDetailBinding
import com.avengers.nibobnebob.presentation.base.BaseFragment
import com.avengers.nibobnebob.presentation.ui.main.MainViewModel

class RestaurantDetailFragment : BaseFragment<FragmentRestaurantDetailBinding>(R.layout.fragment_restaurant_detail) {
override val parentViewModel: MainViewModel by viewModels()
override val parentViewModel: MainViewModel by activityViewModels()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ 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
import com.avengers.nibobnebob.databinding.FragmentHomeBinding
import com.avengers.nibobnebob.presentation.base.BaseFragment
Expand Down Expand Up @@ -191,16 +194,27 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(R.layout.fragment_home),
}

private fun addRestaurantTest(test: Int) {

findNavController().toAddRestaurant()
}

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

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

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


}


@BindingAdapter("trackingBtnDrawable")
fun bindTrackingBtnDrawable(btn: ImageButton, state: TrackingState) {
when (state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal fun restaurantSheet(

binding.btnAddMyRestaurant.setOnClickListener {
onClickAddMyRestaurant(restaurantId)
dialog.dismiss()
}

binding.btnAddWishRestaurant.setOnClickListener {
Expand All @@ -41,6 +42,7 @@ internal fun restaurantSheet(

binding.btnGoReview.setOnClickListener {
onClickGoReview(restaurantId)
dialog.dismiss()
}

return dialog
Expand Down
1 change: 0 additions & 1 deletion Aos/app/src/main/res/layout/fragment_restaurant_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
android:id="@+id/ib_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="transparent"
android:layout_marginStart="20dp"
android:src="@drawable/ic_back"
app:layout_constraintBottom_toBottomOf="@id/searchBar"
Expand Down

0 comments on commit f303be1

Please sign in to comment.