Skip to content

Commit d12d968

Browse files
committed
feat : 미션 line 색 변경 & gps 임의로 고정하고 실행시 안되는 에러 해결
- stateFlow를 collect할 때 0부터 바로 처리하도록 수정
1 parent 332da8e commit d12d968

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ class MissionFragment : Fragment(), MissionHandler {
138138
lateinit var beforeLocation: Location
139139
lifecycleScope.launch {
140140
missionViewModel.userLocation.collectIndexed { index, userLocation ->
141-
if (index == 1) {
141+
if (index == 0) {
142142
initMarker(userLocation)
143143
beforeLocation = userLocation
144-
} else if (index > 1) {
144+
} else if (index > 0) {
145145
drawNowLocationLine(TMapPoint(userLocation.latitude, userLocation.longitude), TMapPoint(beforeLocation.latitude, beforeLocation.longitude))
146146
personCurrentLocation = userLocation
147147
if (tMap.isTracking) {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
package com.stop.ui.mission
22

33
import android.content.Context
4+
import androidx.core.content.ContextCompat
45
import com.skt.tmap.TMapPoint
56
import com.skt.tmap.overlay.TMapPolyLine
67
import com.stop.domain.model.route.tmap.custom.WalkRoute
78
import com.stop.ui.util.TMap
89

910
class MissionTMap(
10-
context: Context,
11+
private val context: Context,
1112
handler: MissionHandler,
1213
) : TMap(context, handler) {
1314

1415
fun drawMoveLine(nowLocation: TMapPoint, beforeLocation: TMapPoint, id: String, color: Int) {
1516
val points = arrayListOf(nowLocation, beforeLocation)
1617
val polyLine = TMapPolyLine(id, points).apply {
17-
lineColor = color
18-
outLineColor = color
18+
lineColor = ContextCompat.getColor(context, color)
19+
outLineColor = ContextCompat.getColor(context, color)
1920
}
2021

2122
tMapView.addTMapPolyLine(polyLine)
2223
}
2324

2425
fun drawWalkLines(points: ArrayList<TMapPoint>, id: String, color: Int) {
2526
val polyLine = TMapPolyLine(id, points).apply {
26-
lineColor = color
27-
outLineColor = color
27+
lineColor = ContextCompat.getColor(context, color)
28+
outLineColor = ContextCompat.getColor(context, color)
2829
}
2930
tMapView.addTMapPolyLine(polyLine)
3031
}

presentation/src/main/java/com/stop/ui/util/Marker.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.stop.ui.util
22

3-
import android.graphics.Color
43
import com.stop.R
54

65
object Marker {
@@ -16,11 +15,11 @@ object Marker {
1615
const val PERSON_MARKER = "person_marker"
1716
const val PERSON_MARKER_IMG = R.drawable.ic_person_marker
1817
const val PERSON_LINE = "person_line"
19-
const val PERSON_LINE_COLOR = Color.MAGENTA
18+
const val PERSON_LINE_COLOR = R.color.mint
2019

2120
const val DESTINATION_MARKER = "destination_marker"
2221
const val DESTINATION_MARKER_IMG = R.drawable.ic_start_marker
2322

2423
const val WALK_LINE = "walk_line"
25-
const val WALK_LINE_COLOR = Color.BLACK
24+
const val WALK_LINE_COLOR = R.color.main_dark_grey
2625
}

presentation/src/main/res/drawable-v24/ic_person_marker.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
android:viewportHeight="24">
66

77
<path
8-
android:fillColor="#5DC19B"
8+
android:fillColor="@color/mint"
99
android:pathData="M19,2L5,2c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h4l2.29,2.29c0.39,0.39 1.02,0.39 1.41,0L15,20h4c1.1,0 2,-0.9 2,-2L21,4c0,-1.1 -0.9,-2 -2,-2zM12,5.3c1.49,0 2.7,1.21 2.7,2.7s-1.21,2.7 -2.7,2.7S9.3,9.49 9.3,8s1.21,-2.7 2.7,-2.7zM18,16L6,16v-0.9c0,-2 4,-3.1 6,-3.1s6,1.1 6,3.1v0.9z"
1010
android:strokeWidth="1"
1111
android:strokeColor="#FFFFFF" />

presentation/src/main/res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
<color name="blue">#2196F3</color>
2222
<color name="red">#F44336</color>
2323
<color name="light_yellow">#FDDCA4</color>
24+
<color name="mint">#5DC19B</color>
2425
</resources>

0 commit comments

Comments
 (0)