package com.tencent.mm.plugin.fav.ui.d;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.bz.a;
import com.tencent.mm.plugin.fav.a.b;
import com.tencent.mm.plugin.fav.a.g;
import com.tencent.mm.plugin.fav.a.y;
import com.tencent.mm.plugin.fav.ui.j;
import com.tencent.mm.plugin.fav.ui.l;
import com.tencent.mm.protocal.protobuf.aar;
import com.tencent.mm.protocal.protobuf.abh;
import java.util.HashSet;
import java.util.LinkedList;

public final class k extends a {
    final int moM;
    private HashSet<Long> mpq = new HashSet();

    public k(l lVar) {
        super(lVar);
        AppMethodBeat.i(74645);
        this.moM = a.al(lVar.context, 2131427657);
        AppMethodBeat.o(74645);
    }

    public final View a(View view, ViewGroup viewGroup, g gVar) {
        a aVar;
        AppMethodBeat.i(74646);
        Context context = viewGroup.getContext();
        if (view == null) {
            aVar = new a();
            view = a(View.inflate(context, 2130969513, null), aVar, gVar);
            aVar.moN = (ImageView) view.findViewById(2131823917);
            aVar.mps = (TextView) view.findViewById(2131823925);
        } else {
            aVar = (a) view.getTag();
        }
        LinkedList linkedList = gVar.field_favProto.wiv;
        if (linkedList.size() > 0) {
            int i = ((aar) linkedList.getFirst()).duration;
            aVar.mps.setText(j.B(context, i));
            if (!(gVar == null || i > 1 || this.mpq.contains(Long.valueOf(gVar.field_localId)))) {
                this.mpq.add(Long.valueOf(gVar.field_localId));
                com.tencent.mm.kernel.g.RS().aa(new 1(this, gVar));
            }
            aVar.mps.setVisibility(0);
        } else {
            aVar.mps.setVisibility(8);
        }
        a(aVar, gVar);
        this.mhy.a(aVar.moN, b.c(gVar), gVar, 2131230817, this.moM, this.moM);
        AppMethodBeat.o(74646);
        return view;
    }

    public final void a(View view, abh abh) {
        AppMethodBeat.i(74647);
        a aVar = (a) view.getTag();
        ((y) com.tencent.mm.kernel.g.K(y.class)).a(view.getContext(), aVar.mgf, abh);
        AppMethodBeat.o(74647);
    }
}
