@@ -53,7 +53,6 @@ class MapFragment : Fragment(), MapHandler {
53
53
initTMap()
54
54
initBottomSheetBehavior()
55
55
initBottomSheetView()
56
- listenButtonClick()
57
56
}
58
57
59
58
override fun alertTMapReady () {
@@ -116,7 +115,6 @@ class MapFragment : Fragment(), MapHandler {
116
115
)
117
116
)
118
117
}
119
-
120
118
}
121
119
122
120
private fun initNavigateAction () {
@@ -170,9 +168,12 @@ class MapFragment : Fragment(), MapHandler {
170
168
private fun initBottomSheetView () {
171
169
binding.homeBottomSheet.layoutStateExpanded.viewAlarm.setOnClickListener {
172
170
val behavior = BottomSheetBehavior .from(binding.layoutHomeBottomSheet)
171
+ val intent = Intent (requireContext(), SoundService ::class .java)
173
172
174
- behavior.state = BottomSheetBehavior .STATE_COLLAPSED
175
173
alarmViewModel.deleteAlarm()
174
+ behavior.state = BottomSheetBehavior .STATE_COLLAPSED
175
+ requireContext().stopService(intent)
176
+ SoundService .normalExit = true
176
177
}
177
178
}
178
179
@@ -243,40 +244,25 @@ class MapFragment : Fragment(), MapHandler {
243
244
}
244
245
}
245
246
246
- private fun listenButtonClick () {
247
- binding.homeBottomSheet.layoutStateExpanded.buttonAlarmTurnOff.setOnClickListener {
248
- val behavior = BottomSheetBehavior .from(binding.layoutHomeBottomSheet)
249
-
250
- behavior.state = BottomSheetBehavior .STATE_COLLAPSED
251
- alarmViewModel.deleteAlarm()
252
- turnOffSoundService()
253
- }
254
- }
255
-
256
- private fun turnOffSoundService () {
257
- val intent = Intent (requireContext(), SoundService ::class .java)
258
-
259
- requireContext().stopService(intent)
260
- SoundService .normalExit = true
261
- }
262
-
263
247
override fun onResume () {
264
248
super .onResume()
265
249
266
250
requireActivity().intent.extras?.getInt(" ALARM_MAP_CODE" )?.let {
267
251
if (it == ALARM_MAP_CODE ) {
268
- showBottomSheet ()
252
+ openBottomSheet ()
269
253
}
270
254
}
271
255
}
272
256
273
- private fun showBottomSheet () {
257
+ private fun openBottomSheet () {
274
258
val behavior = BottomSheetBehavior .from(binding.layoutHomeBottomSheet)
275
259
276
260
behavior.state = BottomSheetBehavior .STATE_EXPANDED
261
+ /*
277
262
binding.homeBottomSheet.layoutStateExpanded.root.visibility = View.VISIBLE
278
263
binding.homeBottomSheet.textViewAlarmState.visibility = View.GONE
279
264
binding.homeBottomSheet.homeBottomSheetDragHandle.visibility = View.GONE
265
+ */
280
266
}
281
267
282
268
override fun onDestroyView () {
0 commit comments