Skip to content

Commit 87c0d51

Browse files
committed
refactor: drawable resource 변수로 선언
1 parent 2d176bd commit 87c0d51

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class MapFragment : Fragment(), MapHandler {
117117
placeSearchViewModel.bookmarks.forEachIndexed { index, location ->
118118
tMap.makeMarker(
119119
index.toString(),
120-
R.drawable.ic_baseline_stars_32,
120+
BOOKMARK_MARKER_IMG,
121121
TMapPoint(location.latitude, location.longitude)
122122
)
123123
}
@@ -142,8 +142,8 @@ class MapFragment : Fragment(), MapHandler {
142142
setPanel(clickTMapPoint)
143143

144144
tMap.makeMarker(
145-
MARKER,
146-
R.drawable.ic_baseline_location_on_32,
145+
PLACE_MARKER,
146+
PLACE_MARKER_IMG,
147147
clickTMapPoint
148148
)
149149
}
@@ -164,8 +164,8 @@ class MapFragment : Fragment(), MapHandler {
164164
setPanel(currentTMapPoint)
165165

166166
tMap.makeMarker(
167-
MARKER,
168-
R.drawable.ic_baseline_location_on_32,
167+
PLACE_MARKER,
168+
PLACE_MARKER_IMG,
169169
currentTMapPoint
170170
)
171171
}
@@ -196,7 +196,7 @@ class MapFragment : Fragment(), MapHandler {
196196
override fun setOnDisableScrollWIthZoomLevelListener() {
197197
if (binding.layoutPanel.visibility == View.VISIBLE) {
198198
binding.layoutPanel.visibility = View.GONE
199-
tMap.tMapView.removeTMapMarkerItem(MARKER)
199+
tMap.tMapView.removeTMapMarkerItem(PLACE_MARKER)
200200
} else {
201201
setViewVisibility()
202202
mapUIVisibility = mapUIVisibility.xor(View.GONE)
@@ -208,9 +208,14 @@ class MapFragment : Fragment(), MapHandler {
208208
}
209209

210210
companion object {
211-
private const val MARKER = "marker"
211+
private const val PLACE_MARKER = "place_marker"
212+
private const val PLACE_MARKER_IMG = R.drawable.ic_baseline_location_on_32
213+
212214
private const val PERSON_MARKER = "marker_person_pin"
213215
private const val PERSON_MARKER_IMG = R.drawable.ic_person_pin
216+
214217
val PERMISSIONS = arrayOf(permission.ACCESS_FINE_LOCATION, permission.ACCESS_COARSE_LOCATION)
218+
219+
private const val BOOKMARK_MARKER_IMG = R.drawable.ic_baseline_stars_32
215220
}
216221
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class MapTMap(
2828
fun clickLocation() {
2929
tMapView.setOnLongClickListenerCallback { _, _, tMapPoint ->
3030
makeMarker(
31-
MARKER,
32-
R.drawable.ic_baseline_location_on_32,
31+
PLACE_MARKER,
32+
PLACE_MARKER_IMG,
3333
tMapPoint
3434
)
3535

@@ -39,7 +39,9 @@ class MapTMap(
3939
}
4040

4141
companion object {
42-
private const val MARKER = "marker"
42+
private const val PLACE_MARKER = "marker"
43+
private const val PLACE_MARKER_IMG = R.drawable.ic_baseline_location_on_32
44+
4345
private const val SAME_POINT = 1
4446
}
4547
}

0 commit comments

Comments
 (0)