Skip to content

Commit a15a115

Browse files
committed
Merge remote-tracking branch 'origin/develop' into 71-feature-mission-background
# Conflicts: # presentation/src/main/java/com/stop/ui/alarmsetting/AlarmSettingViewModel.kt # presentation/src/main/java/com/stop/ui/mission/MissionFragment.kt
2 parents 26d838c + 850b774 commit a15a115

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

presentation/src/main/java/com/stop/ui/map/MapFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class MapFragment : Fragment(), MapHandler {
253253

254254
fun setMissionStart() {
255255
Log.d("MissionWorker","mission 버튼 클릭")
256-
binding.root.findNavController().navigate(R.id.action_mapFragment_to_missionFragment)
256+
findNavController().navigate(R.id.action_mapFragment_to_missionFragment)
257257
}
258258

259259
companion object {

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

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -179,44 +179,49 @@ class MissionFragment : Fragment(), MissionHandler {
179179
first += 1
180180
}
181181
1 -> {
182+
initMarker(userLocation)
182183
beforeLocation = userLocation
183-
tMap.addMarker(
184-
Marker.PERSON_MARKER,
185-
Marker.PERSON_MARKER_IMG,
186-
TMapPoint(userLocation.latitude, userLocation.longitude),
187-
true
188-
)
189-
personCurrentLocation = userLocation
190-
tMap.latitudes.add(userLocation.latitude)
191-
tMap.longitudes.add(userLocation.longitude)
192-
tMap.setRouteDetailFocus()
193184
first += 1
194-
arriveDestination(userLocation.latitude, userLocation.longitude)
195185
}
196186
else -> {
197-
Log.d("MissionWorker", "그리는 중 $userLocation $beforeLocation")
198-
val nowLocation = TMapPoint(userLocation.latitude, userLocation.longitude)
199-
tMap.drawMoveLine(
200-
nowLocation,
201-
TMapPoint(beforeLocation.latitude, beforeLocation.longitude),
202-
Marker.PERSON_LINE + PERSON_LINE_NUM.toString(),
203-
Marker.PERSON_LINE_COLOR
204-
)
205-
tMap.addMarker(Marker.PERSON_MARKER, Marker.PERSON_MARKER_IMG, nowLocation)
206-
personCurrentLocation = userLocation
187+
drawNowLocationLine(TMapPoint(userLocation.latitude, userLocation.longitude), TMapPoint(beforeLocation.latitude, beforeLocation.longitude))
188+
missionViewModel.personCurrentLocation = userLocation
207189
if (tMap.isTracking) {
208190
tMap.tMapView.setCenterPoint(userLocation.latitude, userLocation.longitude)
209191
}
210192
beforeLocation = userLocation
211-
PERSON_LINE_NUM += 1
212-
arriveDestination(userLocation.latitude, userLocation.longitude)
213193
}
214194
}
215-
216195
}
217196
}
218197
}
219198

199+
private fun initMarker(nowLocation: Location) {
200+
with(tMap) {
201+
addMarker(
202+
Marker.PERSON_MARKER,
203+
Marker.PERSON_MARKER_IMG,
204+
TMapPoint(nowLocation.latitude, nowLocation.longitude)
205+
)
206+
missionViewModel.personCurrentLocation = nowLocation
207+
latitudes.add(nowLocation.latitude)
208+
longitudes.add(nowLocation.longitude)
209+
setRouteDetailFocus()
210+
}
211+
}
212+
213+
private fun drawNowLocationLine(nowLocation: TMapPoint, beforeLocation: TMapPoint) {
214+
tMap.drawMoveLine(
215+
nowLocation,
216+
beforeLocation,
217+
Marker.PERSON_LINE + PERSON_LINE_NUM.toString(),
218+
Marker.PERSON_LINE_COLOR
219+
)
220+
PERSON_LINE_NUM += 1
221+
222+
tMap.addMarker(Marker.PERSON_MARKER, Marker.PERSON_MARKER_IMG, nowLocation)
223+
}
224+
220225
private fun getAlarmInfo() {
221226
alarmSettingViewModel.getAlarm()
222227
val linePoints = arrayListOf<TMapPoint>()

0 commit comments

Comments
 (0)