package com.ss.android.ugc.aweme.shortvideo.ui;

import X.0CC;
import X.0CD;
import X.1Bk;
import X.8gF;
import X.AnonymousClass5CV;
import X.C29866Dw;
import X.C539678o;
import X.Ltg;
import X.M12;
import android.content.Context;
import android.view.View;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import java.util.HashMap;

public final class VEVideoPublishPreviewActivityShoutOut extends Ltg {
    public static final String LJII = VEVideoPublishPreviewActivityShoutOut.class.getSimpleName();
    public static final C29866Dw LJIIIIZZ = new C29866Dw((byte) 0);
    public AnonymousClass5CV LIZLLL;
    public View LJ;
    public boolean LJFF;
    public boolean LJI;
    public final 1Bk LJIIIZ = new 1Bk(this);
    public HashMap LJIIJ;

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

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut, X.Ltg, android.app.Activity] */
    public final void onPause() {
        8gF.LIZJ(this);
        VEVideoPublishPreviewActivityShoutOut.super.onPause();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut, X.1oX, android.app.Activity] */
    public final void onStart() {
        8gF.LIZ(this);
        VEVideoPublishPreviewActivityShoutOut.super.onStart();
    }

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut", "onWindowFocusChanged", true);
        VEVideoPublishPreviewActivityShoutOut.super.onWindowFocusChanged(z);
    }

    public final 0CD getLifecycle() {
        return this.LJIIIZ;
    }

    static {
        Covode.recordClassIndex(112823);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut, X.Ltg, android.app.Activity] */
    public final void onDestroy() {
        8gF.LJ(this);
        this.LJIIIZ.LIZ(0CC.DESTROYED);
        AnonymousClass5CV r0 = this.LIZLLL;
        if (r0 != null) {
            r0.LIZIZ();
        }
        C539678o.LJ.LIZ((Context) this);
        VEVideoPublishPreviewActivityShoutOut.super.onDestroy();
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut, X.Ltg, android.app.Activity] */
    public final void onResume() {
        AnonymousClass5CV r0;
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut", "onResume", true);
        VEVideoPublishPreviewActivityShoutOut.super.onResume();
        if (!this.LJFF && !this.LJI && (r0 = this.LIZLLL) != null) {
            r0.LJI();
        }
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut", "onResume", false);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut, X.Ltg, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        VEVideoPublishPreviewActivityShoutOut.super.onStop();
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    public final void setPlayView(View view) {
        M12.LIZ(view);
        this.LJ = view;
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [android.content.Context] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onSaveInstanceState(android.os.Bundle r3) {
        /*
            r2 = this;
            X.M12.LIZ(r3)
            com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut.super.onSaveInstanceState(r3)
            X.78o r1 = X.C539678o.LJ
            r0 = r2
            r2.getIntent()
            r1.LIZ((android.content.Context) r0, (android.os.Bundle) r3)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut.onSaveInstanceState(android.os.Bundle):void");
    }

    /* JADX WARNING: type inference failed for: r3v1, types: [android.content.Context, X.0CH, com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut, X.Ltg, X.1oX, android.app.Activity] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x0144  */
    /* JADX WARNING: Removed duplicated region for block: B:42:0x0152  */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x0198  */
    /* JADX WARNING: Removed duplicated region for block: B:51:0x0218  */
    /* JADX WARNING: Removed duplicated region for block: B:54:0x022b  */
    /* JADX WARNING: Removed duplicated region for block: B:57:0x0234  */
    /* JADX WARNING: Removed duplicated region for block: B:66:0x0275  */
    /* JADX WARNING: Removed duplicated region for block: B:69:0x02b1  */
    /* JADX WARNING: Unknown variable types count: 1 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate(android.os.Bundle r18) {
        /*
            r17 = this;
            r3 = r17
            r3 = r3
            r6 = r18
            X.8gF.LIZ(r3, r6)
            java.lang.String r16 = "com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut"
            java.lang.String r2 = "onCreate"
            r4 = 1
            r0 = r16
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r0, r2, r4)
            com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut.super.onCreate(r6)
            android.view.Window r1 = r3.getWindow()
            r0 = 128(0x80, float:1.794E-43)
            r1.addFlags(r0)
            r0 = 2131558528(0x7f0d0080, float:1.8742374E38)
            r3.setContentView(r0)
            r0 = 2131368569(0x7f0a1a79, float:1.8357092E38)
            android.view.View r5 = r3.findViewById(r0)
            java.lang.String r8 = ""
            kotlin.h.b.n.LIZIZ(r5, r8)
            r3.LJ = r5
            if (r5 != 0) goto L_0x0037
            kotlin.h.b.n.LIZ(r8)
        L_0x0037:
            int r0 = X.C37926di.LIZIZ(r3)
            float r0 = (float) r0
            float r1 = -r0
            r0 = 1042536202(0x3e23d70a, float:0.16)
            float r1 = r1 * r0
            r5.setTranslationY(r1)
            X.78o r1 = X.C539678o.LJ
            android.content.Intent r0 = r3.getIntent()
            r1.LIZ((android.content.Context) r3, (android.content.Intent) r0, (android.os.Bundle) r6)
            android.view.View r1 = r3.LJ
            if (r1 != 0) goto L_0x0054
            kotlin.h.b.n.LIZ(r8)
        L_0x0054:
            X.6Dr r0 = new X.6Dr
            r0.<init>(r3)
            r1.setOnClickListener(r0)
            X.Nei r0 = new X.Nei
            r0.<init>()
            X.IDb r0 = r0.LIZ()
            X.NtX.LIZ(r0)
            r0 = 2131368809(0x7f0a1b69, float:1.8357579E38)
            android.view.View r6 = r3.findViewById(r0)
            kotlin.h.b.n.LIZIZ(r6, r8)
            android.view.SurfaceView r6 = (android.view.SurfaceView) r6
            android.content.Intent r0 = r3.getIntent()
            kotlin.h.b.n.LIZIZ(r0, r8)
            com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel r5 = X.C30456Gd.LIZ((android.content.Intent) r0)
            X.6Dq r0 = new X.6Dq
            r0.<init>(r3, r5)
            java.lang.String r1 = "VEVideoPublishPreviewActivityShoutOut.onCreate"
            X.AnonymousClass54U.LIZ((java.lang.String) r1, (X.Ls2<X.2Pr>) r0)
            X.6Dp r0 = new X.6Dp
            r0.<init>(r3, r5)
            X.AnonymousClass54U.LIZIZ(r1, r0)
            X.5CV r0 = r3.LIZLLL
            if (r0 == 0) goto L_0x0097
            r0.LJFF = r4
        L_0x0097:
            X.5CV r7 = r3.LIZLLL
            if (r7 != 0) goto L_0x009e
            kotlin.h.b.n.LIZIZ()
        L_0x009e:
            X.1Bk r12 = r3.LJIIIZ
            X.M12.LIZ(r5, r7, r12)
            int r0 = r5.mVideoCanvasWidth
            if (r0 <= 0) goto L_0x00ab
            int r0 = r5.mVideoCanvasHeight
            if (r0 > 0) goto L_0x00cd
        L_0x00ab:
            int r1 = r5.videoWidth()
            int r0 = r5.videoHeight()
            if (r0 == 0) goto L_0x00b7
            if (r1 != 0) goto L_0x00cd
        L_0x00b7:
            int r0 = r5.getOriginal()
            if (r0 != 0) goto L_0x02be
            com.ss.android.ugc.aweme.services.video.IVideoConfigService r0 = X.NtX.LJIILJJIL
        L_0x00bf:
            r0.getVideoWidth()
            int r0 = r5.getOriginal()
            if (r0 != 0) goto L_0x02ba
            com.ss.android.ugc.aweme.services.video.IVideoConfigService r0 = X.NtX.LJIILJJIL
        L_0x00ca:
            r0.getVideoHeight()
        L_0x00cd:
            r4 = 30
            r0 = 4
            r1 = 2
            r13 = 0
            dmt.av.video.VEPreviewParams r11 = X.AnonymousClass5ON.LIZ((com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel) r5, (int) r1, (int) r4, (int) r13, (int) r0)
            X.1Bn r9 = new X.1Bn
            r9.<init>()
            r9.setValue(r11)
            X.1Bn r4 = new X.1Bn
            r4.<init>()
            dmt.av.video.VEPreviewMusicParams r10 = new dmt.av.video.VEPreviewMusicParams
            r10.<init>()
            boolean r0 = r5.isFastImport
            r10.LJIIIZ = r0
            r10.LJIIIIZZ = r1
            java.lang.String r0 = r5.mMusicPath
            r10.LIZ = r0
            int r0 = r5.mMusicStart
            r10.LIZIZ = r0
            java.lang.String r0 = r5.mMusicPath
            X.M12.LIZ(r5)
            int r0 = X.OAv.LIZ(r0)
            r10.LIZJ = r0
            X.6nl r0 = X.C44156nl.LIZ()
            X.OZG r0 = r0.LIZ
            if (r0 == 0) goto L_0x02b4
            int r1 = r10.LIZJ
            X.6nl r0 = X.C44156nl.LIZ()
            X.OZG r0 = r0.LIZ
            if (r0 != 0) goto L_0x0116
            kotlin.h.b.n.LIZIZ()
        L_0x0116:
            int r0 = r0.getShootDuration()
            int r1 = r1 - r0
            int r1 = java.lang.Math.abs(r1)
            r0 = 1000(0x3e8, float:1.401E-42)
            if (r1 < r0) goto L_0x02b4
            X.6nl r0 = X.C44156nl.LIZ()
            X.OZG r0 = r0.LIZ
            if (r0 != 0) goto L_0x012e
            kotlin.h.b.n.LIZIZ()
        L_0x012e:
            int r0 = r0.getShootDuration()
            r10.LIZLLL = r0
        L_0x0134:
            float r0 = r5.musicVolume
            r10.LJ = r0
            java.lang.String r0 = r5.musicId
            r10.LJFF = r0
            X.6nl r0 = X.C44156nl.LIZ()
            X.OZG r0 = r0.LIZ
            if (r0 == 0) goto L_0x02b1
            java.lang.String r0 = r0.musicName
        L_0x0146:
            r10.LJI = r0
            float r0 = r5.previewStartTime
            r10.LJII = r0
            com.ss.android.ugc.aweme.shortvideo.stitch.StitchParams r0 = r5.getStitchParams()
            if (r0 == 0) goto L_0x0164
            com.ss.android.ugc.aweme.shortvideo.stitch.StitchParams r0 = r5.getStitchParams()
            if (r0 != 0) goto L_0x015b
            kotlin.h.b.n.LIZIZ()
        L_0x015b:
            long r0 = r0.getDuration()
            r10.LJIIJ = r13
            int r13 = (int) r0
            r10.LJIIJJI = r13
        L_0x0164:
            java.lang.Boolean r0 = r5.isSoundLoop
            kotlin.h.b.n.LIZIZ(r0, r8)
            boolean r0 = r0.booleanValue()
            r10.LJIIL = r0
            boolean r0 = X.C41606je.LIZ((com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel) r5)
            r10.LJIILIIL = r0
            r4.setValue(r10)
            X.5F0 r10 = new X.5F0
            r10.<init>()
            X.1Bn r1 = new X.1Bn
            r1.<init>()
            com.ss.android.ugc.aweme.editSticker.model.InfoStickerModel r0 = r5.infoStickerModel
            r1.setValue(r0)
            X.5DY r13 = new X.5DY
            r13.<init>()
            X.56n r0 = r7.LJJIJIIJIL
            int r0 = r0.LJ()
            X.58H r0 = X.Oli.LIZ(r0, r5)
            if (r0 == 0) goto L_0x019b
            r13.setValue(r0)
        L_0x019b:
            X.1Bn r14 = new X.1Bn
            r14.<init>()
            X.5FA r15 = new X.5FA
            com.ss.android.ugc.aweme.edit.audio.enhance.AudioEnhanceParam r0 = r5.audioEnhanceParam
            kotlin.h.b.n.LIZIZ(r0, r8)
            r15.<init>(r0)
            r14.setValue(r15)
            r7.LJI = r9
            r7.LJII = r4
            r7.LJIIJ = r10
            X.1Bn r0 = new X.1Bn
            r0.<init>()
            r7.LJIIIIZZ = r0
            X.1Bn r0 = new X.1Bn
            r0.<init>()
            r7.LJIIIZ = r0
            java.util.ArrayList r0 = new java.util.ArrayList
            r0.<init>()
            r7.LIZ((java.util.ArrayList<com.ss.android.ugc.aweme.effect.EffectPointModel>) r0)
            r7.LJIIJJI = r13
            X.5DY r9 = new X.5DY
            r9.<init>()
            r7.LJIIL = r9
            X.1Bn r0 = new X.1Bn
            r0.<init>()
            r7.LJIILJJIL = r0
            X.1Bn r0 = new X.1Bn
            r0.<init>()
            r7.LJIILL = r0
            X.1Bn r0 = new X.1Bn
            r0.<init>()
            r7.LJIILLIIL = r0
            X.1Bn r0 = new X.1Bn
            r0.<init>()
            r7.LIZ((X.1Bn<java.lang.Boolean>) r0)
            r7.LJIIZILJ = r1
            X.1Bn r4 = new X.1Bn
            r4.<init>()
            r7.LJIILIIL = r4
            X.1Bn<java.lang.Void> r13 = r7.LJJIII
            r1 = r3
            X.6Du r0 = X.C29846Du.LIZ
            r13.observe(r1, r0)
            r7.LJIL = r14
            X.0CC r0 = X.0CC.STARTED
            r12.LIZ(r0)
            r7.LIZ((android.content.Context) r3, (X.0CH) r1, (android.view.SurfaceView) r6, (com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel) r5)
            X.595 r0 = new X.595
            r0.<init>(r5, r7, r11)
            X.AnonymousClass54U.LIZ((java.lang.String) r8, (X.Ls2<X.2Pr>) r0)
            java.util.ArrayList r0 = r5.getEffectList()
            if (r0 == 0) goto L_0x0227
            java.util.ArrayList r1 = r5.getEffectList()
            boolean r0 = r5.isReverse()
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r0)
            X.AnonymousClass58G.LIZ(r1, r10, r0)
        L_0x0227:
            com.ss.android.ugc.aweme.audiorecord.AudioRecorderParam r0 = r5.veAudioRecorderParam
            if (r0 == 0) goto L_0x0230
            com.ss.android.ugc.aweme.audiorecord.AudioRecorderParam r0 = r5.veAudioRecorderParam
            r4.setValue(r0)
        L_0x0230:
            com.ss.android.ugc.aweme.shortvideo.edit.audioeffect.AudioEffectParam r0 = r5.veAudioEffectParam
            if (r0 == 0) goto L_0x0256
            com.ss.android.ugc.aweme.shortvideo.edit.audioeffect.AudioEffectParam r1 = r5.veAudioEffectParam
            if (r1 != 0) goto L_0x023b
            kotlin.h.b.n.LIZIZ()
        L_0x023b:
            r0 = 0
            r1.setShowErrorToast(r0)
            com.ss.android.ugc.aweme.shortvideo.edit.audioeffect.AudioEffectParam r1 = r5.veAudioEffectParam
            if (r1 != 0) goto L_0x0246
            kotlin.h.b.n.LIZIZ()
        L_0x0246:
            r0 = 0
            r1.setPreprocessResult(r0)
            X.57k r4 = X.C026957j.LJII
            com.ss.android.ugc.aweme.shortvideo.edit.audioeffect.AudioEffectParam r1 = r5.veAudioEffectParam
            r0 = 1
            X.57j r0 = r4.LIZ(r0, r1)
            r9.setValue(r0)
        L_0x0256:
            X.7CX r0 = X.NtX.LJJII
            X.6jC r0 = r0.LJIJI()
            X.MYu r0 = r0.LIZLLL()
            com.ss.android.ugc.aweme.filter.FilterBean r9 = X.C30456Gd.LIZ((com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel) r5, (X.MYu) r0)
            X.3Ev r4 = new X.3Ev
            r4.<init>()
            float r0 = r5.mSelectedFilterIntensity
            r4.element = r0
            float r1 = r4.element
            r0 = -1082130432(0xffffffffbf800000, float:-1.0)
            int r0 = (r1 > r0 ? 1 : (r1 == r0 ? 0 : -1))
            if (r0 != 0) goto L_0x027a
            r0 = 1061997773(0x3f4ccccd, float:0.8)
            r4.element = r0
        L_0x027a:
            X.56g r0 = new X.56g
            r0.<init>(r7, r9, r4)
            X.AnonymousClass54U.LIZ((java.lang.String) r8, (X.Ls2<X.2Pr>) r0)
            r0 = 0
            r6.setVisibility(r0)
            X.6Ds r0 = new X.6Ds
            r0.<init>(r3)
            r6.setOnClickListener(r0)
            com.ss.android.ugc.aweme.shortvideo.SafeHandler r1 = new com.ss.android.ugc.aweme.shortvideo.SafeHandler
            r1.<init>(r3)
            X.6Ik r0 = new X.6Ik
            r0.<init>(r3, r5)
            r1.post(r0)
            r0 = 2131362569(0x7f0a0309, float:1.8344922E38)
            android.view.View r1 = r3.findViewById(r0)
            X.6Dv r0 = new X.6Dv
            r0.<init>(r3)
            r1.setOnClickListener(r0)
            r1 = 0
            r0 = r16
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r0, r2, r1)
            return
        L_0x02b1:
            r0 = 0
            goto L_0x0146
        L_0x02b4:
            int r0 = r10.LIZJ
            r10.LIZLLL = r0
            goto L_0x0134
        L_0x02ba:
            com.ss.android.ugc.aweme.services.video.IVideoConfigService r0 = X.NtX.LJIILIIL
            goto L_0x00ca
        L_0x02be:
            com.ss.android.ugc.aweme.services.video.IVideoConfigService r0 = X.NtX.LJIILIIL
            goto L_0x00bf
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.shortvideo.ui.VEVideoPublishPreviewActivityShoutOut.onCreate(android.os.Bundle):void");
    }
}
