Repository navigation
fix: 겹친 알람에서 조작 대상이 어긋나지 않게 하고 밀려난 알람도 미룰 수 있게 한다 (167) - #173
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Issues
Closes #167
📎 Work Description
알람이 겹칠 때 「다시 알림」 과 「끄기」 가 화면에 보이는 일정이 아니라 마지막에 도착한 알람에 걸렸습니다. #131 에서 겹침을 다루면서 남은 자리입니다.
서비스는 「지금 울리는 것」 을 필드 하나로 들고, 새 알람이 오면 앞의 것을 조용한 알림으로 옮긴 뒤 그 필드를 덮어씁니다. 그런데 전체 화면의 버튼은 신원 없는 요청만 보내고 서비스는 그것을 무조건 지금 값에 적용했습니다.
전체 화면은
singleInstance라 새 알람이onNewIntent로 들어오면 제목을 갱신하지만, 화면이 켜져 잠금이 풀린 상태에서는 시스템이 전체 화면 의도를 띄우지 않고 헤드업으로 내립니다. 그때onNewIntent가 오지 않으므로 화면에는 앞 알람 제목이 그대로 남고, 서비스의 값만 뒤 알람으로 바뀝니다.요청에 신원을 실어 보냅니다. 끄기와 다시 알림 인텐트가 자리 번호를 담고, 화면은 자기가 받은 값을 그대로 되돌려 줍니다. 서비스는 요청의 신원이 지금 울리는 것과 다르면 무시하고 로그를 남깁니다. 자리 번호가 없는 옛 알림에서 온 요청은 지금 울리는 것으로 봅니다 — 그러지 않으면 그 버튼이 아무 일도 하지 않는 버튼이 됩니다.
밀려난 알람에도 다시 알림을 붙였습니다. 종전에는 조용한 알림 한 줄만 남고 끄기도 다시 알림도 없어서, 그 일정은 다시 울릴 기회가 아예 없었습니다. 겹친 순간에 뒤에 온 알람이 앞의 것을 통째로 삼킨 셈이었습니다. 서비스가 그 알람을 더 이상 들고 있지 않으므로 필요한 값을 전부 요청에 실어 보내고, 미룬 뒤에는 그 알림을 지웁니다.
📷 Screenshot
전체 화면 알람은 XML 레이아웃이라 스크린샷 테스트 대상이 아닙니다. baseline 변화 없습니다.
💬 To Reviewers
ktlintFormat·testDebugUnitTest(전 모듈 119개 통과) ·:app:lintDebug초록입니다.