package com.tencent.mm.plugin.appbrand.widget.b;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.widget.b.c.c;
import java.util.LinkedList;

final class c$b extends BaseAdapter {
    private LinkedList<c> jbN;

    public final /* synthetic */ Object getItem(int i) {
        AppMethodBeat.i(102356);
        c qv = qv(i);
        AppMethodBeat.o(102356);
        return qv;
    }

    c$b(LinkedList<c> linkedList) {
        this.jbN = linkedList;
    }

    public final int getCount() {
        AppMethodBeat.i(102353);
        if (this.jbN == null) {
            AppMethodBeat.o(102353);
            return 0;
        }
        int size = this.jbN.size();
        AppMethodBeat.o(102353);
        return size;
    }

    private c qv(int i) {
        AppMethodBeat.i(102354);
        c cVar = (c) this.jbN.get(i);
        AppMethodBeat.o(102354);
        return cVar;
    }

    public final long getItemId(int i) {
        return (long) i;
    }

    public final View getView(int i, View view, ViewGroup viewGroup) {
        AppMethodBeat.i(102355);
        if (this.jbN == null || this.jbN.size() <= 0) {
            AppMethodBeat.o(102355);
            return null;
        }
        a aVar;
        c qv = qv(i);
        if (view == null) {
            a aVar2 = new a((byte) 0);
            view = View.inflate(viewGroup.getContext(), 2130968786, null);
            aVar2.jbR = (ImageView) view.findViewById(2131821546);
            aVar2.jbS = (TextView) view.findViewById(2131821547);
            view.setTag(aVar2);
            aVar = aVar2;
        } else {
            aVar = (a) view.getTag();
        }
        if (qv.state == 1) {
            aVar.jbR.setImageResource(2130839209);
        } else if (qv.state == 3) {
            aVar.jbR.setImageResource(2130839208);
        } else {
            aVar.jbR.setImageResource(2130839207);
        }
        aVar.jbS.setText(qv.desc);
        aVar.jbR.setOnClickListener(new 1(this, qv, aVar.jbR));
        AppMethodBeat.o(102355);
        return view;
    }
}
