@@ -11,75 +11,76 @@ class SavedFeedViewModel: ViewModel() {
1111 listOf (
1212 FeedItem (
1313 id = 1 ,
14- user_profile_image = R .drawable.character_art,
15- user_name = " user" ,
16- user_role = " 학생" ,
17- book_title = " 라랄ㄹ라라" ,
18- auth_name = " 야야야" ,
19- time_ago = 15 ,
14+ userProfileImage = R .drawable.character_art,
15+ userName = " user" ,
16+ userRole = " 학생" ,
17+ bookTitle = " 라랄ㄹ라라" ,
18+ authName = " 야야야" ,
19+ timeAgo = 15 ,
2020 content = " 진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공" ,
21- like_count = 25 ,
22- comment_count = 4 ,
23- is_liked = false ,
24- is_saved = true
21+ likeCount = 25 ,
22+ commentCount = 4 ,
23+ isLiked = false ,
24+ isSaved = true
2525 ),
2626 FeedItem (
2727 id = 2 ,
28- user_profile_image = R .drawable.character_art,
29- user_name = " user" ,
30- user_role = " 학생" ,
31- book_title = " 라랄ㄹ라라" ,
32- auth_name = " 야야야" ,
33- time_ago = 15 ,
34- content = " 진짜최공진짜최공진차최공 " ,
35- like_count = 25 ,
36- comment_count = 4 ,
37- is_liked = false ,
38- is_saved = true ,
28+ userProfileImage = R .drawable.character_art,
29+ userName = " user" ,
30+ userRole = " 학생" ,
31+ bookTitle = " 라랄ㄹ라라" ,
32+ authName = " 야야야" ,
33+ timeAgo = 15 ,
34+ content = " 너무 재밌네요.. " ,
35+ likeCount = 25 ,
36+ commentCount = 4 ,
37+ isLiked = false ,
38+ isSaved = true ,
3939 imageUrl = R .drawable.bookcover_sample
4040 ),
4141 FeedItem (
4242 id = 3 ,
43- user_profile_image = R .drawable.character_art,
44- user_name = " user" ,
45- user_role = " 학생" ,
46- book_title = " 라랄ㄹ라라" ,
47- auth_name = " 야야야" ,
48- time_ago = 15 ,
49- content = " 진짜최공진짜최공진차최공" ,
50- like_count = 25 ,
51- comment_count = 4 ,
52- is_liked = false ,
53- is_saved = true
43+ userProfileImage = R .drawable.character_art,
44+ userName = " user" ,
45+ userRole = " 학생" ,
46+ bookTitle = " 라랄ㄹ라라" ,
47+ authName = " 야야야" ,
48+ timeAgo = 15 ,
49+ content = " 너무 재밌네요.." ,
50+ likeCount = 25 ,
51+ commentCount = 4 ,
52+ isLiked = false ,
53+ isSaved = true ,
54+ imageUrl = R .drawable.bookcover_sample
5455 ),
5556 FeedItem (
5657 id = 4 ,
57- user_profile_image = R .drawable.character_literature ,
58- user_name = " user" ,
59- user_role = " 학생" ,
60- book_title = " 라랄ㄹ라라 " ,
61- auth_name = " 야야야 " ,
62- time_ago = 15 ,
58+ userProfileImage = R .drawable.character_art ,
59+ userName = " user" ,
60+ userRole = " 학생" ,
61+ bookTitle = " 책이름책이름 " ,
62+ authName = " 저자이름저자이름 " ,
63+ timeAgo = 25 ,
6364 content = " 진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공" ,
64- like_count = 25 ,
65- comment_count = 4 ,
66- is_liked = false ,
67- is_saved = true
65+ likeCount = 25 ,
66+ commentCount = 4 ,
67+ isLiked = false ,
68+ isSaved = true ,
69+ imageUrl = R .drawable.bookcover_sample
6870 ),
6971 FeedItem (
7072 id = 5 ,
71- user_profile_image = R .drawable.character_sociology,
72- user_name = " user" ,
73- user_role = " 학생" ,
74- book_title = " 라랄ㄹ라라" ,
75- auth_name = " 야야야" ,
76- time_ago = 15 ,
77- content = " 진짜최공진짜최공진차최공" ,
78- like_count = 25 ,
79- comment_count = 4 ,
80- is_liked = false ,
81- is_saved = true ,
82- imageUrl = R .drawable.bookcover_sample
73+ userProfileImage = R .drawable.character_art,
74+ userName = " user" ,
75+ userRole = " 학생" ,
76+ bookTitle = " 책이름책이름" ,
77+ authName = " 저자이름저자이름" ,
78+ timeAgo = 25 ,
79+ content = " 진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공진짜최공진짜최공진차최공" ,
80+ likeCount = 25 ,
81+ commentCount = 4 ,
82+ isLiked = true ,
83+ isSaved = true
8384 ),
8485
8586
@@ -89,13 +90,13 @@ class SavedFeedViewModel: ViewModel() {
8990
9091 fun toggleBookmark (id : Int ) {
9192 _feeds .value = _feeds .value.map {
92- if (it.id == id) it.copy(is_saved = ! it.is_saved ) else it
93+ if (it.id == id) it.copy(isSaved = ! it.isSaved ) else it
9394 }
9495 }
9596
9697 fun toggleLike (id : Int ) {
9798 _feeds .value = _feeds .value.map {
98- if (it.id == id) it.copy(is_liked = ! it.is_liked ) else it
99+ if (it.id == id) it.copy(isLiked = ! it.isLiked ) else it
99100 }
100101 }
101102}
0 commit comments