Skip to content

Commit 5961598

Browse files
committed
style : 대중교통 로직 지우기
1 parent 61edb82 commit 5961598

File tree

4 files changed

+3
-336
lines changed

4 files changed

+3
-336
lines changed

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

Lines changed: 2 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,8 @@ class MissionFragment : Fragment(), MissionHandler {
3434

3535
private lateinit var tMap: MissionTMap
3636

37-
private var beforeLocation = INIT_LOCATION
38-
3937
private var points = arrayListOf<TMapPoint>()
4038

41-
private var backgroundPoints = arrayListOf<TMapPoint>()
42-
4339
private var state = State.FOREGROUND
4440

4541
override fun onCreateView(
@@ -59,7 +55,7 @@ class MissionFragment : Fragment(), MissionHandler {
5955
initTMap()
6056
initView()
6157
setObserve()
62-
setNotification()
58+
drawPersonLine()
6359

6460
}
6561

@@ -163,89 +159,15 @@ class MissionFragment : Fragment(), MissionHandler {
163159
}
164160
}
165161

166-
// private fun drawBusLocationLine() {
167-
// viewModel.busNowLocationInfo.observe(viewLifecycleOwner) { nowLocations ->
168-
// val nowLocation = nowLocations.first()
169-
//
170-
// if (beforeLocation != INIT_LOCATION) {
171-
// tMap.drawMoveLine(
172-
// TMapPoint(nowLocation.latitude.toDouble(), nowLocation.longitude.toDouble()),
173-
// TMapPoint(beforeLocation.latitude, beforeLocation.longitude),
174-
// Marker.BUS_LINE + BUS_LINE_NUM.toString(),
175-
// Marker.BUS_LINE_COLOR
176-
// )
177-
// BUS_LINE_NUM += 1
178-
// }
179-
// beforeLocation = Location(nowLocation.latitude.toDouble(), nowLocation.longitude.toDouble())
180-
//
181-
// viewModel.busCurrentLocation = beforeLocation
182-
//
183-
// tMap.addMarker(
184-
// Marker.BUS_MARKER,
185-
// Marker.BUS_MARKER_IMG,
186-
// TMapPoint(nowLocation.latitude.toDouble(), nowLocation.longitude.toDouble())
187-
// )
188-
// tMap.trackingTransport(beforeLocation)
189-
// }
190-
// }
191-
//
192-
// private fun drawSubwayLocationLine() {
193-
// viewModel.subwayRoute.observe(viewLifecycleOwner) { subwayRoute ->
194-
// viewLifecycleOwner.lifecycleScope.launch {
195-
// val timeUnit = (subwayRoute.sectionTime * SECOND_UNIT / subwayRoute.line.size).toLong()
196-
// subwayRoute.line.forEachIndexed { index, nowLocation ->
197-
// if (index == 0) {
198-
// return@forEachIndexed
199-
// }
200-
//
201-
// val beforeLocation = subwayRoute.line[index - 1]
202-
// tMap.drawMoveLine(
203-
// TMapPoint(nowLocation.latitude, nowLocation.longitude),
204-
// TMapPoint(beforeLocation.latitude, beforeLocation.longitude),
205-
// Marker.SUBWAY_LINE + (index - 1).toString(),
206-
// Marker.SUBWAY_LINE_COLOR
207-
// )
208-
//
209-
// viewModel.busCurrentLocation = Location(nowLocation.latitude, nowLocation.longitude)
210-
//
211-
// tMap.addMarker(
212-
// Marker.SUBWAY_MARKER,
213-
// Marker.SUBWAY_MARKER_IMG,
214-
// TMapPoint(nowLocation.latitude, nowLocation.longitude)
215-
// )
216-
//
217-
// delay(timeUnit)
218-
// }
219-
// }
220-
//
221-
// }
222-
// }
223-
224162
override fun alertTMapReady() {
225163
requestPermissionsLauncher.launch(PERMISSIONS)
226164
tMap.setTrackingMode()
227-
// drawBusLocationLine()
228-
// drawSubwayLocationLine()
229-
}
230-
231-
override fun setOnLocationChangeListener(nowLocation: TMapPoint, beforeLocation: TMapPoint, canMakeLine: Boolean) {
232-
// if (canMakeLine) {
233-
// tMap.drawMoveLine(
234-
// nowLocation,
235-
// beforeLocation,
236-
// Marker.PERSON_LINE + PERSON_LINE_NUM.toString(),
237-
// Marker.PERSON_LINE_COLOR
238-
// )
239-
// PERSON_LINE_NUM += 1
240-
// }
241-
242165
}
243166

244167
override fun setOnEnableScrollWithZoomLevelListener() {
245168
tMap.apply {
246169
tMapView.setOnEnableScrollWithZoomLevelListener { _, _ ->
247170
isTracking = false
248-
// isTransportTracking = false
249171
}
250172
}
251173
}
@@ -258,11 +180,7 @@ class MissionFragment : Fragment(), MissionHandler {
258180
}
259181
}
260182

261-
private fun setNotification() {
262-
test()
263-
}
264-
265-
private fun test() {
183+
private fun drawPersonLine() {
266184
var first = 0
267185
lifecycleScope.launch {
268186
viewModel.userLocation.collect { userLocation ->
@@ -280,7 +198,6 @@ class MissionFragment : Fragment(), MissionHandler {
280198
Marker.PERSON_LINE + PERSON_LINE_NUM.toString(),
281199
Marker.PERSON_LINE_COLOR
282200
)
283-
//PERSON_LINE_NUM += 1
284201

285202
}
286203

@@ -289,51 +206,6 @@ class MissionFragment : Fragment(), MissionHandler {
289206
}
290207
}
291208

292-
private fun drawPersonLine() {
293-
lateinit var nowLocation: TMapPoint
294-
lateinit var beforeLocation: TMapPoint
295-
//if (viewModel.userState.value is UserState.Foreground) {
296-
// nowLocation = viewModel.getLocation()
297-
// if (PERSON_LINE_NUM == 0) {
298-
// viewModel.initLocation.observe(viewLifecycleOwner){
299-
// beforeLocation = it
300-
// }
301-
// }
302-
// tMap.drawMoveLine(
303-
// nowLocation,
304-
// beforeLocation,
305-
// Marker.PERSON_LINE + PERSON_LINE_NUM.toString(),
306-
// Marker.PERSON_LINE_COLOR
307-
// )
308-
// PERSON_LINE_NUM += 1
309-
// beforeLocation = nowLocation
310-
// viewModel.personCurrentLocation = Location(nowLocation.latitude, nowLocation.longitude)
311-
//
312-
// Log.d("MissionWorker", "location value ${viewModel.userState.value}")
313-
// }
314-
// else {
315-
// val allLocation = viewModel.getAllLocation()
316-
// allLocation.forEachIndexed { index, nowLocationInAll ->
317-
// if (index == 0) {
318-
// tMap.drawMoveLine(
319-
// nowLocationInAll,
320-
// beforeLocation,
321-
// Marker.PERSON_LINE + PERSON_LINE_NUM.toString(),
322-
// Marker.PERSON_LINE_COLOR
323-
// )
324-
// } else {
325-
// tMap.drawMoveLine(
326-
// nowLocationInAll,
327-
// beforeLocation,
328-
// Marker.PERSON_LINE + PERSON_LINE_NUM.toString(),
329-
// Marker.PERSON_LINE_COLOR
330-
// )
331-
// }
332-
// beforeLocation = nowLocationInAll
333-
// }
334-
// }
335-
}
336-
337209
companion object {
338210

339211
private const val DESTINATION = "구로3동현대아파트"
@@ -343,12 +215,6 @@ class MissionFragment : Fragment(), MissionHandler {
343215

344216
private var PERSON_LINE_NUM = 0
345217

346-
private var BUS_LINE_NUM = 0
347-
348-
private val INIT_LOCATION = Location(0.0, 0.0)
349-
350-
private const val SECOND_UNIT = 1_000
351-
352218
private val PERMISSIONS =
353219
arrayOf(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
354220

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package com.stop.ui.mission
22

3-
import com.skt.tmap.TMapPoint
43
import com.stop.ui.util.Handler
54

65
interface MissionHandler : Handler {
76

87
fun alertTMapReady()
98

10-
fun setOnLocationChangeListener(nowLocation: TMapPoint, beforeLocation: TMapPoint, canMakeLine: Boolean)
11-
129
fun setOnEnableScrollWithZoomLevelListener()
1310

1411
}

0 commit comments

Comments
 (0)