Skip to content

Commit c3fa402

Browse files
committed
fix: conflict 해결
1 parent f4b8793 commit c3fa402

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

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

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,23 @@ class MapFragment : Fragment(), MapHandler {
163163
override fun onStateChanged(bottomSheet: View, newState: Int) = Unit
164164

165165
override fun onSlide(bottomSheet: View, slideOffset: Float) {
166-
binding.homeBottomSheet.layoutStateExpanded.layoutBottomSheetHomeStateExpanded.alpha = slideOffset
167-
binding.homeBottomSheet.textViewAlarmState.alpha = 1 - slideOffset
166+
with (binding.homeBottomSheet) {
167+
layoutStateExpanded.layoutBottomSheetHomeStateExpanded.alpha = slideOffset
168+
textViewAlarmState.alpha = 1 - slideOffset
169+
}
168170
}
169171
})
170172
}
171173

172174
private fun initBottomSheetView() {
173175
binding.homeBottomSheet.layoutStateExpanded.viewAlarm.setOnClickListener {
176+
val notificationManager =
177+
requireContext().getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
174178
val behavior = BottomSheetBehavior.from(binding.layoutHomeBottomSheet)
175179
val intent = Intent(requireContext(), SoundService::class.java)
176180

177181
alarmViewModel.deleteAlarm()
182+
notificationManager.cancel(AlarmSettingFragment.ALARM_NOTIFICATION_HIGH_ID)
178183
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
179184
requireContext().stopService(intent)
180185
SoundService.normalExit = true
@@ -241,34 +246,13 @@ class MapFragment : Fragment(), MapHandler {
241246
}
242247

243248
private fun setViewVisibility() {
244-
with (binding) {
249+
with(binding) {
245250
textViewSearch.visibility = mapUIVisibility
246251
layoutCompass.visibility = mapUIVisibility
247252
layoutCurrent.visibility = mapUIVisibility
248253
}
249254
}
250255

251-
private fun listenButtonClick() {
252-
binding.homeBottomSheet.layoutStateExpanded.buttonAlarmTurnOff.setOnClickListener {
253-
alarmViewModel.deleteAlarm()
254-
cancelNotification()
255-
turnOffSoundService()
256-
val behavior = BottomSheetBehavior.from(binding.layoutHomeBottomSheet)
257-
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
258-
}
259-
}
260-
261-
private fun cancelNotification() {
262-
val notificationManager = requireContext().getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
263-
notificationManager.cancel(AlarmSettingFragment.ALARM_NOTIFICATION_HIGH_ID)
264-
}
265-
266-
private fun turnOffSoundService() {
267-
val intent = Intent(requireContext(), SoundService::class.java)
268-
requireContext().stopService(intent)
269-
SoundService.normalExit = true
270-
}
271-
272256
override fun onResume() {
273257
super.onResume()
274258

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<string name="end_position_text">도착지 : %1$s</string>
8181
<string name="last_time_text">막차시간 : %1$s</string>
8282
<string name="walk_time_text">%1$d분</string>
83-
<string name="alarm_last_notification_text">막차시간 %1$s에서 %2$s분 전에 알람이 울릴예정입니다.</string>
83+
<string name="alarm_last_notification_text">알람이 %1$s의 %2$s분 전에 울릴 예정입니다.</string>
8484
<string name="last_time_not_found">알람을 설정할 수 없습니다</string>
8585
<string name="minute_before">분 전</string>
8686
<string name="option_setting">옵션 설정</string>

0 commit comments

Comments
 (0)