package com.ss.android.ugc.aweme.shoutouts.review.cell;

import X.0HH;
import X.2ha;
import X.2tE;
import X.78T;
import X.AnonymousClass9w1;
import X.BTA;
import X.C2753AxR;
import X.C2756AxU;
import X.C2757AxV;
import X.C2758AxW;
import X.C2763Axb;
import X.DaP;
import X.EdN;
import X.F5u;
import X.M12;
import X.Oej;
import X.PMk;
import X.PMp;
import X.QHW;
import X.QJt;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import kotlin.h.b.n;

public final class ShoutoutReviewsCell extends PowerCell<C2756AxU> implements View.OnClickListener {
    public static final /* synthetic */ PMp[] LIZ = {new PMk(ShoutoutReviewsCell.class, "reviewControl", "getReviewControl()Lcom/ss/android/ugc/aweme/shoutouts/review/controller/IShoutoutReviewControl;", 0)};
    public static final C2763Axb LIZIZ = new C2763Axb((byte) 0);
    public TextView LJIIIZ;
    public TextView LJIIJ;
    public TextView LJIIJJI;
    public EdN LJIIL;
    public Oej LJIILIIL;
    public final 78T LJIILJJIL = new C2758AxW(this);

    public final C2753AxR LIZ() {
        return (C2753AxR) this.LJIILJJIL.LIZ(this, LIZ[0]);
    }

    static {
        Covode.recordClassIndex(114310);
    }

    public final void bD_() {
        ShoutoutReviewsCell.super.bD_();
        this.itemView.setOnLongClickListener(new C2757AxV(this));
        TextView textView = this.LJIIIZ;
        if (textView == null) {
            n.LIZ("");
        }
        textView.setOnClickListener(this);
        EdN edN = this.LJIIL;
        if (edN == null) {
            n.LIZ("");
        }
        edN.setOnClickListener(this);
    }

    public final View LIZ(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        View LIZ2 = 0HH.LIZ(LayoutInflater.from(viewGroup.getContext()), 2131561340, viewGroup, false);
        View findViewById = LIZ2.findViewById(2131372461);
        n.LIZIZ(findViewById, "");
        this.LJIIIZ = (TextView) findViewById;
        View findViewById2 = LIZ2.findViewById(2131371868);
        n.LIZIZ(findViewById2, "");
        this.LJIIJ = (TextView) findViewById2;
        View findViewById3 = LIZ2.findViewById(2131371865);
        n.LIZIZ(findViewById3, "");
        this.LJIIJJI = (TextView) findViewById3;
        EdN findViewById4 = LIZ2.findViewById(2131366704);
        n.LIZIZ(findViewById4, "");
        this.LJIIL = findViewById4;
        Oej findViewById5 = LIZ2.findViewById(2131369264);
        n.LIZIZ(findViewById5, "");
        this.LJIILIIL = findViewById5;
        n.LIZIZ(LIZ2, "");
        return LIZ2;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:17:0x002e, code lost:
        if (r1 == null) goto L_0x0030;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:0x0030, code lost:
        kotlin.h.b.n.LIZIZ();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:30:0x006b, code lost:
        r1 = null;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onClick(android.view.View r5) {
        /*
            r4 = this;
            if (r5 == 0) goto L_0x005d
            android.widget.TextView r0 = r4.LJIIIZ
            java.lang.String r2 = ""
            if (r0 != 0) goto L_0x000b
            kotlin.h.b.n.LIZ(r2)
        L_0x000b:
            boolean r0 = kotlin.h.b.n.LIZ(r5, r0)
            if (r0 != 0) goto L_0x001e
            X.EdN r0 = r4.LJIIL
            if (r0 != 0) goto L_0x0018
            kotlin.h.b.n.LIZ(r2)
        L_0x0018:
            boolean r0 = kotlin.h.b.n.LIZ(r5, r0)
            if (r0 == 0) goto L_0x005d
        L_0x001e:
            android.content.Context r1 = r5.getContext()
            kotlin.h.b.n.LIZIZ(r1, r2)
        L_0x0025:
            r3 = 0
            if (r1 == 0) goto L_0x006b
            boolean r0 = r1 instanceof android.app.Activity
            if (r0 == 0) goto L_0x0060
            android.app.Activity r1 = (android.app.Activity) r1
            if (r1 != 0) goto L_0x0033
        L_0x0030:
            kotlin.h.b.n.LIZIZ()
        L_0x0033:
            java.lang.String r0 = "aweme://user/profile/"
            com.bytedance.router.SmartRoute r2 = com.bytedance.router.SmartRouter.buildRoute(r1, r0)
            X.DaP r0 = r4.LIZLLL
            X.AxU r0 = (X.C2756AxU) r0
            if (r0 == 0) goto L_0x005e
            java.lang.String r1 = r0.LJFF
        L_0x0041:
            java.lang.String r0 = "uid"
            r2.withParam(r0, r1)
            java.lang.String r1 = "extra_from_pre_page"
            java.lang.String r0 = "notification_page"
            r2.withParam(r1, r0)
            X.DaP r0 = r4.LIZLLL
            X.AxU r0 = (X.C2756AxU) r0
            if (r0 == 0) goto L_0x0055
            java.lang.String r3 = r0.LJI
        L_0x0055:
            java.lang.String r0 = "sec_uid"
            r2.withParam(r0, r3)
            r2.open()
        L_0x005d:
            return
        L_0x005e:
            r1 = r3
            goto L_0x0041
        L_0x0060:
            boolean r0 = r1 instanceof android.content.ContextWrapper
            if (r0 == 0) goto L_0x006b
            android.content.ContextWrapper r1 = (android.content.ContextWrapper) r1
            android.content.Context r1 = r1.getBaseContext()
            goto L_0x0025
        L_0x006b:
            r1 = r3
            goto L_0x0030
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.shoutouts.review.cell.ShoutoutReviewsCell.onClick(android.view.View):void");
    }

    public final /* synthetic */ void LIZ(DaP daP) {
        String str;
        String str2;
        Long LJI;
        C2756AxU axU = (C2756AxU) daP;
        M12.LIZ(axU);
        String str3 = axU.LIZLLL;
        if (!(str3 == null || (LJI = 2tE.LJI(str3)) == null)) {
            TextView textView = this.LJIIJ;
            if (textView == null) {
                n.LIZ("");
            }
            View view = this.itemView;
            n.LIZIZ(view, "");
            textView.setText(F5u.LIZ(view.getContext(), LJI.longValue() * 1000));
        }
        TextView textView2 = this.LJIIIZ;
        if (textView2 == null) {
            n.LIZ("");
        }
        textView2.setText(axU.LIZIZ);
        C2756AxU axU2 = this.LIZLLL;
        if (axU2 == null || !axU2.LJIIIIZZ) {
            TextView textView3 = this.LJIIIZ;
            if (textView3 == null) {
                n.LIZ("");
            }
            textView3.setCompoundDrawablesRelativeWithIntrinsicBounds((Drawable) null, (Drawable) null, (Drawable) null, (Drawable) null);
        } else {
            View view2 = this.itemView;
            n.LIZIZ(view2, "");
            Context context = view2.getContext();
            TextView textView4 = this.LJIIIZ;
            if (textView4 == null) {
                n.LIZ("");
            }
            BTA.LIZ(context, "shoutouts", (String) null, textView4);
        }
        TextView textView5 = this.LJIIJJI;
        if (textView5 == null) {
            n.LIZ("");
        }
        if (axU.LJIIJ) {
            str = axU.LJIIIZ;
        } else {
            str = axU.LIZJ;
        }
        textView5.setText(str);
        Oej oej = this.LJIILIIL;
        if (oej == null) {
            n.LIZ("");
        }
        oej.setStar((float) axU.LJ);
        int LIZ2 = 2ha.LIZ(24.0d);
        C2756AxU axU3 = this.LIZLLL;
        if (axU3 != null && (str2 = axU3.LJII) != null) {
            QJt LIZ3 = QHW.LIZ(str2);
            n.LIZIZ(LIZ3, "");
            LIZ3.LIZIZ(AnonymousClass9w1.LIZ(100));
            LIZ3.LIZ(LIZ2, LIZ2);
            LIZ3.LJJIJL = true;
            LIZ3.LIZ("ShoutoutReviewsCell");
            EdN edN = this.LJIIL;
            if (edN == null) {
                n.LIZ("");
            }
            LIZ3.LJJIIZ = edN;
            LIZ3.LIZJ();
        }
    }
}
