-
Notifications
You must be signed in to change notification settings - Fork 49
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
[스캇] 1, 2단계 영화 극장 선택 제출합니다. #23
Conversation
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.
1, 2 단계 미션 잘 해주셨습니다.
레벨1에서 배워왔던 경험들을 레벨 2에서도 잘 살려보면 좋겠어요.
몇가지 의견들을 남겨 드렸으니 확인 부탁드립니다. 🙏🏻
app/src/androidTest/java/woowacourse/movie/SettingFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/androidTest/java/woowacourse/movie/SettingFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/androidTest/java/woowacourse/movie/SettingFragmentTest.kt
Outdated
Show resolved
Hide resolved
app/src/androidTest/java/woowacourse/movie/SettingFragmentTest.kt
Outdated
Show resolved
Hide resolved
sharedPreference = | ||
parentContext.getSharedPreferences(SETTING, AppCompatActivity.MODE_PRIVATE) |
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.
프리퍼런스에 접근하고 관리하는 코드도 별도 객체로 분리 해 봐도 좋습니다
싱글톤?
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.
SettingPreferenceManager 를 만들어서 프리퍼런스를 관리하도록 만들었습니다
app/src/main/java/woowacourse/movie/receiver/NotificationHelper.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/woowacourse/movie/receiver/NotificationHelper.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/woowacourse/movie/receiver/ReservationNotificationReceiver.kt
Outdated
Show resolved
Hide resolved
안녕하세요! |
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.
피드백 잘 반영 해 주셨습니다.
다음 3, 4단계에서의 아키텍처 미션에 집중하기 위해 이번 단계는 마무리 하도록 하겠습니다~
다음 단계도 화이팅입니다.
남겨드린 내용은 다음 미션 하면서 같이 반영 해주세요
fragmentScenario?.onFragment { | ||
isAlarmOn = | ||
it.requireActivity().findViewById<Switch>(R.id.setting_push_alarm_switch).isChecked |
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.
실제 UI를 기반으로 테스트 환경이 맞춰졌네요. 👍🏻
} | ||
|
||
private fun getTimeInMillis(localDateTime: LocalDateTime): Long { | ||
val sqlDate = getAlarmDateTime(localDateTime, ALARM_TIME) |
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.
sqlDate가 무엇을 의미하는 것일까요?
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.
alarmDate 로 수정하였습니다
private fun generateAlarmManager(context: Context): AlarmManager { | ||
return context.getSystemService(ALARM_SERVICE) as AlarmManager | ||
} |
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.
알람 매니저의 모든 클래스가 정적 함수처럼 동작을 하고 있어요.
상태를 가지고 있지 않다는 의미로 볼 수 있는데요.
이런 경우는 object로 만들어주거나 아니면 클래스로 사용할 수 있도록 만들어 보는 것도 좋습니다
class ReservationAlaramManager(
private val context: Context,
...
) {
private val manager: AlarmManager by lazy { ... }
}
object SettingPreferenceManager { | ||
private const val KEY_PUSH_ALARM = "KEY_PUSH_ALARM" | ||
private lateinit var sharedPreference: SharedPreferences | ||
fun inIt(context: Context) { |
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.
오타인 것 같네요.
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
addFragment(ReservationListFragment()) | ||
SettingPreferenceManager.inIt(this) |
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.
object에 대한 초기화를 담당하는 것이라면, Application 클래스에서 해 보는건 어떨까요?
val notificationBuilder = generateNotificationBuilder(notificationManager) | ||
bindNotification(notificationBuilder, notificationData) |
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.
NotificationBuilder를 NotificationData에서 만들 수 있지 않을까요?
title = context.getString(woowacourse.movie.R.string.reservation_notification_title), | ||
contextText = "${movieUiModel.title} context.getString(woowacourse.movie.R.string.reservation_notification_description)", |
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.
패키지 import 정리 해주세요
class PushAlarmSwitch(val view: Switch) { | ||
init { | ||
SettingPreferenceManager.inIt(view.context) | ||
view.isChecked = SettingPreferenceManager.getAlarmReceptionStatus() | ||
view.setOnClickListener { | ||
SettingPreferenceManager.changeAlarmReceptionStatus() | ||
} | ||
} | ||
} |
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.
PushAlaramSwitch는 클래스로 분리된 장점이 없습니다.
단순히 private 함수로 존재할 내용이 클래스로 만들어진 차이만 가지고 있어요.
실제로 PushAlarmSwitch의 역할을 하는 것으로 기대한다면,
Switch를 상속받은 커스텀 뷰를 구현하는게 맞습니다.
다만 현재 미션에서의 요구사항은 아니기에 참고만 해 주시면 좋겠습니다.
안녕하세요 안드로이드 5기 스캇입니다!
오랜만에 뵙는 것 같아요!! 반갑습니다!!
이번 리뷰 잘 부탁드립니다😀
이번 단계 변경사항은 다음과 같습니다😀
https://github.com/woowacourse/android-movie-theater/pull/23/files/099110635a845df97d9451f12155e9485385c125..d0c5c666635b3bca646ee2c45cf2106e3d6d4c63