Skip to content

Commit 558a2f1

Browse files
committed
fix: conflict 해결
1 parent ba7c18d commit 558a2f1

File tree

4 files changed

+40
-20
lines changed

4 files changed

+40
-20
lines changed

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

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.stop.ui.map
33
import android.Manifest.permission
44
import android.os.Bundle
55
import android.util.Log
6+
import android.util.TypedValue
67
import android.view.LayoutInflater
78
import android.view.View
89
import android.view.ViewGroup
@@ -12,6 +13,7 @@ import androidx.fragment.app.activityViewModels
1213
import androidx.lifecycle.flowWithLifecycle
1314
import androidx.lifecycle.lifecycleScope
1415
import androidx.navigation.findNavController
16+
import com.google.android.material.bottomsheet.BottomSheetBehavior
1517
import com.skt.tmap.TMapPoint
1618
import com.stop.R
1719
import com.stop.databinding.FragmentMapBinding
@@ -49,13 +51,13 @@ class MapFragment : Fragment(), MapHandler {
4951
initView()
5052
clickSearchButton()
5153
clickEndLocation()
54+
initBottomSheetBehavior()
5255
}
5356

5457
private fun initBinding() {
55-
binding.apply {
56-
lifecycleOwner = viewLifecycleOwner
57-
viewModel = placeSearchViewModel
58-
}
58+
binding.lifecycleOwner = viewLifecycleOwner
59+
binding.placeSearchViewModel = placeSearchViewModel
60+
binding.alarmViewModel = alarmViewModel
5961
}
6062

6163
private fun initTMap() {
@@ -66,11 +68,11 @@ class MapFragment : Fragment(), MapHandler {
6668
}
6769

6870
private fun initView() {
69-
binding.imageViewCompassMode.setOnClickListener {
71+
binding.layoutCompass.setOnClickListener {
7072
tMap.tMapView.isCompassMode = tMap.tMapView.isCompassMode.not()
7173
}
7274

73-
binding.imageViewCurrentLocation.setOnClickListener {
75+
binding.layoutCurrent.setOnClickListener {
7476
requestPermissionsLauncher.launch(PERMISSIONS)
7577
tMap.tMapView.setCenterPoint(
7678
placeSearchViewModel.currentLocation.latitude,
@@ -95,27 +97,37 @@ class MapFragment : Fragment(), MapHandler {
9597
}
9698
}
9799

98-
}
99-
}
100-
101100
private fun clickSearchButton() {
102101
binding.textViewSearch.setOnClickListener {
103102
binding.root.findNavController().navigate(R.id.action_mapFragment_to_placeSearchFragment)
104103
}
105104
}
106105

107106
private fun clickEndLocation() {
108-
binding.textViewEndLocation.setOnClickListener {
107+
binding.viewPanelEnd.setOnClickListener {
109108
binding.root.findNavController().navigate(R.id.action_mapFragment_to_routeFragment)
110109
}
111110
}
112111

112+
private fun initBottomSheetBehavior() {
113+
val behavior = BottomSheetBehavior.from(binding.layoutHomeBottomSheet)
114+
115+
alarmViewModel.bottomSheetVisibility.observe(viewLifecycleOwner) {
116+
if (it) {
117+
behavior.state = BottomSheetBehavior.STATE_EXPANDED
118+
behavior.maxHeight = convertDpToPx(200)
119+
} else {
120+
behavior.maxHeight = convertDpToPx(100)
121+
}
122+
}
123+
}
124+
113125
private fun setViewVisibility() {
114126
with(binding) {
115-
textViewSearch.visibility = mapUIVisibility
116-
imageViewCompassMode.visibility = mapUIVisibility
117-
imageViewCurrentLocation.visibility = mapUIVisibility
118-
imageViewBookmark.visibility = mapUIVisibility
127+
layoutSearch.visibility = mapUIVisibility
128+
layoutCompass.visibility = mapUIVisibility
129+
layoutCurrent.visibility = mapUIVisibility
130+
layoutBookmark.visibility = mapUIVisibility
119131
}
120132
}
121133

@@ -177,6 +189,14 @@ class MapFragment : Fragment(), MapHandler {
177189
}
178190
}
179191

192+
private fun convertDpToPx(dp: Int): Int {
193+
return TypedValue.applyDimension(
194+
TypedValue.COMPLEX_UNIT_DIP,
195+
dp.toFloat(),
196+
resources.displayMetrics
197+
).toInt()
198+
}
199+
180200
override fun onDestroyView() {
181201
_binding = null
182202

@@ -214,14 +234,14 @@ class MapFragment : Fragment(), MapHandler {
214234

215235
companion object {
216236
private const val PLACE_MARKER = "place_marker"
217-
private const val PLACE_MARKER_IMG = R.drawable.ic_baseline_location_on_32
237+
private const val PLACE_MARKER_IMG = R.drawable.ic_point_marker
218238

219239
private const val PERSON_MARKER = "marker_person_pin"
220-
private const val PERSON_MARKER_IMG = R.drawable.ic_person_pin
240+
private const val PERSON_MARKER_IMG = R.drawable.ic_person_marker
221241

222242
private const val SAME_POINT = 1
223243
val PERMISSIONS = arrayOf(permission.ACCESS_FINE_LOCATION, permission.ACCESS_COARSE_LOCATION)
224244

225-
private const val BOOKMARK_MARKER_IMG = R.drawable.ic_baseline_stars_32
245+
private const val BOOKMARK_MARKER_IMG = R.drawable.ic_bookmark_marker
226246
}
227247
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class MapTMap(
4040

4141
companion object {
4242
private const val PLACE_MARKER = "marker"
43-
private const val PLACE_MARKER_IMG = R.drawable.ic_baseline_location_on_32
43+
private const val PLACE_MARKER_IMG = R.drawable.ic_point_marker
4444

4545
private const val SAME_POINT = 1
4646
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MissionTMap(
3838

3939
companion object {
4040
private const val PERSON_MARKER = "marker_person_pin"
41-
private const val PERSON_MARKER_IMG = R.drawable.ic_person_pin
41+
private const val PERSON_MARKER_IMG = R.drawable.ic_person_marker
4242

4343
private const val PERSON_LINE = "person_line"
4444
private const val PERSON_LINE_COLOR = Color.MAGENTA

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ open class TMap(
107107
private const val KOREA_LONGITUDE_MAX = 132.550049
108108

109109
private const val PERSON_MARKER = "marker_person_pin"
110-
private const val PERSON_MARKER_IMG = R.drawable.ic_person_pin
110+
private const val PERSON_MARKER_IMG = R.drawable.ic_person_marker
111111
}
112112
}

0 commit comments

Comments
 (0)