File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
presentation/src/main/java/com/stop/ui Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -88,19 +88,19 @@ class PlaceSearchFragment : Fragment() {
88
88
placeSearchViewModel.setNearPlacesEmpty()
89
89
placeSearchViewModel.insertRecentSearchPlace(placeUseCaseItem)
90
90
91
- findNavController().navigate (R .id.action_placeSearchFragment_to_mapFragment )
91
+ findNavController().popBackStack (R .id.mapFragment, false )
92
92
}
93
93
94
94
private fun buttonClick () {
95
95
with (binding) {
96
96
layoutRecentSearch.textViewCurrentLocation.setOnClickListener {
97
97
placeSearchViewModel.setClickCurrentLocation()
98
98
99
- findNavController().navigate (R .id.action_placeSearchFragment_to_mapFragment )
99
+ findNavController().popBackStack (R .id.mapFragment, false )
100
100
}
101
101
102
102
layoutRecentSearch.textViewSelectMap.setOnClickListener {
103
- findNavController().navigate (R .id.action_placeSearchFragment_to_mapFragment )
103
+ findNavController().popBackStack (R .id.mapFragment, false )
104
104
}
105
105
}
106
106
}
Original file line number Diff line number Diff line change @@ -83,13 +83,17 @@ class RouteFragment : Fragment() {
83
83
binding.textViewOrigin.setOnClickListener {
84
84
val navController = findNavController()
85
85
navController.setGraph(R .navigation.nav_graph)
86
- navController.navigate(R .id.action_global_placeSearchFragment)
86
+ if (navController.popBackStack(R .id.action_global_placeSearchFragment, false ).not ()) {
87
+ navController.navigate(R .id.placeSearchFragment)
88
+ }
87
89
}
88
90
89
91
binding.textViewDestination.setOnClickListener {
90
92
val navController = findNavController()
91
93
navController.setGraph(R .navigation.nav_graph)
92
- navController.navigate(R .id.action_global_placeSearchFragment)
94
+ if (navController.popBackStack(R .id.action_global_placeSearchFragment, false ).not ()) {
95
+ navController.navigate(R .id.placeSearchFragment)
96
+ }
93
97
}
94
98
95
99
binding.imageViewSwapOriginWithDestination.setOnClickListener {
You can’t perform that action at this time.
0 commit comments