diff --git a/app/src/main/java/com/teampome/pome/presentation/friend/FriendFragment.kt b/app/src/main/java/com/teampome/pome/presentation/friend/FriendFragment.kt index fb5b2ef..cdaa6fe 100644 --- a/app/src/main/java/com/teampome/pome/presentation/friend/FriendFragment.kt +++ b/app/src/main/java/com/teampome/pome/presentation/friend/FriendFragment.kt @@ -139,7 +139,7 @@ class FriendFragment : BaseFragment(R.layout.fragment_fri //친구 목록 조회 RV private fun setUpRecyclerView(){ - friendGetAdapter = FriendGetAdapter() + friendGetAdapter = FriendGetAdapter(context) binding.friendListRv.apply { // setHasFixedSize(true) layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) diff --git a/app/src/main/java/com/teampome/pome/presentation/friend/FriendGetAdapter.kt b/app/src/main/java/com/teampome/pome/presentation/friend/FriendGetAdapter.kt index 74fe38d..cfa414e 100644 --- a/app/src/main/java/com/teampome/pome/presentation/friend/FriendGetAdapter.kt +++ b/app/src/main/java/com/teampome/pome/presentation/friend/FriendGetAdapter.kt @@ -1,15 +1,19 @@ package com.teampome.pome.presentation.friend +import android.content.Context import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView +import com.bumptech.glide.Glide import com.teampome.pome.databinding.ItemFriendsListBinding import com.teampome.pome.model.response.GetFriends // 친구 탭에서 친구 조회하는 친구 리스트 어댑터 -class FriendGetAdapter : ListAdapter(BookDiffCallback) { +class FriendGetAdapter( + private val context : Context? +) : ListAdapter(BookDiffCallback) { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FriendGetViewHolder { return FriendGetViewHolder( @@ -34,12 +38,20 @@ class FriendGetAdapter : ListAdapter= 3) { + fun bind(getFriends: GetFriends) = with(binding){ + friendAllTv.text = if (getFriends.friendNickName.length >= 3) { "${getFriends.friendNickName.substring(0, 3)}..." } else { getFriends.friendNickName } + friendListProfileIv.clipToOutline = true + + context?.let { context -> + Glide.with(context) + .load(getFriends.imageKey) + .circleCrop() + .into(friendListProfileIv) + } } }