MsgViewHolderSystemTips.java 1.51 KB
Newer Older
konghaorui committed
1 2 3 4 5 6
package com.yidianling.im.session.viewholder;

import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

霍志良 committed
7

konghaorui committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomSystemTips;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;

/**
 * @author xj
 * @描述: 后台的系统自定义消息
 * @Copyright Copyright (c) 2019
 * @Company 壹点灵
 * @date 2019/07/17
 */
public class MsgViewHolderSystemTips extends MsgViewHolderBase {

    private TextView tpisTv;

    public MsgViewHolderSystemTips(BaseMultiItemFetchLoadAdapter adapter) {
        super(adapter);
    }

    @Override
    protected int getContentResId() {
konghaorui committed
30
        return R.layout.im_ui_message_custom_system_tips;
konghaorui committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    }

    @Override
    protected void inflateContentView() {
        tpisTv = view.findViewById(R.id.tv_content);
    }

    @Override
    protected void bindContentView() {
        String text = "请下载新版本查看";
        CustomSystemTips customSystemTips= (CustomSystemTips) message.getAttachment();
        if (!TextUtils.isEmpty(customSystemTips.getToContent())
                && customSystemTips.getHiddenApp() != 1
                && customSystemTips.getHiddenApp() != 3){
            tpisTv.setText(text);
        }else {
            tpisTv.setVisibility(View.GONE);
        }

        hideHead();
        hideItemBg();
    }

    @Override
    protected void onItemClick() {
    }
}