TikTok.apk(点击下载) / DialogC61397O8s.java


package X;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.bytedance.tux.icon.TuxIconView;
import com.bytedance.tux.input.TuxTextView;
import com.facebook.drawee.view.SimpleDraweeView;
import com.ss.android.ugc.aweme.ug.UgCommonServiceImpl;
import com.zhiliaoapp.musically.R;
import kotlin.g.b.m;

/* renamed from: X.O8s  reason: case insensitive filesystem */
public final class DialogC61397O8s extends DialogC76322zV {
    public static final O9A LJFF = new O9A((byte) 0);
    public ImageView LIZ;
    public TextView LIZIZ;
    public RotateAnimation LIZJ;
    public final Activity LIZLLL;
    public final C61390O8l LJ;
    public final AbstractC41969Gdy LJI;

    static {
        Covode.recordClassIndex(103013);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    /* JADX WARNING: Code restructure failed: missing block: B:275:0x052c, code lost:
        if (r0 == null) goto L_0x052e;
     */
    public DialogC61397O8s(Activity activity, C61390O8l o8l) {
        super(activity, R.style.a0l, true, false);
        String str;
        String str2;
        EnumC61394O8p o8p;
        TextView textView;
        C36672Eaj eaj;
        String str3;
        TextView textView2;
        String str4;
        String str5;
        EnumC61392O8n o8n;
        C36672Eaj eaj2;
        String str6;
        String str7;
        String str8;
        C36672Eaj eaj3;
        String str9;
        String str10;
        C36672Eaj eaj4;
        String str11;
        String str12;
        O94 o94;
        String str13;
        Drawable newDrawable;
        String str14;
        C36672Eaj eaj5;
        String str15;
        String str16;
        String str17;
        C36672Eaj eaj6;
        String str18;
        String str19;
        C36672Eaj eaj7;
        String str20;
        String str21;
        C21090sc.LIZ(activity, o8l);
        this.LIZLLL = activity;
        this.LJ = o8l;
        AbstractC41969Gdy LIZJ2 = UgCommonServiceImpl.LJIIL().LIZJ();
        this.LJI = LIZJ2;
        setContentView(R.layout.bas);
        setCancelable(false);
        setCanceledOnTouchOutside(false);
        setOnKeyListener(O95.LIZ);
        ((TuxIconView) findViewById(R.id.afe)).setOnClickListener(new View$OnClickListenerC61383O8e(this));
        double LIZ2 = (double) AnonymousClass0NQ.LIZ(activity);
        Double.isNaN(LIZ2);
        int i2 = (int) (LIZ2 * 0.744d);
        int LIZ3 = C13530gQ.LIZ(360.0d);
        i2 = i2 > LIZ3 ? LIZ3 : i2;
        View findViewById = findViewById(R.id.avu);
        m.LIZIZ(findViewById, "");
        ViewGroup.LayoutParams layoutParams = findViewById.getLayoutParams();
        layoutParams.width = i2;
        findViewById.setLayoutParams(layoutParams);
        if (o8l.LJI.size() == 2) {
            str = o8l.LJI.get(0);
            str2 = o8l.LJI.get(1);
        } else {
            str = "#FE2C55";
            str2 = "#F91844";
        }
        int LIZ4 = LIZ(str);
        int LIZ5 = LIZ(str2);
        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setGradientType(0);
        gradientDrawable.setShape(0);
        gradientDrawable.setCornerRadius(AnonymousClass0NQ.LIZIZ(activity, 16.0f));
        gradientDrawable.setColors(new int[]{LIZ4, LIZ5});
        findViewById.setBackground(gradientDrawable);
        SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(R.id.byh);
        String str22 = o8l.LIZ;
        if (str22 == null || str22.length() == 0) {
            simpleDraweeView.setImageURI("https://sf16-sg.tiktokcdn.com/obj/eden-sg/lufhdeh7nupqubz/spec_act_ic_red_packet_top_banner.png");
        } else {
            simpleDraweeView.setImageURI(o8l.LIZ);
        }
        TextView textView3 = (TextView) findViewById(R.id.title_tv);
        String str23 = o8l.LIZIZ;
        if (str23 == null || str23.length() == 0) {
            m.LIZIZ(textView3, "");
            textView3.setVisibility(8);
        } else {
            m.LIZIZ(textView3, "");
            textView3.setText(o8l.LIZIZ);
        }
        String str24 = "#FFFFFF";
        if (!(o8l.LJFF == null || (eaj7 = o8l.LJFF) == null || (str20 = eaj7.LIZ) == null || str20.length() == 0)) {
            C36672Eaj eaj8 = o8l.LJFF;
            textView3.setTextColor(LIZ((eaj8 == null || (str21 = eaj8.LIZ) == null) ? str24 : str21));
        }
        ImageView imageView = (ImageView) findViewById(R.id.bys);
        if (o8l.LJII == null) {
            m.LIZIZ(imageView, "");
            imageView.setVisibility(8);
        } else {
            m.LIZIZ(imageView, "");
            C41970Gdz.LIZ(LIZJ2, imageView, C53078Ksl.LIZJ);
        }
        View findViewById2 = findViewById(R.id.ane);
        C61395O8q o8q = o8l.LIZLLL;
        if (o8q == null || (str14 = o8q.LIZ) == null || str14.length() == 0) {
            m.LIZIZ(findViewById2, "");
            findViewById2.setVisibility(8);
        } else {
            ImageView imageView2 = (ImageView) findViewById(R.id.and);
            C61395O8q o8q2 = o8l.LIZLLL;
            if (o8q2 == null || o8q2.LIZIZ == null) {
                m.LIZIZ(imageView2, "");
                imageView2.setVisibility(8);
            } else {
                m.LIZIZ(imageView2, "");
                C41970Gdz.LIZ(LIZJ2, imageView2, C53078Ksl.LIZIZ);
            }
            TuxTextView tuxTextView = (TuxTextView) findViewById(R.id.anq);
            TuxTextView tuxTextView2 = (TuxTextView) findViewById(R.id.anr);
            O94 o942 = o8l.LJ;
            if (o942 == null || (str17 = o942.LIZIZ) == null || str17.length() == 0) {
                m.LIZIZ(tuxTextView2, "");
                tuxTextView2.setVisibility(8);
                m.LIZIZ(tuxTextView, "");
                tuxTextView.setVisibility(0);
                tuxTextView.LIZ(40.0f);
                C61395O8q o8q3 = o8l.LIZLLL;
                tuxTextView.setText(o8q3 != null ? o8q3.LIZ : null);
                if (!(o8l.LJFF == null || (eaj5 = o8l.LJFF) == null || (str15 = eaj5.LIZ) == null || str15.length() == 0)) {
                    C36672Eaj eaj9 = o8l.LJFF;
                    tuxTextView.setTextColor(LIZ((eaj9 == null || (str16 = eaj9.LIZ) == null) ? str24 : str16));
                }
            } else {
                m.LIZIZ(tuxTextView, "");
                tuxTextView.setVisibility(8);
                m.LIZIZ(tuxTextView2, "");
                tuxTextView2.setVisibility(0);
                tuxTextView2.LIZ(66.0f);
                C61395O8q o8q4 = o8l.LIZLLL;
                tuxTextView2.setText(o8q4 != null ? o8q4.LIZ : null);
                if (!(o8l.LJFF == null || (eaj6 = o8l.LJFF) == null || (str18 = eaj6.LIZ) == null || str18.length() == 0)) {
                    C36672Eaj eaj10 = o8l.LJFF;
                    tuxTextView2.setTextColor(LIZ((eaj10 == null || (str19 = eaj10.LIZ) == null) ? str24 : str19));
                }
            }
        }
        View findViewById3 = findViewById(R.id.e4e);
        if (o8l.LJ == null || (o94 = o8l.LJ) == null || (str13 = o94.LIZIZ) == null || str13.length() == 0) {
            m.LIZIZ(findViewById3, "");
            findViewById3.setVisibility(8);
        } else {
            O94 o943 = o8l.LJ;
            String str25 = o943 != null ? o943.LIZJ : null;
            TextView textView4 = (TextView) findViewById(R.id.e4j);
            ImageView imageView3 = (ImageView) findViewById(R.id.aoc);
            SimpleDraweeView simpleDraweeView2 = (SimpleDraweeView) findViewById(R.id.e42);
            m.LIZIZ(textView4, "");
            O94 o944 = o8l.LJ;
            textView4.setText(o944 != null ? o944.LIZIZ : null);
            GradientDrawable gradientDrawable2 = new GradientDrawable();
            gradientDrawable2.setShape(0);
            gradientDrawable2.setCornerRadius(AnonymousClass0NQ.LIZIZ(getContext(), 3.0f));
            gradientDrawable2.setColor(LIZ(!(str25 == null || str25.length() == 0) ? str25 : "#FFDB1E"));
            textView4.setBackground(gradientDrawable2);
            Drawable LIZ6 = C017906e.LIZ(getContext(), (int) R.drawable.blt);
            if (LIZ6 != null) {
                Drawable.ConstantState constantState = LIZ6.getConstantState();
                if (!(constantState == null || (newDrawable = constantState.newDrawable()) == null)) {
                    LIZ6 = newDrawable;
                }
                Drawable mutate = AnonymousClass07W.LJ(LIZ6).mutate();
                m.LIZIZ(mutate, "");
                AnonymousClass07W.LIZ(mutate, LIZ((str25 == null || str25.length() == 0) ? "#FFDB1E" : str25));
                imageView3.setImageDrawable(mutate);
            }
            O94 o945 = o8l.LJ;
            simpleDraweeView2.setImageURI(o945 != null ? o945.LIZ : null);
        }
        View findViewById4 = findViewById(R.id.f_n);
        String str26 = o8l.LIZJ;
        if (str26 == null || str26.length() == 0) {
            m.LIZIZ(findViewById4, "");
            findViewById4.setVisibility(8);
        } else {
            TextView textView5 = (TextView) findViewById(R.id.f_p);
            m.LIZIZ(textView5, "");
            textView5.setText(o8l.LIZJ);
            if (!(o8l.LJFF == null || (eaj4 = o8l.LJFF) == null || (str11 = eaj4.LIZ) == null || str11.length() == 0)) {
                C36672Eaj eaj11 = o8l.LJFF;
                textView5.setTextColor(LIZ((eaj11 == null || (str12 = eaj11.LIZ) == null) ? str24 : str12));
            }
        }
        ListView listView = (ListView) findViewById(R.id.cw1);
        if (o8l.LJIIIIZZ == null) {
            m.LIZIZ(listView, "");
            listView.setVisibility(8);
        } else {
            C61393O8o[] o8oArr = o8l.LJIIIIZZ;
            if (o8oArr == null) {
                m.LIZIZ();
            }
            O92 o92 = new O92(activity, o8oArr);
            m.LIZIZ(listView, "");
            listView.setAdapter((ListAdapter) o92);
        }
        View findViewById5 = findViewById(R.id.bl0);
        TextView textView6 = (TextView) findViewById(R.id.bl1);
        TextView textView7 = (TextView) findViewById(R.id.bl2);
        String str27 = o8l.LJIIIZ;
        if (str27 == null || str27.length() == 0) {
            m.LIZIZ(findViewById5, "");
            findViewById5.setVisibility(8);
        } else {
            O94 o946 = o8l.LJ;
            if (o946 == null || (str8 = o946.LIZ) == null || str8.length() == 0) {
                m.LIZIZ(textView6, "");
                textView6.setVisibility(0);
                m.LIZIZ(textView7, "");
                textView7.setVisibility(8);
                textView6.setText(o8l.LJIIIZ);
                if (!(o8l.LJFF == null || (eaj2 = o8l.LJFF) == null || (str6 = eaj2.LIZ) == null || str6.length() == 0)) {
                    C36672Eaj eaj12 = o8l.LJFF;
                    textView6.setTextColor(LIZ((eaj12 == null || (str7 = eaj12.LIZ) == null) ? str24 : str7));
                }
            } else {
                m.LIZIZ(textView7, "");
                textView7.setVisibility(0);
                m.LIZIZ(textView6, "");
                textView6.setVisibility(8);
                textView7.setText(o8l.LJIIIZ);
                if (!(o8l.LJFF == null || (eaj3 = o8l.LJFF) == null || (str9 = eaj3.LIZ) == null || str9.length() == 0)) {
                    C36672Eaj eaj13 = o8l.LJFF;
                    textView7.setTextColor(LIZ((eaj13 == null || (str10 = eaj13.LIZ) == null) ? str24 : str10));
                }
            }
        }
        View findViewById6 = findViewById(R.id.gqt);
        View findViewById7 = findViewById(R.id.eze);
        ImageView imageView4 = (ImageView) findViewById(R.id.ezd);
        imageView4.setImageDrawable(LIZ(EnumC61392O8n.CALENDAR));
        C61391O8m o8m = o8l.LJIIJ;
        if (!(o8m == null || (o8p = o8m.LIZIZ) == null)) {
            int i3 = C61396O8r.LIZ[o8p.ordinal()];
            if (i3 == 1) {
                m.LIZIZ(findViewById7, "");
                findViewById7.setVisibility(8);
                ImageView imageView5 = (ImageView) findViewById(R.id.d38);
                this.LIZ = imageView5;
                if (imageView5 == null) {
                    m.LIZIZ();
                }
                LIZJ2.LIZ(imageView5, C53078Ksl.LIZ);
                SimpleDraweeView simpleDraweeView3 = (SimpleDraweeView) findViewById(R.id.a8y);
                TextView textView8 = (TextView) findViewById(R.id.gqu);
                this.LIZIZ = textView8;
                if (textView8 != null) {
                    C61391O8m o8m2 = o8l.LJIIJ;
                    textView8.setText(o8m2 != null ? o8m2.LIZ : null);
                }
                C61391O8m o8m3 = o8l.LJIIJ;
                if (o8m3 == null || (str5 = o8m3.LIZLLL) == null || str5.length() == 0) {
                    simpleDraweeView3.setImageURI("https://sf16-sg.tiktokcdn.com/obj/eden-sg/lufhdeh7nupqubz/spec_act_ic_red_packet_btn.png");
                } else {
                    C61391O8m o8m4 = o8l.LJIIJ;
                    simpleDraweeView3.setImageURI(o8m4 != null ? o8m4.LIZLLL : null);
                }
                if (!(o8l.LJFF == null || (eaj = o8l.LJFF) == null || (str3 = eaj.LIZ) == null || str3.length() == 0 || (textView2 = this.LIZIZ) == null)) {
                    C36672Eaj eaj14 = o8l.LJFF;
                    if (!(eaj14 == null || (str4 = eaj14.LIZ) == null)) {
                        str24 = str4;
                    }
                    textView2.setTextColor(LIZ(str24));
                }
                TextView textView9 = this.LIZIZ;
                if (textView9 != null) {
                    textView9.setOnClickListener(new O96(this));
                }
                if (AnonymousClass0NQ.LIZ(activity) < C13530gQ.LIZ(360.0d) && (textView = this.LIZIZ) != null) {
                    textView.setTextSize(20.0f);
                    return;
                }
                return;
            } else if (i3 == 2) {
                m.LIZIZ(findViewById6, "");
                findViewById6.setVisibility(8);
                C61391O8m o8m5 = o8l.LJIIJ;
                if (o8m5 == null || o8m5.LIZJ == null) {
                    m.LIZIZ(imageView4, "");
                    imageView4.setVisibility(8);
                } else {
                    C61391O8m o8m6 = o8l.LJIIJ;
                    if (o8m6 != null) {
                        o8n = o8m6.LIZJ;
                    } else {
                        o8n = null;
                    }
                    m.LIZIZ();
                    imageView4.setImageDrawable(LIZ(o8n));
                }
                TextView textView10 = (TextView) findViewById(R.id.ezf);
                m.LIZIZ(textView10, "");
                C61391O8m o8m7 = o8l.LJIIJ;
                textView10.setText(o8m7 != null ? o8m7.LIZ : null);
                findViewById7.setOnClickListener(new O97(this));
                return;
            }
        }
        m.LIZIZ(findViewById6, "");
        findViewById6.setVisibility(8);
        m.LIZIZ(findViewById7, "");
        findViewById7.setVisibility(8);
    }

    private final int LIZ(String str) {
        try {
            return Color.parseColor(str);
        } catch (Exception unused) {
            return R.color.l;
        }
    }

    private final Drawable LIZ(EnumC61392O8n o8n) {
        if (C61396O8r.LIZIZ[o8n.ordinal()] != 1) {
            return null;
        }
        C98213ti LIZ2 = AnonymousClass33D.LIZ(AnonymousClass92U.LIZ);
        Context context = getContext();
        m.LIZIZ(context, "");
        return LIZ2.LIZ(context);
    }

    public final void LIZ(View view) {
        if (!C48541vn.LIZ(view, 1200)) {
            String str = "ok";
            if (this.LJ.LJIIL != null) {
                C61109Nz0 nz0 = C61109Nz0.LIZ;
                C61388O8j o8j = this.LJ.LJIILIIL;
                Boolean bool = this.LJ.LJIIL;
                if (bool == null) {
                    m.LIZIZ();
                }
                if (!bool.booleanValue()) {
                    str = "add_to_calendar";
                }
                nz0.LIZ(o8j, str);
            } else {
                C61109Nz0.LIZ.LIZ(this.LJ.LJIILIIL, str);
            }
            AnonymousClass1IX<? super DialogC61397O8s, ? super C61390O8l, C23860x5> r1 = this.LJ.LJIIJJI;
            if (r1 != null) {
                r1.invoke(this, this.LJ);
            }
        }
    }

    public final void dismiss() {
        C46629ISs.LJIIIIZZ.LIZ().LJI = false;
        super.dismiss();
    }

    public final void show() {
        super.show();
        C61109Nz0 nz0 = C61109Nz0.LIZ;
        C61388O8j o8j = this.LJ.LJIILIIL;
        C21090sc.LIZ(o8j);
        C14300hf.LIZ("referral_dialog_pop_show", nz0.LIZIZ(o8j, null).LIZ);
    }
}