[정현수_Android] 8주차 과제 제출#9
Open
Rickettsia1234 wants to merge 2 commits into
Open
Conversation
JaeYoung290
reviewed
Jul 24, 2026
Comment on lines
+100
to
+114
| private fun getFormattedTime(): String { | ||
| val m = (timeCentiseconds / 6000).toString().padStart(2, '0') | ||
| val s = ((timeCentiseconds % 6000) / 100).toString().padStart(2, '0') | ||
| val ms = (timeCentiseconds % 100).toString().padStart(2, '0') | ||
|
|
||
| return "$m:$s:$ms" | ||
| } | ||
|
|
||
| private fun updateTimerText() { | ||
| val m = (timeCentiseconds / 6000).toString().padStart(2, '0') | ||
| val s = ((timeCentiseconds % 6000) / 100).toString().padStart(2, '0') | ||
| val ms = (timeCentiseconds % 100).toString().padStart(2, '0') | ||
|
|
||
| binding.textViewTime.text = "$m : $s : $ms" | ||
| } |
Collaborator
There was a problem hiding this comment.
getFormattedTime(), updateTimerText() 함수의 return 모두 string resource에서 선언하신 time_format, time_format_simple을 사용하셔도 좋아보입니다.
Comment on lines
+54
to
+62
| binding.buttonLap.setOnClickListener { | ||
| val currentText = getFormattedTime() | ||
| val secondsElapsed = timeCentiseconds / 100 | ||
| val lapRecord = getString(R.string.lap_record_format, secondsElapsed, currentText) | ||
|
|
||
| lapList.add(0, lapRecord) | ||
| lapAdapter.notifyItemInserted(0) | ||
| binding.recyclerViewLaps.scrollToPosition(0) | ||
| } |
Collaborator
There was a problem hiding this comment.
리스트 변경은 LapAdapter에서 변경하고 mainactivity에서는 데이터를 불러만 오도록 하시는 것이 캡슐화 원칙에 더 부합해 보입니다.
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.
No description provided.