-
Notifications
You must be signed in to change notification settings - Fork 5
[week4] Thread & Coroutine _ 쥬 #16
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: jiwoo
Are you sure you want to change the base?
Conversation
SuHyeon00
left a comment
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.
millisecs를 표기하는 부분이 기능상 어색해보이는 것 외에는 정상 작동하는 것 같습니다! 그리고 현재 구현된 방식은 postDelayed함수를 이용하여 10ms 단위로 업데이트 하는 것 같은데 이럴 경우 정확한 시스템 시간 간격으로 업데이트가 되는지 확인해보는 것도 좋을 것 같아요~ 수고하셨습니다!
| // XML 파일의 뷰 ID 연결 | ||
| tvTimer = findViewById(R.id.tvTimer) | ||
| btnStart = findViewById(R.id.btnStart) | ||
| btnClear = findViewById(R.id.btnClear) |
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.
이 부분 ViewBinding 이용해서 연결해주세요!
| private var seconds = 0 | ||
| private var minutes = 0 | ||
|
|
||
| private val handler = Handler() |
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.
Handler를 사용할 때 기본 생성자를 사용하는 방식은 deprecated된 버전이니 초기화 시 사용할 Looper를 함께 넘겨주는 방식으로 초기화해주세요!
| private val timerRunnable = object : Runnable { | ||
| override fun run() { | ||
| if (isRunning) { | ||
| milliseconds += 10 |
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.
10단위로 증가시켜 3자리로 표기하는 이유가 있을까요?
제가 새로운 폴더를 만들고 머지한다음에 풀 리퀘를 날리려 했는데 좀 꼬여서... 여기서 해보ㅏ요ㅠㅠ