package com.tencent.qcloud.tuikit.tuichat.ui.view.message.viewholder;

import android.view.View;

import androidx.appcompat.widget.AppCompatImageView;

import com.bumptech.glide.Glide;
import com.tencent.qcloud.tuikit.tuichat.R;
import com.tencent.qcloud.tuikit.tuichat.bean.message.ChatGiftMessageBean;
import com.tencent.qcloud.tuikit.tuichat.bean.message.TUIMessageBean;

/**
 * @Description: java类作用描述
 * @Author: lidandan
 * @CreateDate: 2021/12/31 6:39 下午
 */
public class ChatGiftMessageHolder extends MessageContentHolder {

    public ChatGiftMessageHolder(View itemView) {
        super(itemView);
    }

    @Override
    public int getVariableLayout() {
        return R.layout.chat_custom_gift_message_layout;
    }

    @Override
    public void layoutVariableViews(TUIMessageBean msg, int position) {
        AppCompatImageView chatCustomGiftIconIV = itemView.findViewById(R.id.chat_custom_gift_icon_iv);
        String giftUrl = "";
        if (msg instanceof ChatGiftMessageBean) {
            giftUrl = ((ChatGiftMessageBean) msg).getGiftUrl();
            Glide.with(itemView.getContext()).load(giftUrl).into(chatCustomGiftIconIV);
        }
    }
}
