Skip to content
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

[feat/challenge]: 챌린지 기초 작업 #66

Merged
merged 19 commits into from
Jan 10, 2024
Merged

Conversation

kez-lab
Copy link
Member

@kez-lab kez-lab commented Jan 9, 2024

개요

작업 사항

  • 챌린지 모듈 분리
  • MainViewModel 코어 모듈 분리
  • 테스트 코드 작성

@kez-lab kez-lab added 🐱의진 의진이 작업 💻feat 새로운 기능 추가 labels Jan 9, 2024
@kez-lab kez-lab self-assigned this Jan 9, 2024
@kez-lab kez-lab requested a review from a team as a code owner January 9, 2024 15:58
# Conflicts:
#	settings.gradle.kts
@jihyun0v0
Copy link
Collaborator

의진님 너무 수고 많으셨습니다~
짱이진

@kez-lab
Copy link
Member Author

kez-lab commented Jan 9, 2024

@jihyun0v0 컨벤션을 다시잡죠 ㅎㅎ 너무 비효율적이네요

private val getUsageGoalsUseCase: GetUsageGoalsUseCase,
) : ViewModel() {
private val _mainState = MutableStateFlow(MainState())
val mainState = _mainState.asStateFlow()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mainState에 MainViewModel에서 사용하는 여러 dataFlow를 저장하는 건가요?

Comment on lines +4 to +5
val packageName: String = "",
val goalTime: Long = 0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런식으로 초기화 할 수 있구나~ 배워갑니다~

Comment on lines +13 to +26
val formattedGoalTime: String
get() {
val hours = goalTimeInHours
val minutes = goalTimeInMinutes
return buildString {
if (hours > 0) {
append("$hours 시간")
}
if (minutes > 0) {
if (hours > 0) append(" ")
append("$minutes 분")
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확장성을 위해서 이 함수를 common에 넣는 건 안좋은 방법인가요? 궁금합니다!

Comment on lines +10 to +13
operator fun invoke(): List<UsageGoal> {
return getUsageGoalsUseCase.getUsageGoals()
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아주 깔끔한 UseCase 굿!

Copy link
Member

@kangyuri1114 kangyuri1114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 보고 갑니당!!! 궁금한 사항들 적어두었으니 시간될 때 답변 부탁드려요(꾸벍)

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="3시간"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

디자인 확인을 위해 적어둔 텍스트라면 tools 써도 좋을 것 같습니다!

android:id="@+id/iv_challenge_status"
android:layout_width="38dp"
android:layout_height="38dp"
android:src="@drawable/shape_background_radius8_blackground"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xml 전반적으로 줄바꿈 확인 부탁드립니다!

Comment on lines +75 to +78
// 첫 번째와 마지막 아이템을 제외한 경우에만 마진 적용
if (position != 0) {
outRect.top = verticalSpaceHeight
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

position != 0 인데 마지막 아이템도 마진 적용되는 거 맞을까요?

Comment on lines +12 to +15
data class MainState(
val challengeStatus: ChallengeStatus = ChallengeStatus(),
val usageGoals: List<UsageGoal> = emptyList(),
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MVI 패턴 적용 참고해서 나중에 저도 잘 다듬어보겠습니다

Comment on lines +46 to +47
val challengeAdapter = binding.rvChallengeCalendar.adapter as? ChallengeCalendarAdapter
val challengeGoalsAdapter = binding.rvAppUsageGoals.adapter as? ChallengeUsageGoalsAdapter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미 어댑터가 init~함수에 있는 것 같은데 한번더 collect 함수에서 as? 를 사용해서 캐스팅한 이유 궁금합니다!

Comment on lines +46 to +48
val challengeAdapter = binding.rvChallengeCalendar.adapter as? ChallengeCalendarAdapter
val challengeGoalsAdapter = binding.rvAppUsageGoals.adapter as? ChallengeUsageGoalsAdapter
activityViewModel.mainState.flowWithLifecycle(viewLifeCycle).onEach {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제 리사이클러 뷰는 어디서 재활용하는 건가요??

Copy link
Collaborator

@jihyun0v0 jihyun0v0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의진님 코드 정말 깔끔하고 뜯어볼게 참 많습니다. 잘 배워갑니다~

@jihyun0v0 jihyun0v0 merged commit 632de06 into develop Jan 10, 2024
1 check passed
@jihyun0v0 jihyun0v0 deleted the feat/challenge branch January 10, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐱의진 의진이 작업 💻feat 새로운 기능 추가
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[feat]: 챌린지 기능 및 화면 개발
3 participants