-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] 일정화면 에러상태 새로고침 불가 문제 해결 #51
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
184a5fc
refactor(Schedule): 기존 View 기반 RecyclerView Adapter 및 ViewHolder 제거
parkjiminnnn 57f8984
refactor: 불필요한 supervisorScope 제거
parkjiminnnn 8d8de9b
refactor: 변수명 변경
parkjiminnnn 51847da
feat: 에러상태 화면 구현
parkjiminnnn 02d2ed8
feat: content description 정의
parkjiminnnn 8d9e6b0
fix: 에러 상태에 새로고침이 불가하던 문제 해결
parkjiminnnn e7bf9a0
refactor: ScheduleEventsUiState 구조 개선
parkjiminnnn 7603a85
refactor(LoadingStateScreen): Lottie 애니메이션 재생 제어 파라미터 추가
parkjiminnnn 899b87f
refactor(schedule): `ScheduleUiState` 데이터 구조 개선 및 상태 처리 로직 리팩토링
parkjiminnnn 16c1058
test(Schedule): ScheduleUiState 및 ScheduleEventsUiState 데이터 구조 변경 반영
parkjiminnnn 4edf8b9
refactor: 변수명 변경
parkjiminnnn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/daedan/festabook/presentation/common/component/ErrorStateScreen.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package com.daedan.festabook.presentation.common.component | ||
|
|
||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.daedan.festabook.R | ||
| import com.daedan.festabook.presentation.theme.FestabookTypography | ||
| import com.daedan.festabook.presentation.theme.festabookSpacing | ||
|
|
||
| @Composable | ||
| fun ErrorStateScreen(modifier: Modifier = Modifier) { | ||
| Column( | ||
| modifier = modifier.fillMaxSize(), | ||
| verticalArrangement = Arrangement.Center, | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| Icon( | ||
| painter = painterResource(R.drawable.ic_fail_load), | ||
| contentDescription = stringResource(R.string.content_description_iv_fail_load), | ||
| modifier = Modifier.size(48.dp), | ||
| ) | ||
| Spacer(modifier = Modifier.height(festabookSpacing.paddingBody2)) | ||
| Text( | ||
| text = stringResource(R.string.error_fail_to_load_info), | ||
| style = FestabookTypography.bodyLarge, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun ErrorStateScreenPreview() { | ||
| ErrorStateScreen() | ||
| } |
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
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
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
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
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
36 changes: 0 additions & 36 deletions
36
app/src/main/java/com/daedan/festabook/presentation/schedule/adapter/ScheduleAdapter.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Content를 ScheduleUiState에 중첩하신 이유가 있나요?
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.
새로고침을 할 때 새로고침 시간동안 기존 뷰를 유지하려면 기존 refreshing 객체는 이전 상태를 가지고 있어야 했습니다.
하지만 새로 고침 상태에서 이전상태가 성공인지, 에러인지를 또 분기처리를 해서 구현하는 것이 코드를 읽는 입장에서 가독성이 매우 떨어진다고 생각했습니다!
따라서 uiState에서 항상 뷰에 대한 내용을 가지고 있게 하기 위해 data class로 구현 후 Content를 넣어주었습니다.