package com.daya.live_teaching.im.provider;

import android.widget.LinearLayout;

import com.daya.live_teaching.R;

import java.util.List;

import io.rong.imkit.conversation.messgelist.provider.FileMessageItemProvider;
import io.rong.imkit.conversation.messgelist.provider.MessageItemProviderConfig;
import io.rong.imkit.model.UiMessage;
import io.rong.imkit.widget.adapter.IViewProviderListener;
import io.rong.imkit.widget.adapter.ViewHolder;
import io.rong.message.FileMessage;


/**
 * 自定义文件消息样式
 * 修改了背景图
 */
public class ClassFileMessageItemProvider extends FileMessageItemProvider {


    protected MessageItemProviderConfig mConfig = new MessageItemProviderConfig();

    public ClassFileMessageItemProvider() {
        mConfig.showProgress = false;
        mConfig.showReadState = true;
    }

    @Override
    protected void bindMessageContentViewHolder(ViewHolder holder, ViewHolder parentHolder, FileMessage fileMessage, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
        super.bindMessageContentViewHolder(holder, parentHolder, fileMessage, uiMessage, position, list, listener);

        LinearLayout msgContainer = holder.getView(io.rong.imkit.R.id.rc_message);
        msgContainer.setBackgroundResource(R.drawable.bg_conversation_item_message);
    }


}
