-
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
[Feature/#7 week04] #8
base: develop
Are you sure you want to change the base?
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.
κ³ μνμ ¨μ΅λλ€! λ°μ΄ν°λ¨ λΆλ¦¬κ° μ‘°κΈ λ λλ©΄ μ’μ κ² κ°μμ! network, local data λ¨μμ dataSource, service, repository κ°μ μν μ μ‘°κΈ λ μ λΆλ¦¬ ν μ μμ κ² κ°μ΅λλ€!
if (response.isSuccessful && response.body() != null) { | ||
val token = response.body()?.result?.token | ||
if (token != null) { | ||
userRepository.saveUserToken(token) | ||
_loginEvent.emit(LoginEvent.Success(token)) | ||
} else { | ||
_loginEvent.emit(LoginEvent.Failure("ν ν°μ λ°μμ€μ§ λͺ»νμ΅λλ€.")) | ||
} |
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.
ν΄λΉ if λ¬Έ κ²μ¦κ³Ό _loginEvent.emit μ νκΈ°κΉμ§μ depth λ₯Ό λ·°λͺ¨λΈμ κ±°μΉκΈ°μ μ ν΄μν μ μμΌλ©΄ μ’μ κ² κ°μμ! κ·Έμ tokenμ λ°κ±°λ, μ€ν¨μ λμλ§ μ²λ¦¬νλ λμμ΄ μμΌλ©΄ μ’μ κ² κ°μμ! μ΄λμμ ν΄λΉ μ²λ¦¬λ₯Ό ν΄μ£Όλ©΄ μ’μκΉμ!?
userRepository.postSignUp(username, password, hobby) | ||
}.onSuccess { response -> | ||
if (response.isSuccessful && response.body() != null) { | ||
userRepository.saveUserInfo(username, password, hobby) |
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.
postSignUp ν¨μλ₯Ό μμ data λ μ΄μ΄λ¨μμ(dataSource, repository) μ±κ³΅ μ 무μ λ°λΌμ saveUserInfo λ₯Ό μ¬κΈ°μ λΆλ₯΄μ§ μκ³ data λ μ΄μ΄λ¨μμ νΈμΆνκ³ μ±κ³΅ μ λ¬΄λ§ μλ©΄ λ κ² κ°μμ SignUpEvent.Success μ userName λ μ¬μ©νμ§ μλ κ² κ°μμμ!
private val loggingInterceptor = HttpLoggingInterceptor().apply { | ||
level = HttpLoggingInterceptor.Level.BODY | ||
} |
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.
νμ bodyλ₯Ό μΆλ ₯νκ² λ ν λ° release λΉλμμλ μΆλ ₯νλ©΄ 보μμ μΈ λ¬Έμ λ IO λμμ΄ λ°λΉ μ§ κ² κ°μμ! μ΄λ»κ² κ°μ νλ©΄ μ’μκΉμ!?
) { | ||
@Serializable | ||
data class Result( | ||
val no: Int? = null, |
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.
Response κ°μ²΄μ νλλ€μ λ€ nullable νκ² λ§λμλ μ΄μ κ° μμκΉμ!?
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.
κ³ μνμ ¨μ΅λλ€!
userRepository = UserRepository(userService, applicationContext) | ||
|
||
setContent { | ||
val isLoggedIn = remember { mutableStateOf(userRepository.isLoggedIn()) } | ||
|
||
ANDANDROIDTheme { | ||
ChangeStatusBarColor() | ||
val navController = rememberNavController() | ||
|
||
navController.addOnDestinationChangedListener { _, _, _ -> | ||
isLoggedIn.value = userRepository.isLoggedIn() | ||
} |
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.
λ‘κ·ΈμΈ μ¬λΆμ λ°λΌμ bottomNav μ¬λΆλ₯Ό κ°μ Έκ° μλ μκ΅°μ! νΉμ νλ©΄μμλ§ BottomNav κ°μ Έκ°λλ‘ νλκ² μ΄λ¨κΉ μΆμ΅λλ€. (κ°μΈμ μΈ μ견μ λλ€!)
@@ -18,4 +18,5 @@ | |||
<string name="no_subscription">νμ¬ λ³΄μ νμ μ΄μ©κΆμ΄ μμ΅λλ€.</string> | |||
<string name="buy_subscription">ꡬ맀νκΈ° ></string> | |||
<string name="user_name_format">%s λ</string> | |||
<string name="user_hobby_format">μ·¨λ―Έ: %s</string> |
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.
4μ£Όμ°¨ κ³Όμ λ μκ³ λ§μΌμ ¨μ΅λλ€ !!
sharedPreferences.edit().apply { | ||
putString(KEY_USER_TOKEN, token) | ||
putBoolean(KEY_IS_LOGGED_IN, true) | ||
apply() |
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.
sharedPreferences.edit()
.putString(KEY_USER_TOKEN, token)
.putBoolean(KEY_IS_LOGGED_IN, true)
.apply()
μ΄λ κ² μ¬μ©ν΄λ λκ³ μλλ©΄,
sharedPreferences.edit {
putString(KEY_USER_TOKEN, token)
putBoolean(KEY_IS_LOGGED_IN, true)
}
μ΄λ κ²λ μ¬μ©ν μ μμ κ² κ°μμ !
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.
μ€νΈ μ΄λ κ²λ μΈ μ μκ΅°μ
onFocusChanged = { isFocused -> | ||
onEmailFocusChanged(isFocused) | ||
onUsernameFocusChanged(isFocused) | ||
}, |
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.
onFocusChanged = onUserNameFocusChanged
μ΄λ κ² μ€μΌ μ μμ κ² κ°μ΅λλ€ !
val hobby = viewModel.hobby.collectAsStateWithLifecycle( | ||
initialValue = "μ·¨λ―Έκ° μμ΅λλ€" | ||
).value |
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.
val hobby = viewModel.hobby.collectAsStateWithLifecycle( | |
initialValue = "μ·¨λ―Έκ° μμ΅λλ€" | |
).value | |
val hobby by viewModel.hobby.collectAsStateWithLifecycle( | |
initialValue = "μ·¨λ―Έκ° μμ΅λλ€" | |
) |
=
λμ by
λ₯Ό μ¬μ©νλ κ²μΌλ‘, λ§μ§λ§μ .value
λ₯Ό λΆμ¬ μ¬μ©νλ κ²κ³Ό λμΌνκ² μ¬μ©ν μ μμ΅λλ€ !
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.
μ΄λ² μ£Όμ°¨ κ³Όμ λ κ³ μνμ
¨μ΅λλ€!
λ§μ΄ λ°°μκ°μ :)
sharedPreferences.edit().apply { | ||
putString(KEY_USER_TOKEN, token) | ||
putBoolean(KEY_IS_LOGGED_IN, true) | ||
apply() |
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.
μ€νΈ μ΄λ κ²λ μΈ μ μκ΅°μ
suspend fun postSignUp(username: String, password: String, hobby: String): Response<ResponseDto> { | ||
val request = RequestSignUpDto(username, password, hobby) | ||
return userService.postSignUp(request) | ||
} |
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.
μ΄λ κ² κ°λ¨νκ² api μμ² μ½λλ₯Ό μμ±ν μ μκ΅°μ! λ°°μκ°λλΉ
@@ -18,4 +18,5 @@ | |||
<string name="no_subscription">νμ¬ λ³΄μ νμ μ΄μ©κΆμ΄ μμ΅λλ€.</string> | |||
<string name="buy_subscription">ꡬ맀νκΈ° ></string> | |||
<string name="user_name_format">%s λ</string> | |||
<string name="user_hobby_format">μ·¨λ―Έ: %s</string> |
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.
κ³ μνμ΄μ! ν©λ μΈλ―Έλλ νμ΄ν μ λλ€
init { | ||
loadHobby() | ||
} |
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.
init λΈλ‘μ μ΄λ€ μμΌλ‘ λμν κΉμ? μ΄λ€ λ‘μ§λ€μ init λΈλμ λ΄κ±°λ, λ΄μ§ μλ κ²μ΄ μ’μκΉμ?
Related issue π
Work Description βοΈ
Screenshot πΈ
Recordingdd.mp4
Uncompleted Tasks π
To Reviewers π’