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

import X.4ZZ;
import X.6GL;
import X.6Tu;
import X.6Up;
import X.776;
import X.7E3;
import X.7he;
import X.8gF;
import X.C4139NsE;
import X.C4140NsF;
import X.Crj;
import android.app.Activity;
import android.view.View;
import android.widget.ImageView;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import java.util.HashMap;
import kotlin.h.b.n;

public final class ImagePublishPreviewActivity extends 6GL {
    public static final C4140NsF LJFF = new C4140NsF((byte) 0);
    public 7E3 LJ;
    public final Crj LJI = 7he.LIZ(new C4139NsE(this));
    public HashMap LJII;

    static {
        Covode.recordClassIndex(112752);
    }

    public final void LJIIIIZZ() {
    }

    public final ImageView LJIIJJI() {
        return (ImageView) this.LJI.getValue();
    }

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

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

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

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.shortvideo.ui.ImagePublishPreviewActivity, X.6GL, android.app.Activity] */
    public final void onResume() {
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.ImagePublishPreviewActivity", "onResume", true);
        ImagePublishPreviewActivity.super.onResume();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shortvideo.ui.ImagePublishPreviewActivity", "onResume", false);
    }

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

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

    public final void onBackPressed() {
        ImagePublishPreviewActivity.super.onBackPressed();
        7E3 r1 = this.LJ;
        if (r1 == null) {
            n.LIZ("");
        }
        r1.LJJIJIIJI();
    }

    public final void finishAfterTransition() {
        LJIIJJI().setAlpha(0.0f);
        LJIIJJI().setVisibility(0);
        ImagePublishPreviewActivity.super.finishAfterTransition();
    }

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

    /* JADX WARNING: type inference failed for: r0v1, types: [X.OcX, android.view.View] */
    public final void LIZIZ(boolean z) {
        int i;
        7E3 r4 = this.LJ;
        if (r4 == null) {
            n.LIZ("");
        }
        if (z) {
            i = 6Up.LIZ.LIZ();
        } else {
            i = 0;
        }
        776 r0 = r4.LIZ;
        if (r0 == null) {
            n.LIZ("");
        }
        r0.setBottomMargin(i);
        ? r02 = r4.LJI;
        if (r02 == 0) {
            n.LIZ("");
        }
        r4.LIZ(r02, i);
        4ZZ r1 = r4.LJIIJJI;
        if (r1 == null) {
            n.LIZ("");
        }
        r4.LIZ(r1, i / 2);
        View view = r4.LJIIJ;
        if (view == null) {
            n.LIZ("");
        }
        r4.LIZ(view, i);
    }

    public final void LIZ(boolean z) {
        7E3 r4 = this.LJ;
        if (r4 == null) {
            n.LIZ("");
        }
        Activity LJIJJ = r4.LJIJJ();
        n.LIZIZ(LJIJJ, "");
        int LIZ = (int) 6Tu.LIZ(LJIJJ, 13.0f);
        Activity LJIJJ2 = r4.LJIJJ();
        n.LIZIZ(LJIJJ2, "");
        int LIZ2 = (int) 6Tu.LIZ(LJIJJ2, 3.0f);
        776 r0 = r4.LIZ;
        if (r0 == null) {
            n.LIZ("");
        }
        r4.LIZ(r0, true, LIZ);
        ImageView imageView = r4.LIZIZ;
        if (imageView == null) {
            n.LIZ("");
        }
        r4.LIZ(imageView, true, LIZ2);
        ImageView imageView2 = r4.LJ;
        if (imageView2 == null) {
            n.LIZ("");
        }
        r4.LIZ(imageView2, true, LIZ2);
        View view = r4.LJIIIZ;
        if (view == null) {
            n.LIZ("");
        }
        r4.LIZ(view, false, 0);
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r5v0, resolved type: android.app.Activity} */
    /* JADX WARNING: type inference failed for: r0v17, types: [android.transition.Transition$TransitionListener, X.NsB] */
    /* JADX WARNING: type inference failed for: r0v19, types: [android.transition.Transition$TransitionListener, X.NsA] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate(android.os.Bundle r12) {
        /*
            r11 = this;
            X.8gF.LIZ(r11, r12)
            java.lang.String r3 = "com.ss.android.ugc.aweme.shortvideo.ui.ImagePublishPreviewActivity"
            java.lang.String r2 = "onCreate"
            r8 = 1
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r3, r2, r8)
            android.view.Window r1 = r11.getWindow()
            r0 = 12
            r1.requestFeature(r0)
            android.view.Window r0 = r11.getWindow()
            java.lang.String r4 = ""
            kotlin.h.b.n.LIZIZ(r0, r4)
            r0.setSharedElementsUseOverlay(r8)
            com.ss.android.ugc.aweme.shortvideo.ui.ImagePublishPreviewActivity.super.onCreate(r12)
            android.view.Window r1 = r11.getWindow()
            r0 = 128(0x80, float:1.794E-43)
            r1.addFlags(r0)
            r0 = 2131558489(0x7f0d0059, float:1.8742295E38)
            r11.setContentView(r0)
            android.graphics.Bitmap r1 = com.ss.android.ugc.aweme.shortvideo.transition.VideoCoverBitmapHolder.LIZ
            if (r1 == 0) goto L_0x0046
            android.widget.ImageView r0 = r11.LJIIJJI()
            r0.setImageBitmap(r1)
            android.widget.ImageView r1 = r11.LJIIJJI()
            android.widget.ImageView$ScaleType r0 = android.widget.ImageView.ScaleType.CENTER_CROP
            r1.setScaleType(r0)
        L_0x0046:
            r5 = r11
            android.view.Window r9 = r5.getWindow()
            kotlin.h.b.n.LIZIZ(r9, r4)
            android.transition.TransitionSet r7 = new android.transition.TransitionSet
            r7.<init>()
            android.transition.ChangeBounds r0 = new android.transition.ChangeBounds
            r0.<init>()
            r7.addTransition(r0)
            android.transition.ChangeTransform r0 = new android.transition.ChangeTransform
            r0.<init>()
            r7.addTransition(r0)
            android.transition.ChangeClipBounds r0 = new android.transition.ChangeClipBounds
            r0.<init>()
            r7.addTransition(r0)
            android.transition.Fade r0 = new android.transition.Fade
            r0.<init>(r8)
            r7.addTransition(r0)
            r0 = 342(0x156, double:1.69E-321)
            r7.setDuration(r0)
            X.5rs r6 = new X.5rs
            r6.<init>()
            r7.setInterpolator(r6)
            r9.setSharedElementEnterTransition(r7)
            android.view.Window r10 = r5.getWindow()
            kotlin.h.b.n.LIZIZ(r10, r4)
            android.transition.TransitionSet r7 = new android.transition.TransitionSet
            r7.<init>()
            android.transition.ChangeBounds r6 = new android.transition.ChangeBounds
            r6.<init>()
            r7.addTransition(r6)
            android.transition.ChangeTransform r6 = new android.transition.ChangeTransform
            r6.<init>()
            r7.addTransition(r6)
            android.transition.ChangeClipBounds r6 = new android.transition.ChangeClipBounds
            r6.<init>()
            r7.addTransition(r6)
            android.transition.Fade r6 = new android.transition.Fade
            r9 = 2
            r6.<init>(r9)
            r7.addTransition(r6)
            r7.setDuration(r0)
            X.5rs r6 = new X.5rs
            r6.<init>()
            r7.setInterpolator(r6)
            r10.setSharedElementReturnTransition(r7)
            android.transition.Fade r7 = new android.transition.Fade
            r7.<init>(r8)
            r7.setDuration(r0)
            android.view.animation.LinearInterpolator r6 = new android.view.animation.LinearInterpolator
            r6.<init>()
            r7.setInterpolator(r6)
            android.view.Window r6 = r5.getWindow()
            kotlin.h.b.n.LIZIZ(r6, r4)
            r6.setEnterTransition(r7)
            android.transition.Fade r6 = new android.transition.Fade
            r6.<init>(r9)
            r6.setDuration(r0)
            android.view.animation.LinearInterpolator r0 = new android.view.animation.LinearInterpolator
            r0.<init>()
            r6.setInterpolator(r0)
            android.view.Window r0 = r5.getWindow()
            kotlin.h.b.n.LIZIZ(r0, r4)
            r0.setExitTransition(r6)
            android.view.Window r0 = r5.getWindow()
            kotlin.h.b.n.LIZIZ(r0, r4)
            android.transition.Transition r7 = r0.getEnterTransition()
            android.view.Window r0 = r5.getWindow()
            kotlin.h.b.n.LIZIZ(r0, r4)
            android.transition.Transition r6 = r0.getExitTransition()
            java.lang.String r1 = "android:navigation:background"
            java.lang.String r0 = "android:status:background"
            if (r7 == 0) goto L_0x0114
            r7.excludeTarget(r0, r8)
            r7.excludeTarget(r1, r8)
        L_0x0114:
            if (r6 == 0) goto L_0x011c
            r6.excludeTarget(r0, r8)
            r6.excludeTarget(r1, r8)
        L_0x011c:
            r0 = 2131365898(0x7f0a100a, float:1.8351674E38)
            android.view.View r1 = r11.findViewById(r0)
            java.lang.String r0 = "transition_view_v1"
            r1.setTransitionName(r0)
            android.view.Window r0 = r11.getWindow()
            kotlin.h.b.n.LIZIZ(r0, r4)
            android.transition.Transition r1 = r0.getSharedElementEnterTransition()
            X.NsB r0 = new X.NsB
            r0.<init>(r11)
            r1.addListener(r0)
            android.view.Window r0 = r11.getWindow()
            kotlin.h.b.n.LIZIZ(r0, r4)
            android.transition.Transition r1 = r0.getSharedElementReturnTransition()
            X.NsA r0 = new X.NsA
            r0.<init>(r11)
            r1.addListener(r0)
            X.M12.LIZ(r11)
            android.app.FragmentManager r0 = r11.getFragmentManager()
            java.lang.String r4 = "ALS.ActivityLifecycleFragment"
            android.app.Fragment r1 = r0.findFragmentByTag(r4)
            boolean r0 = r1 instanceof X.1Hr
            if (r0 != 0) goto L_0x019f
        L_0x015f:
            X.1Hr r1 = new X.1Hr
            r1.<init>()
            android.app.FragmentManager r0 = r11.getFragmentManager()
            android.app.FragmentTransaction r0 = r0.beginTransaction()
            android.app.FragmentTransaction r0 = r0.add(r1, r4)
            r0.commit()
            android.app.FragmentManager r0 = r11.getFragmentManager()
            r0.executePendingTransactions()
        L_0x017a:
            X.7E3 r0 = new X.7E3
            r0.<init>()
            r11.LJ = r0
            java.lang.Class<X.7E3> r0 = X.7E3.class
            X.ODZ r1 = X.C5906Ofd.LIZ((android.app.Activity) r5, (java.lang.Class<? extends X.C5924Ofv>) r0)
            r0 = 2131372958(0x7f0a2b9e, float:1.8365994E38)
            r1.LIZLLL = r0
            X.NsD r0 = new X.NsD
            r0.<init>(r11)
            r1.LJFF = r0
            r0 = 0
            r1.LJ = r0
            r1.LJI = r0
            r1.LIZ()
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r3, r2, r0)
            return
        L_0x019f:
            if (r1 != 0) goto L_0x017a
            goto L_0x015f
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.shortvideo.ui.ImagePublishPreviewActivity.onCreate(android.os.Bundle):void");
    }
}
