package com.bytedance.android.livesdk.pip;

import X.041;
import X.0b0;
import X.0dh;
import X.C1125Fw6;
import X.C1126Fw7;
import X.C1127Fw8;
import X.HEJ;
import X.HYR;
import X.LnI;
import X.M12;
import X.Qen;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.bytedance.android.livesdk.LiveDialogFragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannelGlobal;
import java.util.HashMap;
import kotlin.h.b.n;

public final class ShareSettingsDialog extends LiveDialogFragment {
    public static final String LIZIZ;
    public static final C1127Fw8 LIZJ = new C1127Fw8((byte) 0);
    public String LIZ;
    public HashMap LIZLLL;

    public final View LIZ(int i) {
        if (this.LIZLLL == null) {
            this.LIZLLL = new HashMap();
        }
        View view = (View) this.LIZLLL.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LIZLLL.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    public final /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        z_();
    }

    public final void z_() {
        HashMap hashMap = this.LIZLLL;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    static {
        Covode.recordClassIndex(19992);
        String simpleName = ShareSettingsDialog.class.getSimpleName();
        n.LIZIZ(simpleName, "");
        LIZIZ = simpleName;
    }

    /* JADX WARNING: Removed duplicated region for block: B:11:0x001f  */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x0039  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final X.C1044Fun LIZ() {
        /*
            r6 = this;
            com.bytedance.ies.sdk.datachannel.DataChannel r2 = r6.LJIILIIL
            r1 = 1
            if (r2 == 0) goto L_0x004a
            java.lang.Class<X.HFX> r0 = X.HFX.class
            java.lang.Object r0 = r2.LIZIZ(r0)
            java.lang.Boolean r0 = (java.lang.Boolean) r0
            if (r0 == 0) goto L_0x004a
            boolean r0 = r0.booleanValue()
            if (r0 == 0) goto L_0x0042
        L_0x0015:
            r5 = 2131886594(0x7f120202, float:1.9407771E38)
            if (r0 != r1) goto L_0x0046
            r4 = 80
        L_0x001c:
            r3 = -1
            if (r0 != r1) goto L_0x0039
            r2 = -1
            r3 = -2
        L_0x0021:
            X.Fun r1 = new X.Fun
            r0 = 2131562040(0x7f0d0e38, float:1.8749498E38)
            r1.<init>(r0)
            r1.LIZIZ = r5
            r0 = 48
            r1.LJIIJJI = r0
            r1.LJI = r4
            r1.LJII = r2
            r1.LJIIIIZZ = r3
            r0 = 0
            r1.LJFF = r0
            return r1
        L_0x0039:
            if (r0 != 0) goto L_0x004c
            r0 = 1140129792(0x43f50000, float:490.0)
            int r2 = X.0b0.LIZ(r0)
            goto L_0x0021
        L_0x0042:
            r5 = 2131886595(0x7f120203, float:1.9407773E38)
            goto L_0x0048
        L_0x0046:
            if (r0 != 0) goto L_0x0052
        L_0x0048:
            r4 = 5
            goto L_0x001c
        L_0x004a:
            r0 = 1
            goto L_0x0015
        L_0x004c:
            X.7AW r0 = new X.7AW
            r0.<init>()
            throw r0
        L_0x0052:
            X.7AW r0 = new X.7AW
            r0.<init>()
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.livesdk.pip.ShareSettingsDialog.LIZ():X.Fun");
    }

    public final void onConfigurationChanged(Configuration configuration) {
        M12.LIZ(configuration);
        ShareSettingsDialog.super.onConfigurationChanged(configuration);
        if (LJIIJ()) {
            dismiss();
        }
    }

    public final void onCreate(Bundle bundle) {
        String string;
        super.onCreate(bundle);
        Bundle arguments = getArguments();
        String str = "unknown";
        if (!(arguments == null || (string = arguments.getString("enter_from", str)) == null)) {
            str = string;
        }
        this.LIZ = str;
    }

    public final LayoutInflater onGetLayoutInflater(Bundle bundle) {
        LayoutInflater cloneInContext = ShareSettingsDialog.super.onGetLayoutInflater(bundle).cloneInContext(0dh.LIZ(getActivity()));
        n.LIZIZ(cloneInContext, "");
        return cloneInContext;
    }

    public final void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        super.onViewCreated(view, bundle);
        Long l = (Long) DataChannelGlobal.LIZLLL.LIZIZ(HEJ.class);
        boolean z = false;
        if (l != null) {
            long longValue = l.longValue();
            if (longValue > C1126Fw7.RANKINGS_SWITCH_STATUS_HIDE.getValue()) {
                ConstraintLayout LIZ2 = LIZ(2131366986);
                n.LIZIZ(LIZ2, "");
                LIZ2.setVisibility(0);
                041 LIZ3 = LIZ(2131370967);
                n.LIZIZ(LIZ3, "");
                if (longValue == C1126Fw7.RANKINGS_SWITCH_STATUS_ON.getValue()) {
                    z = true;
                }
                LIZ3.setChecked(z);
                ((FrameLayout) LIZ(2131369261)).setOnClickListener(new C1125Fw6(this));
            }
        }
        if (!0b0.LJFF()) {
            View findViewById = view.findViewById(2131367514);
            findViewById.setBackground(new HYR());
            Resources system = Resources.getSystem();
            n.LIZIZ(system, "");
            Qen.LIZ(findViewById, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 90.0f, system.getDisplayMetrics()))), 0, (Integer) null, (Integer) null, false, 16);
            View findViewById2 = view.findViewById(2131367095);
            n.LIZIZ(findViewById2, "");
            findViewById2.setBackground(new ColorDrawable(805306367));
            ((TextView) view.findViewById(2131371242)).setTextColor(-1);
            ((TextView) view.findViewById(2131371482)).setTextColor(-419430401);
            ((TextView) view.findViewById(2131371481)).setTextColor(-1325400065);
        }
    }
}
