CustomDialogViewHolder.java 839 Bytes
Newer Older
konghaorui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package com.yidianling.avchatkit.common.dialog;

import android.util.Pair;
import android.widget.TextView;

import com.yidianling.im.R;
import com.yidianling.avchatkit.common.adapter.TViewHolder;


public class CustomDialogViewHolder extends TViewHolder {

    private TextView itemView;

    @Override
    protected int getResId() {
konghaorui committed
16
        return R.layout.im_nim_custom_dialog_list_item;
konghaorui committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
    }

    @Override
    protected void inflate() {
        itemView = (TextView) view.findViewById(R.id.custom_dialog_text_view);
    }

    @Override
    protected void refresh(Object item) {
        if (item instanceof Pair<?, ?>) {
            Pair<String, Integer> pair = (Pair<String, Integer>) item;
            itemView.setText(pair.first);
            itemView.setTextColor(context.getResources().getColor(pair.second));
        }
    }

}