-
Notifications
You must be signed in to change notification settings - Fork 3
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
[AN] 홈뷰 구조 리팩터링 #594
[AN] 홈뷰 구조 리팩터링 #594
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.
뀻.
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.
LGTM
abstract class BindingViewActivity<VB : ViewBinding>( | ||
private val bindingInflater: (LayoutInflater) -> VB, | ||
) : AppCompatActivity() { | ||
private var _binding: VB? = null | ||
val binding get() = _binding!! | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
_binding = bindingInflater(layoutInflater) | ||
setContentView(binding.root) | ||
} | ||
} |
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.
good
is HomeUiState.Loading -> {} | ||
is HomeUiState.Failed -> {} |
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.
is HomeUiState.Loading -> {} | |
is HomeUiState.Failed -> {} | |
is HomeUiState.Loading -> Unit | |
is HomeUiState.Failed -> Unit |
How about this?
when (userStudies.isEmpty()) { | ||
true -> binding.tvHomeNoStudy.visibility = View.VISIBLE | ||
false -> { | ||
binding.tvHomeNoStudy.visibility = View.INVISIBLE |
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.
How about View.GONE
?
Why use View.INVISIBLE
?
} | ||
val uiState: StateFlow<HomeUiState> = flow { emit(userStudyRepository.getUserStudies()) } | ||
.map { HomeUiState.Success(it) } | ||
.catch { HomeUiState.Failed } |
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.
awesome
😋 작업한 내용
🙏 PR Point
변경사항이 굉장히 많습니다
홈뷰의 대대적인 구조개편을 진행했습니다.
데이터레이어(데이터모델) - 도메인레이어(유즈케이스, 옵셔널) - 뷰모델(uiState, HotFlow) - 뷰(ViewBinding)
👍 관련 이슈
기획의 어떤 부분을 구현 / 수정했는가 (굉장히 상세하게 적어주세요, 해당 커밋의 링크, 코드의 위치를 남겨주면 더욱 좋습니다.)
밑은 예시입니다.
시작되면서 스터디의 주 몇 회 정보를 유저가 실제로 선택한 일 수로 수정
스터디가 더 이상 종료되지 않도록 수정