-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] notification 퍼미션 허용시에만 토스트 뜨도록 수정 #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @HI-JIN2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 Pull Request는 알림 권한과 관련된 토스트 메시지 표시 방식을 개선합니다. 이전에는 초기 권한 요청 시와 앱 내 알림 스위치를 토글할 때 토스트 메시지가 표시되었습니다. 이번 변경을 통해 토스트 메시지는 사용자가 시스템 설정을 통해 권한을 부여하거나 거부하는 등 실제 알림 권한 상태가 변경될 때만 표시되도록 하여, 보다 집중적이고 방해받지 않는 사용자 경험을 제공합니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
이 PR은 알림 권한 상태가 변경될 때만 토스트 메시지를 표시하도록 로직을 수정합니다. 기존에 권한 요청 결과나 알림 스위치 토글 시에 매번 표시되던 토스트를 제거하고, onResume에서 권한 상태 변화를 감지하여 처리하는 방식으로 변경되었습니다. 전반적으로 PR의 목적에 맞게 잘 수정되었으나, 코드의 안정성과 유지보수성을 높이기 위해 몇 가지 개선점을 제안합니다. lastNotificationPermissionState의 초기화 위치를 생명주기에 더 안전한 곳으로 옮기고, DateTimeFormatter를 상수로 만들어 재사용하는 것을 고려해 주세요.
| // 초기 권한 상태 저장 (처음 로드될 때만) | ||
| if (lastNotificationPermissionState == null) { | ||
| lastNotificationPermissionState = checkNotificationPermission(requireContext()) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| val nowDatetime = LocalDateTime.now() | ||
| val formattedDate = nowDatetime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DateTimeFormatter 객체는 생성 비용이 있고 스레드에 안전하므로, 매번 새로 생성하기보다는 companion object에 상수로 만들어 재사용하는 것이 성능에 더 효율적입니다. 또한, 날짜 포맷 패턴을 상수로 관리하면 코드의 가독성과 유지보수성도 향상됩니다.
companion object {
private val DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
}
// ...
val formattedDate = LocalDateTime.now().format(DATE_TIME_FORMATTER)
Summary
notification 퍼미션 허용시에만 토스트 뜨도록 수정합니다
단순 알림 토글 on/off에는 토스트 X
Describe your changes
Issue
To reviewers