Skip to content

Commit d508d37

Browse files
committed
fix : flow를 collectIndexed로 바꾸면서 생긴 에러 해결
1 parent c4ec36f commit d508d37

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

presentation/src/main/java/com/stop/ui/mission/MissionFragment.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class MissionFragment : Fragment(), MissionHandler {
5656
initTMap()
5757
setMissionOver()
5858
setMissionFail()
59+
60+
Log.d("MissionWorker","onViewCreated")
5961
}
6062

6163
override fun onDestroyView() {
@@ -110,7 +112,7 @@ class MissionFragment : Fragment(), MissionHandler {
110112
fun clickMissionOver() {
111113
Snackbar.make(requireActivity().findViewById(R.id.constraint_layout_container), "미션을 취소합니다", Snackbar.LENGTH_SHORT).show()
112114
missionViewModel.isMissionOver.value = true
113-
findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
115+
//findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
114116
}
115117

116118
override fun alertTMapReady() {
@@ -142,7 +144,7 @@ class MissionFragment : Fragment(), MissionHandler {
142144
if (index == 1) {
143145
initMarker(userLocation)
144146
beforeLocation = userLocation
145-
} else {
147+
} else if (index > 1) {
146148
drawNowLocationLine(TMapPoint(userLocation.latitude, userLocation.longitude), TMapPoint(beforeLocation.latitude, beforeLocation.longitude))
147149
personCurrentLocation = userLocation
148150
if (tMap.isTracking) {
@@ -185,6 +187,7 @@ class MissionFragment : Fragment(), MissionHandler {
185187
private fun getAlarmInfo() {
186188
alarmSettingViewModel.getAlarm()
187189
val linePoints = arrayListOf<TMapPoint>()
190+
Log.d("MissionWorker","alarm으로 부터의 데이터 ${alarmSettingViewModel.alarmItem.value?.routes?.first()}")
188191
val walkInfo = alarmSettingViewModel.alarmItem.value?.routes?.first() as WalkRoute
189192
tMap.drawWalkRoute(walkInfo, linePoints)
190193
tMap.drawWalkLines(linePoints, Marker.WALK_LINE, Marker.WALK_LINE_COLOR)
@@ -229,7 +232,7 @@ class MissionFragment : Fragment(), MissionHandler {
229232
}
230233

231234
override fun onAnimationEnd(animation: Animator) {
232-
findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
235+
//findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
233236
}
234237

235238
override fun onAnimationCancel(animation: Animator) {
@@ -259,7 +262,7 @@ class MissionFragment : Fragment(), MissionHandler {
259262
}
260263

261264
override fun onAnimationEnd(animation: Animator) {
262-
findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
265+
//findNavController().navigate(R.id.action_missionFragment_to_mapFragment)
263266
}
264267

265268
override fun onAnimationCancel(animation: Animator) {

0 commit comments

Comments
 (0)