Skip to content

Commit

Permalink
[feat] : #15 ViewHolder Context -> itemView.context Modify
Browse files Browse the repository at this point in the history
  • Loading branch information
SsongSik committed Jun 18, 2023
1 parent 749a132 commit 44c7018
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class FriendFragment : BaseFragment<FragmentFriendBinding>(R.layout.fragment_fri

//친구 기록 조회 RV
private fun friendRecordSetUpRecyclerView(){
friendRecordGetAdapter = FriendRecordGetAdapter(this, context)
friendRecordGetAdapter = FriendRecordGetAdapter(this)
binding.friendDetailRv.apply {
// setHasFixedSize(true)
layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.teampome.pome.model.response.GetFriends
//친구 기록 조회
class FriendRecordGetAdapter(
private val clickListener: FriendDetailRecordClickListener,
private val context : Context?
) : ListAdapter<GetFriendRecord, FriendRecordGetAdapter.FriendGetRecordViewHolder>(BookDiffCallback) {

private val friendsMap: HashMap<String, GetFriends> = HashMap()
Expand Down Expand Up @@ -73,7 +72,7 @@ class FriendRecordGetAdapter(
}

if(getFriedRecord.emotionResponse.myEmotion == null) {
context?.let{ context ->
itemView.context?.let{ context ->
Glide.with(context).load(R.drawable.emoji_mint_28).into(friendDetailCardFirstFriendEmotionAiv)
}
}
Expand All @@ -90,11 +89,11 @@ class FriendRecordGetAdapter(
friendEmojiRegisterCl.layoutParams = params
}

val friend = friendsMap[getFriedRecord.nickname]
val friends = friendsMap[getFriedRecord.nickname]

friend?.let {
friends?.let { friend ->
Glide.with(itemView.context)
.load(it.imageKey)
.load(friend.imageKey)
.circleCrop()
.into(friendDetailProfileIv)
}
Expand Down

0 comments on commit 44c7018

Please sign in to comment.