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_ui]: 챌린지 현황 뷰 ui 수정 #167

Merged
merged 31 commits into from
Mar 30, 2024

Conversation

jihyun0v0
Copy link
Collaborator

@jihyun0v0 jihyun0v0 commented Mar 15, 2024

개요

작업 사항

  • 챌린지 현황 뷰 ui 수정
  • 편집 버튼 클릭 시 쓰레기통 아이콘 추가
  • 쓰레기통 아이콘 추가를 위한 뷰모델 수정 (challengeViewModel에 ChallengeState내용 수정)
  • 캘린더 배경이미지 변경, 캘린더 아이콘 디자인 변경
  • ChallengeFragment 함수 쪼개기 리팩토링

스크린샷(optional)

Screen_recording_20240315_221331.webm

허거덩,,, 하다보니 파일 98개나 건들였네요,,,, 매우 송구스럽습니다만 아이콘 추가가 많아서 그런 파일도 많을거에요,,,, 쓰흡,,,,

@jihyun0v0 jihyun0v0 added 💻feat 새로운 기능 추가 🐥지현 지현이 작업 labels Mar 15, 2024
@jihyun0v0 jihyun0v0 self-assigned this Mar 15, 2024
@jihyun0v0 jihyun0v0 requested a review from a team as a code owner March 15, 2024 13:14
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.

음.... 근데 파일체인지가 98개 있는게 단순히 건드린게 많아서 같지가 않아요...
이전 pr들도 그렇고 제일 처음에 있던 수정사항이 다른 pr에도 반영이 되고 있어서 제일 마지막 pr인 여기서가 가장 파일체인지가 많은 거 같은데.....
깃허브 브랜치 관련해서 뭔가 잘못되고 있는 것 같은데...... 무슨 문제인지 아실까욤..?

collectChallengeState()
collectMainStateAndBindViews()
collectChallengeStateAndBindModifierButton()
// collectUsageGoalsAndModifierStateAndBindView()
Copy link
Member

Choose a reason for hiding this comment

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

이 함수는 왜 주석처리 되어있나요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오모나 주석처리 제거 안된 부분이 상당하네요... 웁스 지우겠습니다~

Comment on lines 124 to 126
private fun initChallengeCreateButton() {
binding.btnChallengeCreate.setOnClickListener { }
}
Copy link
Member

Choose a reason for hiding this comment

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

아직 챌린지 생성하기 기능이 없어서 빈 것이라면 간단한 로그나 TODO 넣어놓아도 좋을 것 같습니당

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네엡~

Comment on lines 47 to 48
// private val _usageGoalsState = MutableStateFlow(UsageGoalsState())
// val usageGoalsState = _usageGoalsState.asStateFlow()
Copy link
Member

Choose a reason for hiding this comment

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

usageGoal 관련 로직이 다 주석처리 되어있네용
지금 로그인 안되어서 오류나서 그러는건가요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

지웠습니다~

@@ -28,6 +29,15 @@ data class AppAddState(
class AppAddViewModel @Inject constructor(
private val getInstalledAppUseCase: GetInstalledAppUseCase
) : ViewModel() {
private fun getInstalledApps() {
viewModelScope.launch {
delay(50)
Copy link
Member

Choose a reason for hiding this comment

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

delay는 왜 추가 되었나요??

Copy link
Collaborator Author

@jihyun0v0 jihyun0v0 Mar 23, 2024

Choose a reason for hiding this comment

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

Slack에 간단히 언급했던 문제입니당! (https://hmhteamhq.slack.com/archives/C06AHJP0R9R/p1710509172258019)

자세한 설명은 notion에 기록해두면서 해결해 나가려고 하는데(https://www.notion.so/msmmx/NullPointerException-6de7f2846c774cca9c02410a7dd5c2b1) 여기서 조금 설명을 드려보자면,
앱 진입하자마자 달성현황뷰에서 앱추가 선택 시 NullPointerException 발생하는 문제가 있었습니다.
앱을 추가하려면 앱 리스트를 시스템으로 부터 받아와야 합니다. 하지만, 이때 앱 리스트를 받아오는데 이 과정에서 리스트가 다 전달되지 않았는데 이를 사용하려 하는 경우 즉, Empty List를 참조하는 경우가 발생한다고 생각했습니다.

이를 delay를 통해 해당 Exception을 예방하고자 했습니다. (이렇게 하니 문제는 해결되었는데 궁국적인 해결책은 아닌 것 같다는 생각이 듭니다. 일단 'NullPointerException을 예방하기 위한 임시 해결책'이라고 생각해주시면 될 것 같아요!)

Copy link
Member

Choose a reason for hiding this comment

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

오 그렇군용 ! delay방법과 비슷하게 LodingView를 넣는 것도 또 다른 방법이 될 것 같아용!

import com.hmh.hamyeonham.feature.challenge.R
import com.hmh.hamyeonham.feature.challenge.databinding.ItemChallengeStatusBinding

class ChallengeCalendarAdapter :
class ChallengeCalendarAdapter(private val context: Context) :
Copy link
Member

Choose a reason for hiding this comment

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

이 context는 언제 사용되는걸까요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

해당 부분은 viewHolder에 다시 전달되어 getColor함수에서 (아이디에 따른 색상 값을 가져올 때) 사용됩니다.

Comment on lines 47 to 56
fun setVisibility(modifierState: ModifierState) {
val editMode = if (modifierState == ModifierState.EDIT) View.INVISIBLE else View.VISIBLE
val doneMode = if (modifierState != ModifierState.EDIT) View.INVISIBLE else View.VISIBLE
binding.tvAppName.visibility = doneMode
binding.tvAppUsageGoal.visibility = doneMode

binding.tvAppNameDelete.visibility = editMode
binding.tvAppUsageGoalDelete.visibility = editMode
binding.ivTrash.visibility = editMode
}
Copy link
Member

Choose a reason for hiding this comment

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

앱 편집 상태에 따른 UI 변경 맞죠?? 확인했습니당

@kangyuri1114
Copy link
Member

첫 pr 이후 브랜치들 첫pr의 브랜치 기준으로 소브랜치 파서 작업한건가요??

@jihyun0v0 jihyun0v0 changed the base branch from develop to feat/mypage_ui March 23, 2024 11:58
@jihyun0v0 jihyun0v0 changed the base branch from feat/mypage_ui to feat/usage_statics_ui March 23, 2024 11:58
@jihyun0v0 jihyun0v0 changed the base branch from feat/usage_statics_ui to feat/mypage_ui March 23, 2024 11:59
enum class ModifierState {
DELETE,
CANCEL,
EDIT, DONE,
Copy link
Member

Choose a reason for hiding this comment

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

네이밍 변경된거 너무 좋은 것 같아용

Comment on lines +51 to +56
binding.tvAppName.visibility = doneMode
binding.tvAppUsageGoal.visibility = doneMode

binding.tvAppNameDelete.visibility = editMode
binding.tvAppUsageGoalDelete.visibility = editMode
binding.ivTrash.visibility = editMode
Copy link
Member

Choose a reason for hiding this comment

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

각 텍스트들을 state에 따라 보이게, 안보이게 하는 코드 같은데
visible 보다는 텍스트뷰는 하나로 두고 각 state에 따라 string을 바꾸는게 좋지 않을까용?

Copy link
Member

Choose a reason for hiding this comment

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

이전 코드 보다 훨씬 깔끔해진 것 같아용~!

@@ -0,0 +1,94 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Member

Choose a reason for hiding this comment

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

이거 포인트 뱃지 아이콘 맞을까요????
이 아이콘 파일이 포인트 받기 뷰에서도 쓰이는데 core로 빼는 거 어떨까요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵 수정하겠습니당

@jihyun0v0 jihyun0v0 merged commit 5c67825 into feat/mypage_ui Mar 30, 2024
@jihyun0v0 jihyun0v0 deleted the feat/challenge_ui branch March 30, 2024 13:21
kez-lab pushed a commit that referenced this pull request Nov 20, 2024
[�feat/challenge_ui]: 챌린지 현황 뷰 ui 수정
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] 챌린지 현황 뷰 ui 수정
2 participants