package com.bytedance.android.live.effect;

import X.C12290eh;
import X.C12670fJ;
import X.Fun;
import X.M12;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.FrameLayout;
import com.bytedance.android.livesdk.LiveDialogFragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.util.HashMap;

public final class LiveEffectContainerDialog extends LiveDialogFragment {
    public C12670fJ LIZ;
    public HashMap LIZIZ;

    static {
        Covode.recordClassIndex(5908);
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [com.bytedance.android.live.effect.LiveEffectContainerDialog, androidx.fragment.app.Fragment] */
    public final View LIZ(int i) {
        if (this.LIZIZ == null) {
            this.LIZIZ = new HashMap();
        }
        View view = (View) this.LIZIZ.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LIZIZ.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

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

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

    public final Fun LIZ() {
        Fun fun = new Fun(2131561710);
        fun.LIZIZ = 2131887279;
        fun.LJI = 80;
        fun.LJIIIIZZ = -1;
        return fun;
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.android.livesdk.LiveDialogFragment, com.bytedance.android.live.effect.LiveEffectContainerDialog, androidx.fragment.app.DialogFragment] */
    public final void onStart() {
        Window window;
        Window window2;
        LiveEffectContainerDialog.super.onStart();
        Dialog dialog = getDialog();
        if (!(dialog == null || (window2 = dialog.getWindow()) == null)) {
            window2.addFlags(Integer.MIN_VALUE);
        }
        Dialog dialog2 = getDialog();
        if (!(dialog2 == null || (window = dialog2.getWindow()) == null)) {
            window.setStatusBarColor(0);
        }
        C12670fJ r0 = this.LIZ;
        if (r0 != null) {
            r0.LIZ();
        }
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [androidx.fragment.app.DialogFragment] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate(android.os.Bundle r3) {
        /*
            r2 = this;
            com.bytedance.android.live.effect.LiveEffectContainerDialog.super.onCreate(r3)
            X.0fJ r1 = r2.LIZ
            if (r1 == 0) goto L_0x000b
            r0 = r2
            r1.LIZ(r0)
        L_0x000b:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.effect.LiveEffectContainerDialog.onCreate(android.os.Bundle):void");
    }

    /* JADX WARNING: type inference failed for: r4v0, types: [com.bytedance.android.livesdk.LiveDialogFragment, com.bytedance.android.live.effect.LiveEffectContainerDialog, androidx.fragment.app.Fragment] */
    public final void onDismiss(DialogInterface dialogInterface) {
        FrameLayout frameLayout;
        View view;
        MethodCollector.i(11646);
        LiveEffectContainerDialog.super.onDismiss(dialogInterface);
        C12670fJ r0 = this.LIZ;
        if (r0 != null) {
            r0.LIZIZ();
        }
        View view2 = getView();
        if (!(view2 == null || (frameLayout = (FrameLayout) view2.findViewById(2131364444)) == null)) {
            C12670fJ r02 = this.LIZ;
            if (r02 != null) {
                view = r02.LIZJ();
            } else {
                view = null;
            }
            frameLayout.removeView(view);
        }
        this.LIZ = null;
        MethodCollector.o(11646);
    }

    /* JADX WARNING: type inference failed for: r4v0, types: [com.bytedance.android.livesdk.LiveDialogFragment, com.bytedance.android.live.effect.LiveEffectContainerDialog, androidx.fragment.app.DialogFragment] */
    public final void onViewCreated(View view, Bundle bundle) {
        View LIZJ;
        MethodCollector.i(11413);
        M12.LIZ(view);
        LiveEffectContainerDialog.super.onViewCreated(view, bundle);
        view.setOnClickListener(new C12290eh(this));
        C12670fJ r0 = this.LIZ;
        View view2 = null;
        if (r0 == null || (LIZJ = r0.LIZJ()) == null || LIZJ.getParent() == null) {
            FrameLayout frameLayout = (FrameLayout) view.findViewById(2131364444);
            C12670fJ r02 = this.LIZ;
            if (r02 != null) {
                view2 = r02.LIZJ();
            }
            frameLayout.addView(view2);
            MethodCollector.o(11413);
            return;
        }
        dismiss();
        MethodCollector.o(11413);
    }
}
