package com.ss.android.ugc.aweme.shortvideo.sticker.infoSticker.interact.consume.view;

import X.022;
import X.070;
import X.0AA;
import X.0HH;
import X.2EV;
import X.2UX;
import X.2nK;
import X.2yN;
import X.3QV;
import X.46i;
import X.4DW;
import X.4EW;
import X.4FQ;
import X.4aM;
import X.6Tu;
import X.C0371REh;
import X.CqM;
import X.M12;
import X.Mjy;
import X.Mk2;
import X.Mk3;
import X.NuY;
import X.OGp;
import X.PhE;
import X.PlI;
import X.Ppm;
import X.Qeg;
import X.SN4;
import X.SN5;
import X.SN6;
import X.SN8;
import X.SN9;
import X.SNC;
import X.SND;
import X.SNE;
import X.SNF;
import X.SNG;
import X.SNI;
import X.SNJ;
import X.SNK;
import X.SNL;
import X.SNM;
import X.SNN;
import X.SNS;
import android.animation.StateListAnimator;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.app.api.Api;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.shortvideo.sticker.infoSticker.interact.consume.api.CountDownStickerApi;
import com.ss.android.ugc.aweme.sticker.data.CountDownStickerStruct;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Objects;
import kotlin.h.b.n;

public final class FeedCountStickerDialogFragment extends BottomSheetDialogFragment {
    public static final SNS LJII = new SNS((byte) 0);
    public CountDownStickerStruct LIZ;
    public Aweme LIZIZ;
    public TextView LIZJ;
    public Mjy LIZLLL;
    public OGp LJ;
    public String LJFF;
    public boolean LJI;
    public LinearLayout LJIIIIZZ;
    public ImageView LJIIIZ;
    public Button LJIIJ;
    public Button LJIIJJI;
    public SNC LJIIL = SNM.LIZ;
    public final CountDownStickerApi LJIILIIL;
    public String LJIILJJIL;
    public String LJIILL;
    public SparseArray LJIILLIIL;

    static {
        Covode.recordClassIndex(112346);
    }

    private final void LJII() {
        if (this.LJI) {
            LIZJ();
        } else {
            LJ();
        }
    }

    public final Mjy LIZ() {
        if (this.LIZLLL == null) {
            this.LIZLLL = new Mjy();
        }
        return this.LIZLLL;
    }

    public final /* synthetic */ void onDestroyView() {
        FeedCountStickerDialogFragment.super.onDestroyView();
        SparseArray sparseArray = this.LJIILLIIL;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final void onDetach() {
        FeedCountStickerDialogFragment.super.onDetach();
        Mjy LIZ2 = LIZ();
        if (LIZ2 != null) {
            LIZ2.dispose();
        }
        this.LIZLLL = null;
    }

    public FeedCountStickerDialogFragment() {
        Object LIZ2 = Ppm.LIZ.LIZ(Api.LIZLLL).LIZ(CountDownStickerApi.class);
        n.LIZIZ(LIZ2, "");
        this.LJIILIIL = (CountDownStickerApi) LIZ2;
    }

    public final boolean LIZIZ() {
        if (4aM.LIZ(getContext())) {
            return true;
        }
        Context context = getContext();
        if (context == null) {
            return false;
        }
        n.LIZIZ(context, "");
        4EW r1 = new 4EW(context);
        r1.LIZJ(2131832357);
        r1.LIZLLL(2131832360);
        3QV.LIZ(r1, new 4DW(this));
        4FQ.LIZ(r1.LIZ().LIZJ());
        2UX r2 = new 2UX();
        String str = this.LJFF;
        if (str == null) {
            n.LIZ("");
        }
        r2.LIZ("enter_from", str);
        r2.LIZ("enter_method", "live_cd_sticker");
        r2.LIZ("enter_reason", "general");
        2nK.LIZ("push_pre_permission_show", r2.LIZ);
        return false;
    }

    private final void LIZLLL() {
        String str;
        long j;
        int i;
        MethodCollector.i(1282);
        LinearLayout linearLayout = this.LJIIIIZZ;
        if (linearLayout == null) {
            MethodCollector.o(1282);
            return;
        }
        linearLayout.removeViews(1, linearLayout.getChildCount() - 1);
        CountDownStickerStruct countDownStickerStruct = this.LIZ;
        Long l = null;
        if (countDownStickerStruct != null) {
            str = countDownStickerStruct.getTitle();
        } else {
            str = null;
        }
        linearLayout.addView(LIZ(linearLayout, str, 22, 20.0f, 2131099750));
        CountDownStickerStruct countDownStickerStruct2 = this.LIZ;
        if (countDownStickerStruct2 != null) {
            l = Long.valueOf(countDownStickerStruct2.getMillSecond());
        }
        linearLayout.addView(LIZ(linearLayout, LIZ(l), 41, 12.0f, 2131099757));
        CountDownStickerStruct countDownStickerStruct3 = this.LIZ;
        if (countDownStickerStruct3 != null) {
            j = countDownStickerStruct3.getSubscribeNum();
        } else {
            j = 0;
        }
        String LIZ2 = 2yN.LIZ(j);
        Resources resources = linearLayout.getResources();
        CountDownStickerStruct countDownStickerStruct4 = this.LIZ;
        if (countDownStickerStruct4 != null) {
            i = (int) countDownStickerStruct4.getSubscribeNum();
        } else {
            i = 0;
        }
        String quantityString = resources.getQuantityString(2131689526, i);
        n.LIZIZ(quantityString, "");
        String LIZ3 = 0HH.LIZ(quantityString, Arrays.copyOf(new Object[]{"<b>" + LIZ2 + "</b>"}, 1));
        n.LIZIZ(LIZ3, "");
        LIZ2.length();
        Qeg LIZ4 = LIZ(linearLayout, LIZ3, 41, 32.0f, 2131099757);
        this.LIZJ = LIZ4;
        linearLayout.addView(LIZ4);
        String string = linearLayout.getResources().getString(2131823274);
        n.LIZIZ(string, "");
        int LIZJ2 = 070.LIZJ(linearLayout.getContext(), 2131099750);
        Context context = linearLayout.getContext();
        if (context != null) {
            NuY LIZ5 = LIZ(linearLayout, string, LIZJ2, 022.LIZIZ(context, 2131231352));
            this.LJIIJ = LIZ5;
            if (LIZ5 != null) {
                LIZ5.setOnClickListener(new SNG(this, linearLayout));
            }
            linearLayout.addView(this.LJIIJ);
            MethodCollector.o(1282);
            return;
        }
        NullPointerException nullPointerException = new NullPointerException("null cannot be cast to non-null type android.content.Context");
        MethodCollector.o(1282);
        throw nullPointerException;
    }

    private final void LJ() {
        String str;
        String str2;
        MethodCollector.i(2212);
        LinearLayout linearLayout = this.LJIIIIZZ;
        if (linearLayout == null) {
            MethodCollector.o(2212);
            return;
        }
        linearLayout.removeViews(1, linearLayout.getChildCount() - 1);
        CountDownStickerStruct countDownStickerStruct = this.LIZ;
        Long l = null;
        if (countDownStickerStruct != null) {
            str = countDownStickerStruct.getTitle();
        } else {
            str = null;
        }
        linearLayout.addView(LIZ(linearLayout, str, 22, 20.0f, 2131099750));
        StringBuilder sb = new StringBuilder();
        CountDownStickerStruct countDownStickerStruct2 = this.LIZ;
        if (countDownStickerStruct2 != null) {
            str2 = countDownStickerStruct2.getTextAlreadyExpired();
        } else {
            str2 = null;
        }
        sb.append(str2);
        sb.append("\n");
        CountDownStickerStruct countDownStickerStruct3 = this.LIZ;
        if (countDownStickerStruct3 != null) {
            l = Long.valueOf(countDownStickerStruct3.getMillSecond());
        }
        sb.append(LIZ(l));
        linearLayout.addView(LIZ(linearLayout, sb.toString(), 41, 12.0f, 2131099757));
        String string = linearLayout.getResources().getString(2131823274);
        n.LIZIZ(string, "");
        int LIZJ2 = 070.LIZJ(linearLayout.getContext(), 2131099750);
        Context context = linearLayout.getContext();
        if (context != null) {
            NuY LIZ2 = LIZ(linearLayout, string, LIZJ2, 022.LIZIZ(context, 2131231352));
            this.LJIIJ = LIZ2;
            if (LIZ2 != null) {
                LIZ2.setOnClickListener(new SNE(this, linearLayout));
            }
            linearLayout.addView(this.LJIIJ);
            MethodCollector.o(2212);
            return;
        }
        NullPointerException nullPointerException = new NullPointerException("null cannot be cast to non-null type android.content.Context");
        MethodCollector.o(2212);
        throw nullPointerException;
    }

    private final void LJFF() {
        String str;
        Long l;
        MethodCollector.i(91);
        LinearLayout linearLayout = this.LJIIIIZZ;
        if (linearLayout == null) {
            MethodCollector.o(91);
            return;
        }
        linearLayout.removeViews(1, linearLayout.getChildCount() - 1);
        CountDownStickerStruct countDownStickerStruct = this.LIZ;
        String str2 = null;
        if (countDownStickerStruct != null) {
            str = countDownStickerStruct.getTitle();
        } else {
            str = null;
        }
        linearLayout.addView(LIZ(linearLayout, str, 22, 20.0f, 2131099750));
        CountDownStickerStruct countDownStickerStruct2 = this.LIZ;
        if (countDownStickerStruct2 != null) {
            l = Long.valueOf(countDownStickerStruct2.getMillSecond());
        } else {
            l = null;
        }
        linearLayout.addView(LIZ(linearLayout, LIZ(l), 41, 12.0f, 2131099757));
        CountDownStickerStruct countDownStickerStruct3 = this.LIZ;
        if (countDownStickerStruct3 != null) {
            str2 = countDownStickerStruct3.getTextTobeSubscribed();
        }
        linearLayout.addView(LIZ(linearLayout, str2, 41, 12.0f, 2131099757));
        String string = linearLayout.getResources().getString(2131823297);
        n.LIZIZ(string, "");
        int LIZJ2 = 070.LIZJ(linearLayout.getContext(), 2131099685);
        Context context = linearLayout.getContext();
        if (context != null) {
            NuY LIZ2 = LIZ(linearLayout, string, LIZJ2, 022.LIZIZ(context, 2131231351));
            this.LJIIJJI = LIZ2;
            if (LIZ2 != null) {
                LIZ2.setOnClickListener(new SN8(this, linearLayout));
            }
            linearLayout.addView(this.LJIIJJI);
            MethodCollector.o(91);
            return;
        }
        NullPointerException nullPointerException = new NullPointerException("null cannot be cast to non-null type android.content.Context");
        MethodCollector.o(91);
        throw nullPointerException;
    }

    private final void LJI() {
        String str;
        Long l;
        MethodCollector.i(1061);
        LinearLayout linearLayout = this.LJIIIIZZ;
        if (linearLayout == null) {
            MethodCollector.o(1061);
            return;
        }
        linearLayout.removeViews(1, linearLayout.getChildCount() - 1);
        CountDownStickerStruct countDownStickerStruct = this.LIZ;
        String str2 = null;
        if (countDownStickerStruct != null) {
            str = countDownStickerStruct.getTitle();
        } else {
            str = null;
        }
        linearLayout.addView(LIZ(linearLayout, str, 22, 20.0f, 2131099750));
        CountDownStickerStruct countDownStickerStruct2 = this.LIZ;
        if (countDownStickerStruct2 != null) {
            l = Long.valueOf(countDownStickerStruct2.getMillSecond());
        } else {
            l = null;
        }
        linearLayout.addView(LIZ(linearLayout, LIZ(l), 41, 12.0f, 2131099757));
        CountDownStickerStruct countDownStickerStruct3 = this.LIZ;
        if (countDownStickerStruct3 != null) {
            str2 = countDownStickerStruct3.getTextAlreadySubscribed();
        }
        linearLayout.addView(LIZ(linearLayout, str2, 41, 12.0f, 2131099757));
        String string = linearLayout.getResources().getString(2131823281);
        n.LIZIZ(string, "");
        int LIZJ2 = 070.LIZJ(linearLayout.getContext(), 2131099753);
        Context context = linearLayout.getContext();
        if (context != null) {
            NuY LIZ2 = LIZ(linearLayout, string, LIZJ2, 022.LIZIZ(context, 2131231352));
            this.LJIIJJI = LIZ2;
            if (LIZ2 != null) {
                LIZ2.setOnClickListener(new SN9(this, linearLayout));
            }
            linearLayout.addView(this.LJIIJJI);
            MethodCollector.o(1061);
            return;
        }
        NullPointerException nullPointerException = new NullPointerException("null cannot be cast to non-null type android.content.Context");
        MethodCollector.o(1061);
        throw nullPointerException;
    }

    private final void LIZJ() {
        String str;
        String str2;
        long j;
        int i;
        MethodCollector.i(1210);
        LinearLayout linearLayout = this.LJIIIIZZ;
        if (linearLayout == null) {
            MethodCollector.o(1210);
            return;
        }
        linearLayout.removeViews(1, linearLayout.getChildCount() - 1);
        CountDownStickerStruct countDownStickerStruct = this.LIZ;
        Long l = null;
        if (countDownStickerStruct != null) {
            str = countDownStickerStruct.getTitle();
        } else {
            str = null;
        }
        linearLayout.addView(LIZ(linearLayout, str, 22, 20.0f, 2131099750));
        StringBuilder sb = new StringBuilder();
        CountDownStickerStruct countDownStickerStruct2 = this.LIZ;
        if (countDownStickerStruct2 != null) {
            str2 = countDownStickerStruct2.getTextAlreadyExpired();
        } else {
            str2 = null;
        }
        sb.append(str2);
        sb.append("\n");
        CountDownStickerStruct countDownStickerStruct3 = this.LIZ;
        if (countDownStickerStruct3 != null) {
            l = Long.valueOf(countDownStickerStruct3.getMillSecond());
        }
        sb.append(LIZ(l));
        linearLayout.addView(LIZ(linearLayout, sb.toString(), 41, 12.0f, 2131099757));
        CountDownStickerStruct countDownStickerStruct4 = this.LIZ;
        if (countDownStickerStruct4 != null) {
            j = countDownStickerStruct4.getSubscribeNum();
        } else {
            j = 0;
        }
        String LIZ2 = 2yN.LIZ(j);
        Resources resources = linearLayout.getResources();
        CountDownStickerStruct countDownStickerStruct5 = this.LIZ;
        if (countDownStickerStruct5 != null) {
            i = (int) countDownStickerStruct5.getSubscribeNum();
        } else {
            i = 0;
        }
        String quantityString = resources.getQuantityString(2131689522, i);
        n.LIZIZ(quantityString, "");
        String LIZ3 = 0HH.LIZ(quantityString, Arrays.copyOf(new Object[]{"<b>" + LIZ2 + "</b>"}, 1));
        n.LIZIZ(LIZ3, "");
        LIZ2.length();
        Qeg LIZ4 = LIZ(linearLayout, LIZ3, 41, 32.0f, 2131099757);
        this.LIZJ = LIZ4;
        linearLayout.addView(LIZ4);
        String string = linearLayout.getResources().getString(2131823274);
        n.LIZIZ(string, "");
        int LIZJ2 = 070.LIZJ(linearLayout.getContext(), 2131099750);
        Context context = linearLayout.getContext();
        if (context != null) {
            NuY LIZ5 = LIZ(linearLayout, string, LIZJ2, 022.LIZIZ(context, 2131231352));
            this.LJIIJ = LIZ5;
            if (LIZ5 != null) {
                LIZ5.setOnClickListener(new SNF(this, linearLayout));
            }
            linearLayout.addView(this.LJIIJ);
            MethodCollector.o(1210);
            return;
        }
        NullPointerException nullPointerException = new NullPointerException("null cannot be cast to non-null type android.content.Context");
        MethodCollector.o(1210);
        throw nullPointerException;
    }

    public final void onDismiss(DialogInterface dialogInterface) {
        FeedCountStickerDialogFragment.super.onDismiss(dialogInterface);
        CqM.LIZ(new 2EV(false, false));
    }

    private final String LIZ(Long l) {
        if (l == null) {
            return "";
        }
        String formatDateTime = DateUtils.formatDateTime(getContext(), l.longValue(), 87);
        n.LIZIZ(formatDateTime, "");
        return formatDateTime;
    }

    public final void onCreate(Bundle bundle) {
        String str;
        String str2;
        String str3;
        String str4;
        Serializable serializable;
        String str5;
        SNC snc;
        Aweme aweme;
        FeedCountStickerDialogFragment.super.onCreate(bundle);
        setStyle(0, 2131887101);
        Boolean bool = null;
        if (this.LIZIZ == null) {
            Bundle arguments = getArguments();
            if (arguments != null) {
                aweme = arguments.getSerializable("countdown_sticker_aweme");
            } else {
                aweme = null;
            }
            if (!(aweme instanceof Aweme)) {
                aweme = null;
            }
            this.LIZIZ = aweme;
        }
        Bundle arguments2 = getArguments();
        if (arguments2 == null || (str = arguments2.getString("group_id")) == null) {
            str = "";
        }
        this.LJIILJJIL = str;
        Bundle arguments3 = getArguments();
        if (arguments3 == null || (str2 = arguments3.getString("author_id")) == null) {
            str2 = "";
        }
        this.LJIILL = str2;
        Bundle arguments4 = getArguments();
        if (arguments4 == null || (str3 = arguments4.getString("enter_from")) == null) {
            str3 = "";
        }
        this.LJFF = str3;
        IAccountUserService LJFF2 = 46i.LJFF();
        n.LIZIZ(LJFF2, "");
        String curUserId = LJFF2.getCurUserId();
        Aweme aweme2 = this.LIZIZ;
        if (aweme2 != null) {
            str4 = aweme2.getAuthorUid();
        } else {
            str4 = null;
        }
        this.LJI = TextUtils.equals(curUserId, str4);
        if (this.LIZ == null) {
            Bundle arguments5 = getArguments();
            if (arguments5 != null) {
                serializable = arguments5.getSerializable("countdown_sticker_data");
            } else {
                serializable = null;
            }
            if (!(serializable instanceof CountDownStickerStruct)) {
                serializable = null;
            }
            this.LIZ = (CountDownStickerStruct) serializable;
            IAccountUserService LJFF3 = 46i.LJFF();
            n.LIZIZ(LJFF3, "");
            String curUserId2 = LJFF3.getCurUserId();
            Aweme aweme3 = this.LIZIZ;
            if (aweme3 != null) {
                str5 = aweme3.getAuthorUid();
            } else {
                str5 = null;
            }
            long j = 0;
            if (TextUtils.equals(curUserId2, str5)) {
                long currentTimeMillis = System.currentTimeMillis();
                CountDownStickerStruct countDownStickerStruct = this.LIZ;
                if (countDownStickerStruct != null) {
                    j = countDownStickerStruct.getMillSecond();
                }
                if (currentTimeMillis > j) {
                    snc = SNL.LIZ;
                } else {
                    snc = SNM.LIZ;
                }
            } else {
                long currentTimeMillis2 = System.currentTimeMillis();
                CountDownStickerStruct countDownStickerStruct2 = this.LIZ;
                if (countDownStickerStruct2 != null) {
                    j = countDownStickerStruct2.getMillSecond();
                }
                if (currentTimeMillis2 > j) {
                    snc = SNI.LIZ;
                } else {
                    CountDownStickerStruct countDownStickerStruct3 = this.LIZ;
                    if (countDownStickerStruct3 != null) {
                        bool = countDownStickerStruct3.getSubscribe();
                    }
                    if (n.LIZ(bool, true)) {
                        snc = SNK.LIZ;
                    } else {
                        snc = SNJ.LIZ;
                    }
                }
            }
            this.LJIIL = snc;
        }
    }

    public final void showNow(0AA r7, String str) {
        long j;
        String aid;
        FeedCountStickerDialogFragment.super.showNow(r7, str);
        CqM.LIZ(new 2EV(true, false));
        long currentTimeMillis = System.currentTimeMillis();
        CountDownStickerStruct countDownStickerStruct = this.LIZ;
        if (countDownStickerStruct != null) {
            j = countDownStickerStruct.getMillSecond();
        } else {
            j = 0;
        }
        if (currentTimeMillis > j) {
            LIZ((SNC) SNN.LIZ, false);
        }
        Aweme aweme = this.LIZIZ;
        if (aweme != null && (aid = aweme.getAid()) != null) {
            this.LJIILIIL.getDetail(aid).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZIZ(new SN4(this));
        }
    }

    public final void LIZ(SNC snc, boolean z) {
        M12.LIZ(snc);
        if (!n.LIZ(this.LJIIL, snc) || z) {
            this.LJIIL = snc;
            if (n.LIZ(snc, SNI.LIZ)) {
                LJ();
            } else if (n.LIZ(snc, SNJ.LIZ)) {
                LJFF();
            } else if (n.LIZ(snc, SNK.LIZ)) {
                LJI();
            } else if (n.LIZ(snc, SNL.LIZ)) {
                LIZJ();
            } else if (n.LIZ(snc, SNM.LIZ)) {
                LIZLLL();
            } else if (n.LIZ(snc, SNN.LIZ)) {
                LJII();
            }
        }
    }

    public final void LIZ(String str, Long l) {
        long j;
        int ordinal;
        if (!TextUtils.isEmpty(str)) {
            if (n.LIZ(this.LJIIL, SNJ.LIZ)) {
                2UX r2 = new 2UX();
                String str2 = this.LJIILJJIL;
                if (str2 == null) {
                    n.LIZ("");
                }
                r2.LIZ("group_id", str2);
                String str3 = this.LJIILL;
                if (str3 == null) {
                    n.LIZ("");
                }
                r2.LIZ("author_id", str3);
                String str4 = this.LJFF;
                if (str4 == null) {
                    n.LIZ("");
                }
                r2.LIZ("enter_from", str4);
                r2.LIZ("countdown_time", SN6.LIZLLL.LIZ(this.LIZ));
                r2.LIZ("enter_method", "live_cd_sticker");
                2nK.LIZ("livesdk_live_subscirbe", r2.LIZ);
            } else if (n.LIZ(this.LJIIL, SNK.LIZ)) {
                2UX r22 = new 2UX();
                String str5 = this.LJIILJJIL;
                if (str5 == null) {
                    n.LIZ("");
                }
                r22.LIZ("group_id", str5);
                String str6 = this.LJIILL;
                if (str6 == null) {
                    n.LIZ("");
                }
                r22.LIZ("author_id", str6);
                String str7 = this.LJFF;
                if (str7 == null) {
                    n.LIZ("");
                }
                r22.LIZ("enter_from", str7);
                r22.LIZ("countdown_time", SN6.LIZLLL.LIZ(this.LIZ));
                r22.LIZ("enter_method", "live_cd_sticker");
                2nK.LIZ("livesdk_live_unsubscirbe", r22.LIZ);
            }
            CountDownStickerApi countDownStickerApi = this.LJIILIIL;
            if (str == null) {
                str = "";
            }
            if (l != null) {
                j = l.longValue();
            } else {
                j = 0;
            }
            long j2 = j / 1000;
            if (n.LIZ(this.LJIIL, SNJ.LIZ)) {
                ordinal = C0371REh.Subscribe.ordinal();
            } else {
                ordinal = C0371REh.CancelSubscribe.ordinal();
            }
            countDownStickerApi.subscribe(str, j2, ordinal).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZIZ(new SN5(this));
        }
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        ImageView imageView;
        M12.LIZ(layoutInflater);
        View LIZ2 = 0HH.LIZ(layoutInflater, 2131559727, viewGroup, false);
        Objects.requireNonNull(LIZ2, "null cannot be cast to non-null type android.widget.LinearLayout");
        LinearLayout linearLayout = (LinearLayout) LIZ2;
        this.LJIIIIZZ = linearLayout;
        if (linearLayout != null) {
            imageView = (ImageView) linearLayout.findViewById(2131363384);
        } else {
            imageView = null;
        }
        this.LJIIIZ = imageView;
        if (imageView != null) {
            imageView.setOnClickListener(new SND(this));
        }
        LIZ(this.LJIIL, true);
        return this.LJIIIIZZ;
    }

    private final NuY LIZ(LinearLayout linearLayout, String str, int i, Drawable drawable) {
        NuY nuY = new NuY(linearLayout.getContext());
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
        layoutParams.gravity = 1;
        nuY.setText(str);
        nuY.setTextColor(i);
        nuY.setBackground(drawable);
        nuY.setTextSize(15.0f);
        nuY.setStateListAnimator((StateListAnimator) null);
        Context context = linearLayout.getContext();
        if (context != null) {
            layoutParams.topMargin = (int) 6Tu.LIZ(context, 36.0f);
            layoutParams.bottomMargin = (int) 6Tu.LIZ(context, 46.0f);
            layoutParams.leftMargin = (int) 6Tu.LIZ(context, 16.0f);
            layoutParams.rightMargin = (int) 6Tu.LIZ(context, 16.0f);
            nuY.setLayoutParams(layoutParams);
        }
        return nuY;
    }

    private final Qeg LIZ(LinearLayout linearLayout, String str, int i, float f, int i2) {
        Context context = linearLayout.getContext();
        n.LIZIZ(context, "");
        Qeg qeg = new Qeg(context, (AttributeSet) null, 0, 6);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 17;
        qeg.setText(Html.fromHtml(str));
        Context context2 = linearLayout.getContext();
        n.LIZIZ(context2, "");
        qeg.setTextColor(context2.getResources().getColor(i2));
        qeg.setTuxFont(i);
        Context context3 = linearLayout.getContext();
        if (context3 != null) {
            layoutParams.topMargin = (int) 6Tu.LIZ(context3, f);
            layoutParams.bottomMargin = (int) 6Tu.LIZ(context3, 0.0f);
            layoutParams.setMarginStart((int) 6Tu.LIZ(context3, 24.0f));
            layoutParams.setMarginEnd((int) 6Tu.LIZ(context3, 24.0f));
            qeg.setLayoutParams(layoutParams);
        }
        qeg.setGravity(17);
        return qeg;
    }
}
