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

import android.content.Context;
import android.text.SpannableString;
import android.view.View;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.bz.a;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.fav.a.y;
import com.tencent.mm.plugin.fav.ui.l;
import com.tencent.mm.protocal.protobuf.aar;
import com.tencent.mm.protocal.protobuf.aay;
import com.tencent.mm.protocal.protobuf.abh;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.ttpic.baseutils.ApiHelper$VERSION_CODES;
import java.util.HashMap;

public final class j extends a {
    private final int moM;
    private HashMap<String, SpannableString> mpj = new HashMap();

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

    public final android.view.View a(android.view.View r13, android.view.ViewGroup r14, com.tencent.mm.plugin.fav.a.g r15) {
        /*
        r12 = this;
        r0 = 74640; // 0x12390 float:1.04593E-40 double:3.6877E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r0);
        r0 = r14.getContext();
        if (r13 != 0) goto L_0x00a0;
    L_0x000c:
        r1 = new com.tencent.mm.plugin.fav.ui.d.j$a;
        r1.<init>();
        r2 = 2130969512; // 0x7f0403a8 float:1.7547708E38 double:1.052838828E-314;
        r3 = 0;
        r0 = android.view.View.inflate(r0, r2, r3);
        r13 = r12.a(r0, r1, r15);
        r0 = 2131821479; // 0x7f1103a7 float:1.9275702E38 double:1.053259756E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.ImageView) r0;
        r1.iqT = r0;
        r0 = 2131823921; // 0x7f110d31 float:1.9280655E38 double:1.0532609623E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.TextView) r0;
        r1.mpl = r0;
        r0 = 2131823922; // 0x7f110d32 float:1.9280657E38 double:1.053260963E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.TextView) r0;
        r1.mpm = r0;
        r0 = 2131823923; // 0x7f110d33 float:1.928066E38 double:1.0532609633E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.TextView) r0;
        r1.mpn = r0;
        r0 = 2131823924; // 0x7f110d34 float:1.9280661E38 double:1.053260964E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.TextView) r0;
        r1.mpo = r0;
        r0 = 2131823919; // 0x7f110d2f float:1.9280651E38 double:1.0532609614E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.ImageView) r0;
        r1.moY = r0;
        r0 = 2131823920; // 0x7f110d30 float:1.9280653E38 double:1.053260962E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.ImageView) r0;
        r1.mpk = r0;
        r0 = 2131823918; // 0x7f110d2e float:1.928065E38 double:1.053260961E-314;
        r0 = r13.findViewById(r0);
        r0 = (android.widget.FrameLayout) r0;
        r1.mpp = r0;
        r8 = r1;
    L_0x0076:
        r12.a(r8, r15);
        r5 = 0;
        r4 = 0;
        r3 = 0;
        r2 = 0;
        r0 = 0;
        r1 = r15.field_favProto;
        r10 = r1.wiv;
        r6 = r10.iterator();
        r1 = r0;
        r9 = r5;
    L_0x0088:
        r0 = r6.hasNext();
        if (r0 == 0) goto L_0x00b5;
    L_0x008e:
        r0 = r6.next();
        r0 = (com.tencent.mm.protocal.protobuf.aar) r0;
        r0 = r0.dataType;
        switch(r0) {
            case 1: goto L_0x00af;
            case 2: goto L_0x00a8;
            case 3: goto L_0x00af;
            case 4: goto L_0x00a8;
            case 5: goto L_0x00af;
            case 6: goto L_0x00af;
            case 7: goto L_0x00af;
            case 8: goto L_0x00af;
            case 9: goto L_0x0099;
            case 10: goto L_0x00af;
            case 11: goto L_0x00af;
            case 12: goto L_0x0099;
            case 13: goto L_0x0099;
            case 14: goto L_0x00af;
            case 15: goto L_0x00a8;
            case 16: goto L_0x00af;
            case 17: goto L_0x00af;
            default: goto L_0x0099;
        };
    L_0x0099:
        r0 = r1;
        r5 = r9;
    L_0x009b:
        r3 = r3 + 1;
        r1 = r0;
        r9 = r5;
        goto L_0x0088;
    L_0x00a0:
        r0 = r13.getTag();
        r0 = (com.tencent.mm.plugin.fav.ui.d.j.a) r0;
        r8 = r0;
        goto L_0x0076;
    L_0x00a8:
        if (r2 != 0) goto L_0x0099;
    L_0x00aa:
        r2 = 1;
        r0 = r1;
        r4 = r3;
        r5 = r9;
        goto L_0x009b;
    L_0x00af:
        if (r1 != 0) goto L_0x0099;
    L_0x00b1:
        r1 = 1;
        r0 = r1;
        r5 = r3;
        goto L_0x009b;
    L_0x00b5:
        r0 = "MicroMsg.FavRecordListItem";
        r1 = "hasThumb %s, firstRemarkIndex %d";
        r3 = 2;
        r3 = new java.lang.Object[r3];
        r5 = 0;
        r6 = java.lang.Boolean.valueOf(r2);
        r3[r5] = r6;
        r5 = 1;
        r6 = java.lang.Integer.valueOf(r9);
        r3[r5] = r6;
        com.tencent.mm.sdk.platformtools.ab.d(r0, r1, r3);
        r0 = r10.size();
        if (r0 > 0) goto L_0x00e5;
    L_0x00d5:
        r0 = "MicroMsg.FavRecordListItem";
        r1 = "dataList size is null";
        com.tencent.mm.sdk.platformtools.ab.w(r0, r1);
        r0 = 74640; // 0x12390 float:1.04593E-40 double:3.6877E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r0);
    L_0x00e4:
        return r13;
    L_0x00e5:
        r0 = r10.get(r9);
        r0 = (com.tencent.mm.protocal.protobuf.aar) r0;
        r1 = r8.mpl;
        r3 = r8.mpm;
        a(r1, r3, r0);
        if (r2 == 0) goto L_0x01a9;
    L_0x00f4:
        r0 = r8.mpp;
        r1 = 0;
        r0.setVisibility(r1);
        r0 = r8.iqT;
        r1 = 0;
        r0.setVisibility(r1);
        r1 = r8.iqT;
        r0 = r10.get(r4);
        r7 = r0;
        r7 = (com.tencent.mm.protocal.protobuf.aar) r7;
        r0 = r7.dataType;
        switch(r0) {
            case 2: goto L_0x0138;
            case 4: goto L_0x0199;
            case 15: goto L_0x0199;
            default: goto L_0x010e;
        };
    L_0x010e:
        r0 = r9 + 1;
        r1 = r10.size();
        if (r0 >= r1) goto L_0x01b9;
    L_0x0116:
        r0 = r8.mpn;
        r1 = 0;
        r0.setVisibility(r1);
        r0 = r8.mpo;
        r1 = 0;
        r0.setVisibility(r1);
        r1 = r8.mpn;
        r2 = r8.mpo;
        r0 = r9 + 1;
        r0 = r10.get(r0);
        r0 = (com.tencent.mm.protocal.protobuf.aar) r0;
        a(r1, r2, r0);
    L_0x0131:
        r0 = 74640; // 0x12390 float:1.04593E-40 double:3.6877E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r0);
        goto L_0x00e4;
    L_0x0138:
        r11 = r12.mhy;
        r5 = r12.moM;
        r6 = r12.moM;
        if (r1 == 0) goto L_0x010e;
    L_0x0140:
        r0 = com.tencent.mm.compatible.util.f.Mn();
        if (r0 != 0) goto L_0x014d;
    L_0x0146:
        r0 = 2130839707; // 0x7f02089b float:1.7284432E38 double:1.052774696E-314;
        r1.setImageResource(r0);
        goto L_0x010e;
    L_0x014d:
        if (r7 == 0) goto L_0x010e;
    L_0x014f:
        if (r15 == 0) goto L_0x010e;
    L_0x0151:
        r3 = r7.mnd;
        if (r3 == 0) goto L_0x010e;
    L_0x0155:
        r2 = 0;
        r0 = r7.mnd;
        if (r0 == 0) goto L_0x017a;
    L_0x015a:
        r0 = r11.mkn;
        r0 = r0.get(r3);
        r0 = (java.lang.String[]) r0;
        if (r0 != 0) goto L_0x01c9;
    L_0x0164:
        r0 = 2;
        r2 = new java.lang.String[r0];
        r0 = 0;
        r4 = com.tencent.mm.plugin.fav.a.b.b(r7);
        r2[r0] = r4;
        r0 = 1;
        r4 = com.tencent.mm.plugin.fav.a.b.c(r7);
        r2[r0] = r4;
        r0 = r11.mkn;
        r0.put(r3, r2);
    L_0x017a:
        r0 = r11.mkm;
        r3 = 0;
        r4 = 2131231864; // 0x7f080478 float:1.8079821E38 double:1.0529684473E-314;
        r0.a(r1, r2, r3, r4, r5, r6);
        if (r2 == 0) goto L_0x010e;
    L_0x0185:
        r0 = r2.length;
        if (r0 <= 0) goto L_0x010e;
    L_0x0188:
        r0 = 0;
        r0 = r2[r0];
        r1 = com.tencent.mm.kernel.g.RS();
        r2 = new com.tencent.mm.plugin.fav.ui.l$2;
        r2.<init>(r11, r0, r15, r7);
        r1.aa(r2);
        goto L_0x010e;
    L_0x0199:
        r0 = r12.mhy;
        r4 = 2131230817; // 0x7f080061 float:1.8077697E38 double:1.05296793E-314;
        r5 = r12.moM;
        r6 = r12.moM;
        r2 = r7;
        r3 = r15;
        r0.b(r1, r2, r3, r4, r5, r6);
        goto L_0x010e;
    L_0x01a9:
        r0 = r8.mpp;
        r1 = 8;
        r0.setVisibility(r1);
        r0 = r8.iqT;
        r1 = 8;
        r0.setVisibility(r1);
        goto L_0x010e;
    L_0x01b9:
        r0 = r8.mpn;
        r1 = 8;
        r0.setVisibility(r1);
        r0 = r8.mpo;
        r1 = 8;
        r0.setVisibility(r1);
        goto L_0x0131;
    L_0x01c9:
        r2 = r0;
        goto L_0x017a;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.fav.ui.d.j.a(android.view.View, android.view.ViewGroup, com.tencent.mm.plugin.fav.a.g):android.view.View");
    }

    private static void a(TextView textView, TextView textView2, aar aar) {
        AppMethodBeat.i(74641);
        if (aar.wgW) {
            textView.setVisibility(0);
            textView.setText(com.tencent.mm.pluginsdk.ui.e.j.b(textView.getContext(), aar.wgV, textView.getTextSize()));
        } else {
            ab.d("MicroMsg.FavRecordListItem", "has no datasrcname");
            textView.setVisibility(8);
        }
        ab.d("MicroMsg.FavRecordListItem", "field type %d", new Object[]{Integer.valueOf(aar.dataType)});
        switch (aar.dataType) {
            case 1:
                textView2.setText(com.tencent.mm.pluginsdk.ui.e.j.b(textView2.getContext(), aar.desc, textView2.getTextSize()));
                AppMethodBeat.o(74641);
                return;
            case 2:
                textView2.setText(L(textView2.getContext(), 2131299740));
                AppMethodBeat.o(74641);
                return;
            case 3:
                textView2.setText(L(textView2.getContext(), 2131299748));
                AppMethodBeat.o(74641);
                return;
            case 4:
                textView2.setText(L(textView2.getContext(), 2131299747));
                AppMethodBeat.o(74641);
                return;
            case 5:
                textView2.setText(L(textView2.getContext(), 2131299746) + aar.title);
                AppMethodBeat.o(74641);
                return;
            case 6:
                String str;
                aay aay = aar.wgT.why;
                StringBuilder append = new StringBuilder().append(L(textView2.getContext(), 2131299742));
                if (bo.isNullOrNil(aay.cIK)) {
                    str = aay.label;
                } else {
                    str = aay.cIK;
                }
                textView2.setText(append.append(str).toString());
                AppMethodBeat.o(74641);
                return;
            case 7:
                textView2.setText(L(textView2.getContext(), 2131299743) + aar.title);
                AppMethodBeat.o(74641);
                return;
            case 8:
                textView2.setText(L(textView2.getContext(), 2131299739) + aar.title);
                AppMethodBeat.o(74641);
                return;
            case 10:
                textView2.setText(L(textView2.getContext(), 2131299663) + aar.wgT.whC.title);
                AppMethodBeat.o(74641);
                return;
            case ApiHelper$VERSION_CODES.ICE_CREAM_SANDWICH_MR1 /*15*/:
                textView2.setText(L(textView2.getContext(), 2131299735));
                AppMethodBeat.o(74641);
                return;
            case ApiHelper$VERSION_CODES.JELLY_BEAN /*16*/:
                textView2.setText(L(textView2.getContext(), 2131299644));
                AppMethodBeat.o(74641);
                return;
            case ApiHelper$VERSION_CODES.JELLY_BEAN_MR1 /*17*/:
                textView2.setText(L(textView2.getContext(), 2131299745));
                AppMethodBeat.o(74641);
                return;
            case ApiHelper$VERSION_CODES.KITKAT /*19*/:
                textView2.setText(L(textView2.getContext(), 2131299737) + aar.title);
                break;
        }
        AppMethodBeat.o(74641);
    }

    private static String L(Context context, int i) {
        AppMethodBeat.i(74642);
        String str = "[" + context.getResources().getString(i) + "]";
        AppMethodBeat.o(74642);
        return str;
    }

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