-
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
2주차 과제 #5
2주차 과제 #5
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.
제겐 아직 너무 상위 코드인.. 역시 갓상욱,,, 많이 공유해주세오
FriendInfoEntity::class | ||
], version = 1 | ||
) | ||
abstract class FriendDataBase : RoomDatabase() { |
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.
저는 한번도 직접 구현하는 코드에서 abstract를 사용해본 경험이 없는데.. 많이 배워가요..!
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.
저도 room 이번에 한번 공부해봐야겠어요..!
val id: Int?, | ||
val name: String, | ||
val birthday: String, | ||
val music: 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.
오 생일과 뮤직도 구현하셨네요 ㅎㅎ 저는 시험 이슈로 안 했는데 저도 이제 슬슬 구현해보겠어유
@ColumnInfo(name = "image_uri") | ||
val imageUri: String?, | ||
) { | ||
companion object { |
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.
companion object 개념을 처음 봐요. 정적 멤버를 정의할 때 사용하는거군여..? 또 하나 알아가요!
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.
오호 companion object 메모메모 합니다
@@ -4,5 +4,5 @@ data class User( | |||
val id: String? = "", | |||
val pw: String? = "", | |||
val nickname: String? = "", | |||
val hobby: String? = "" | |||
val discription: 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.
아니 진짜........말안되는데..........? 미쳤다 진짜
import org.sopt.dosopttemplate.data.model.local.FriendInfoEntity | ||
|
||
@Dao | ||
interface FriendInfoDao { |
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.
Room 쓰는거 폼 진짜 말안되네 이남자... .....
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.
Room? 당장 구글링 해봐야겠다.
when(item.itemId) { | ||
R.id.menu_do_android -> navigateTo<DoAndroidFragment>() | ||
R.id.menu_home -> navigateTo<HomeFragment>() | ||
R.id.menu_my_page -> navigateTo<MyPageFragment>() | ||
} | ||
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.
이 코드로는 어떠한 item이 와도 무조건 true를 반환할 것 같습니다 !
else를 활용해서 item값이 이상하게 왔을 때 false로 넘어가도록 처리가 필요할 것 같아요 ~~
}.onSuccess { | ||
_logoutState.value = UiState.Success(CODE_LOGOUT) | ||
}.onFailure { t -> | ||
_logoutState.value = UiState.Failure("${t.message}") |
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.
t.message.toString() 은 어떠신지 !
import java.time.LocalDate | ||
|
||
sealed class HomeModel { | ||
abstract val id: Int? |
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.
와 이거 두면 ListAdapter new old 비교 되겠네요...
와비로서 몰랐던 구현 기능들 많이 배워갑니다 ㅎㅎ 상호오라버니의 리뷰까지 참고해서 |
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.
고생하셨슴다 👍
FriendInfoEntity::class | ||
], version = 1 | ||
) | ||
abstract class FriendDataBase : RoomDatabase() { |
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.
저도 room 이번에 한번 공부해봐야겠어요..!
private fun initBnvItemSelectedListener() { | ||
binding.bnvMain.setOnItemSelectedListener { item -> | ||
when(item.itemId) { | ||
R.id.menu_do_android -> navigateTo<DoAndroidFragment>() |
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.friendListState.observe(viewLifecycleOwner) { state -> | ||
when (state) { | ||
is UiState.Success -> { | ||
submitHomeList(state) |
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.
데이터를 불러올 때도 state별로 나눠서 보여주니까 훨씬 좋은 것 같네요 ! UiState를 능수능란하게 다루시는군요,, 많이 배우고 갑니다
📌𝘐𝘴𝘴𝘶𝘦𝘴
#4
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
device-2023-10-27-145558.webm
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
room db를 활용했습니다.