-
Notifications
You must be signed in to change notification settings - Fork 0
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
#257 [feat] 성향결과 이미지 다운로드 구현 #314
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.
작업하시느라 수고하셨습니다 ~ !
코맨트 확인해주세요!
} else { | ||
showToast(this, "권한을 설정해주세요.") | ||
} |
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.
string resource
import kotlinx.coroutines.flow.asStateFlow | ||
import kotlinx.coroutines.launch | ||
import timber.log.Timber | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class PersonalityResultViewModel @Inject constructor( | ||
private val application: Application, |
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.
viewmodel 내부엔 context를 지양하고 있습니다.
application 또한 context 를 상속 받고 있기 때문에
viewmodel 과 application 을 분리해야 된다고 생각합니다..!
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.
viewmodel 내부엔 context를 지양하고 있습니다. application 또한 context 를 상속 받고 있기 때문에 viewmodel 과 application 을 분리해야 된다고 생각합니다..!
context 안받으려고 application 받았는데..
액티비티에서 코루틴을 사용하지 않으려고 application 받아서 구현했거든요
좀 더 고민해보겠습니다
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.
viewmodel 내부엔 context를 지양하고 있습니다.
application 또한 context 를 상속 받고 있기 때문에
viewmodel 과 application 을 분리해야 된다고 생각합니다..!
좀 더 추가 설명을 달자면 context와 viewModel의 생명주기는 다르다는 점 때문입니다. 따라서, context를 잘 못 사용하게 된다면 메모리 누수가 발생할 수 있습니다.
예시로, configure Change가 발생한다면 가정해볼게요.
그렇다면, context가 파괴되고, 재 생성될 겁니다. 그런데 viewModel은 configure Change에도 살아남죠.
만약 viewmodel이 configure Change 이전에 넘겨준 context일 경우 메모리 누수와 더불어 Error가 발생할 수 있습니다
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.
고생하셨습니다!! 코멘트 확인해주세용
@2zerozu
추가적으로 이미지를 저장하는 로직은 data layer
에서 처리해야한다고 생각이 드네요.
레포지토리를 하나 파서 처리해도 괜찮을 거 같습니다!
...main/java/hous/release/android/presentation/personality/result/PersonalityResultViewModel.kt
Outdated
Show resolved
Hide resolved
...main/java/hous/release/android/presentation/personality/result/PersonalityResultViewModel.kt
Outdated
Show resolved
Hide resolved
...main/java/hous/release/android/presentation/personality/result/PersonalityResultViewModel.kt
Outdated
Show resolved
Hide resolved
...main/java/hous/release/android/presentation/personality/result/PersonalityResultViewModel.kt
Outdated
Show resolved
Hide resolved
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.
아 어푸로브를 안줬네 ^____^
…to feature/#257-feat-result-image-download
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.
수고하셨습니다 ~ ! 👍
@@ -1,5 +1,5 @@ | |||
package hous.release.domain.entity | |||
|
|||
enum class HomyType { | |||
YELLOW, RED, BLUE, PURPLE, GREEN, GRAY | |||
YELLOW, RED, BLUE, PURPLE, GREEN, GRAY; |
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.
아 젠장 ㅋㅋㅋ 수정하고 머지할게
관련 이슈
2023-09-10.8.19.37.mov
작업한 내용
PR 포인트