fix(character): 캐릭터 이미지 RoundedCorner 16dp 적용
This commit is contained in:
		@@ -1,14 +1,13 @@
 | 
			
		||||
package kr.co.vividnext.sodalive.chat.character
 | 
			
		||||
 | 
			
		||||
import android.annotation.SuppressLint
 | 
			
		||||
import android.content.Context
 | 
			
		||||
import android.view.LayoutInflater
 | 
			
		||||
import android.view.View
 | 
			
		||||
import android.view.ViewGroup
 | 
			
		||||
import androidx.recyclerview.widget.RecyclerView
 | 
			
		||||
import com.bumptech.glide.Glide
 | 
			
		||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
 | 
			
		||||
import com.bumptech.glide.request.RequestOptions
 | 
			
		||||
import coil.load
 | 
			
		||||
import coil.transform.RoundedCornersTransformation
 | 
			
		||||
import kr.co.vividnext.sodalive.R
 | 
			
		||||
import kr.co.vividnext.sodalive.databinding.ItemCharacterBinding
 | 
			
		||||
import kr.co.vividnext.sodalive.extensions.dpToPx
 | 
			
		||||
 | 
			
		||||
@@ -19,7 +18,6 @@ class CharacterAdapter(
 | 
			
		||||
) : RecyclerView.Adapter<CharacterAdapter.ViewHolder>() {
 | 
			
		||||
 | 
			
		||||
    inner class ViewHolder(
 | 
			
		||||
        private val context: Context,
 | 
			
		||||
        private val binding: ItemCharacterBinding
 | 
			
		||||
    ) : RecyclerView.ViewHolder(binding.root) {
 | 
			
		||||
        @SuppressLint("SetTextI18n")
 | 
			
		||||
@@ -35,23 +33,18 @@ class CharacterAdapter(
 | 
			
		||||
                binding.llRanking.visibility = View.GONE
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Glide.with(context)
 | 
			
		||||
                .load(character.imageUrl)
 | 
			
		||||
                .apply(
 | 
			
		||||
                    RequestOptions().transform(
 | 
			
		||||
                        RoundedCorners(
 | 
			
		||||
                            16f.dpToPx().toInt()
 | 
			
		||||
                        )
 | 
			
		||||
                    )
 | 
			
		||||
                )
 | 
			
		||||
                .into(binding.ivCharacter)
 | 
			
		||||
            binding.ivCharacter.clipToOutline = true
 | 
			
		||||
            binding.ivCharacter.load(character.imageUrl) {
 | 
			
		||||
                crossfade(true)
 | 
			
		||||
                placeholder(R.drawable.ic_logo_service_center)
 | 
			
		||||
                transformations(RoundedCornersTransformation(16f.dpToPx()))
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            binding.root.setOnClickListener { onCharacterClick(character.characterId) }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
 | 
			
		||||
        parent.context,
 | 
			
		||||
        ItemCharacterBinding.inflate(
 | 
			
		||||
            LayoutInflater.from(parent.context),
 | 
			
		||||
            parent,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user