package com.ss.android.ugc.aweme.compliance.business.report;

import X.2UX;
import X.2nK;
import X.4vX;
import X.8gF;
import X.C0298Jyn;
import X.C2041KmO;
import X.C2286KqL;
import X.C2289KqO;
import X.CWM;
import X.HxD;
import X.M12;
import X.SNU;
import android.content.Intent;
import android.util.SparseArray;
import android.view.View;
import android.view.animation.Animation;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import kotlin.h.b.n;

public final class ReportWebPageDialogActivity extends SNU implements C0298Jyn {
    public static final 4vX LIZJ = new 4vX((byte) 0);
    public Animation LIZ;
    public int LIZIZ;
    public CWM LIZLLL;
    public C2041KmO LJ;
    public C2286KqL LJFF;
    public int LJI;
    public long LJII;
    public SparseArray LJIIIIZZ;

    static {
        Covode.recordClassIndex(61120);
    }

    public final void _$_clearFindViewByIdCache() {
        SparseArray sparseArray = this.LJIIIIZZ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final View _$_findCachedViewById(int i) {
        if (this.LJIIIIZZ == null) {
            this.LJIIIIZZ = new SparseArray();
        }
        View view = (View) this.LJIIIIZZ.get(i);
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.LJIIIIZZ.put(i, findViewById);
        return findViewById;
    }

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

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

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity, X.SNU, android.app.Activity] */
    public final void onStart() {
        8gF.LIZ(this);
        ReportWebPageDialogActivity.super.onStart();
    }

    public final void onBackPressed() {
        C2286KqL kqL = this.LJFF;
        if (kqL == null) {
            n.LIZ("");
        }
        C2289KqO LJFF2 = kqL.LJFF();
        if (LJFF2 == null || !LJFF2.LIZ()) {
            finish();
        }
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity, X.SNU, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        ReportWebPageDialogActivity.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: r1v1, types: [android.content.Context] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void finish() {
        /*
            r3 = this;
            r2 = 5179(0x143b, float:7.257E-42)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r2)
            int r1 = r3.LIZIZ
            r0 = 2
            if (r1 > r0) goto L_0x004a
            android.view.animation.Animation r0 = r3.LIZ
            if (r0 == 0) goto L_0x0011
            r0.cancel()
        L_0x0011:
            r1 = r3
            r0 = 2130772014(0x7f01002e, float:1.7147134E38)
            android.view.animation.Animation r1 = android.view.animation.AnimationUtils.loadAnimation(r1, r0)
            r3.LIZ = r1
            if (r1 == 0) goto L_0x003a
            X.LBA r0 = new X.LBA
            r0.<init>(r3)
            r1.setAnimationListener(r0)
            r0 = 2131363852(0x7f0a080c, float:1.8347525E38)
            android.view.View r1 = r3._$_findCachedViewById(r0)
            X.HxD r1 = (X.HxD) r1
            android.view.animation.Animation r0 = r3.LIZ
            r1.startAnimation(r0)
            r0 = 3
            r3.LIZIZ = r0
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r2)
            return
        L_0x003a:
            r0 = 4
            r3.LIZIZ = r0
            boolean r0 = r3.isFinishing()
            if (r0 != 0) goto L_0x004a
            com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity.super.finish()
            r0 = 0
            r3.overridePendingTransition(r0, r0)
        L_0x004a:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r2)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity.finish():void");
    }

    /* JADX WARNING: type inference failed for: r7v0, types: [com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity, X.SNU, android.app.Activity] */
    public final void onDestroy() {
        8gF.LJ(this);
        long currentTimeMillis = System.currentTimeMillis();
        2UX r4 = new 2UX();
        r4.LIZ("enter_time", this.LJII);
        r4.LIZ("exit_time", currentTimeMillis);
        r4.LIZ("duration", currentTimeMillis - this.LJII);
        r4.LIZ("enter_from", LIZ(getIntent(), "enter_from"));
        r4.LIZ("object_id", LIZ(getIntent(), "object_id"));
        2nK.LIZ("tns_report_webview", r4.LIZ);
        ReportWebPageDialogActivity.super.onDestroy();
    }

    public final void setActivityResultListener(CWM cwm) {
        M12.LIZ((Object) cwm);
        this.LIZLLL = cwm;
    }

    public final void LIZ(int i) {
        int i2 = this.LJI;
        if (i2 == 0) {
            return;
        }
        if (i > i2) {
            HxD _$_findCachedViewById = _$_findCachedViewById(2131363852);
            n.LIZIZ(_$_findCachedViewById, "");
            _$_findCachedViewById.getLayoutParams().height = this.LJI;
            return;
        }
        HxD _$_findCachedViewById2 = _$_findCachedViewById(2131363852);
        n.LIZIZ(_$_findCachedViewById2, "");
        _$_findCachedViewById2.getLayoutParams().height = -1;
    }

    /* JADX WARNING: type inference failed for: r1v3, types: [android.content.Context] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onWindowFocusChanged(boolean r6) {
        /*
            r5 = this;
            r4 = 5174(0x1436, float:7.25E-42)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r4)
            java.lang.String r1 = "com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity"
            java.lang.String r0 = "onWindowFocusChanged"
            r3 = 1
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r1, r0, r3)
            com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity.super.onWindowFocusChanged(r6)
            if (r6 == 0) goto L_0x0057
            int r0 = r5.LIZIZ
            if (r0 > 0) goto L_0x0057
            android.view.animation.Animation r0 = r5.LIZ
            if (r0 == 0) goto L_0x001d
            r0.cancel()
        L_0x001d:
            r2 = 2131363852(0x7f0a080c, float:1.8347525E38)
            android.view.View r1 = r5._$_findCachedViewById(r2)
            X.HxD r1 = (X.HxD) r1
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)
            r0 = 0
            r1.setTranslationY(r0)
            r1 = r5
            r0 = 2130772012(0x7f01002c, float:1.714713E38)
            android.view.animation.Animation r1 = android.view.animation.AnimationUtils.loadAnimation(r1, r0)
            r5.LIZ = r1
            if (r1 == 0) goto L_0x0054
            X.LBB r0 = new X.LBB
            r0.<init>(r5)
            r1.setAnimationListener(r0)
            android.view.View r1 = r5._$_findCachedViewById(r2)
            X.HxD r1 = (X.HxD) r1
            android.view.animation.Animation r0 = r5.LIZ
            r1.startAnimation(r0)
            r5.LIZIZ = r3
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r4)
            return
        L_0x0054:
            r0 = 2
            r5.LIZIZ = r0
        L_0x0057:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r4)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity.onWindowFocusChanged(boolean):void");
    }

    /* JADX WARNING: type inference failed for: r6v0, types: [X.4Qh, com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity, X.SNU, android.app.Activity] */
    /* JADX WARNING: type inference failed for: r6v1, types: [android.content.Context, X.4Qh, com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity, X.1oX] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* 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;
            r6 = r17
            r1 = r18
            X.8gF.LIZ(r6, r1)
            java.lang.String r5 = "com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity"
            java.lang.String r4 = "onCreate"
            r8 = 1
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r5, r4, r8)
            X.LB9 r0 = X.LB9.LIZ
            r6.activityConfiguration(r0)
            com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity.super.onCreate(r1)
            long r0 = java.lang.System.currentTimeMillis()
            r6.LJII = r0
            r0 = 2131559405(0x7f0d03ed, float:1.8744153E38)
            r6.setContentView(r0)
            android.content.Intent r1 = r6.getIntent()
            java.lang.String r0 = "enter_from"
            java.lang.String r1 = LIZ(r1, r0)
            java.lang.String r7 = ""
            if (r1 != 0) goto L_0x0032
            r1 = r7
        L_0x0032:
            kotlin.h.b.n.LIZIZ(r1, r7)
            X.Igo r2 = X.Igo.LIZ
            X.M12.LIZ((java.lang.Object) r1)
            java.lang.String r0 = "im"
            boolean r0 = kotlin.h.b.n.LIZ(r1, r0)
            r3 = 0
            if (r0 == 0) goto L_0x0110
            int r1 = r2.LIZ()
            r0 = 2
            if (r1 == r0) goto L_0x0051
            int r1 = r2.LIZ()
            r0 = 3
            if (r1 != r0) goto L_0x0110
        L_0x0051:
            r2 = 2131363852(0x7f0a080c, float:1.8347525E38)
            if (r8 == 0) goto L_0x0077
            android.view.View r0 = r6._$_findCachedViewById(r2)
            X.HxD r0 = (X.HxD) r0
            kotlin.h.b.n.LIZIZ(r0, r7)
            android.animation.LayoutTransition r1 = r0.getLayoutTransition()
            r0 = 4
            r1.enableTransitionType(r0)
            android.view.View r0 = r6._$_findCachedViewById(r2)
            X.HxD r0 = (X.HxD) r0
            kotlin.h.b.n.LIZIZ(r0, r7)
            android.view.ViewGroup$LayoutParams r1 = r0.getLayoutParams()
            r0 = -2
            r1.height = r0
        L_0x0077:
            r6.overridePendingTransition(r3, r3)
            android.content.Intent r0 = r6.getIntent()
            X.KmO r0 = X.K2K.LIZ(r0)
            kotlin.h.b.n.LIZIZ(r0, r7)
            r6.LJ = r0
            android.content.Intent r1 = r6.getIntent()
            java.lang.String r0 = "half_screen_height"
            int r0 = r1.getIntExtra(r0, r3)
            r6.LJI = r0
            r6 = r6
            int r0 = X.3G1.LIZ(r6)
            r6.LIZ((int) r0)
            android.view.View r10 = r6._$_findCachedViewById(r2)
            X.HxD r10 = (X.HxD) r10
            kotlin.h.b.n.LIZIZ(r10, r7)
            r11 = 0
            android.content.res.Resources r9 = r6.getResources()
            java.lang.String r8 = "status_bar_height"
            java.lang.String r1 = "dimen"
            java.lang.String r0 = "android"
            int r1 = r9.getIdentifier(r8, r1, r0)
            if (r1 <= 0) goto L_0x010e
            android.content.res.Resources r0 = r6.getResources()
            int r0 = r0.getDimensionPixelSize(r1)
        L_0x00bd:
            java.lang.Integer r12 = java.lang.Integer.valueOf(r0)
            r13 = 0
            r14 = 0
            r15 = 0
            r16 = 29
            X.Qen.LIZIZ(r10, r11, r12, r13, r14, r15, r16)
            android.view.View r1 = r6._$_findCachedViewById(r2)
            X.HxD r1 = (X.HxD) r1
            kotlin.h.b.n.LIZIZ(r1, r7)
            int r0 = X.3G1.LIZ(r6)
            float r0 = (float) r0
            r1.setTranslationY(r0)
            r0 = 2131364128(0x7f0a0920, float:1.8348084E38)
            android.view.View r1 = r6._$_findCachedViewById(r0)
            X.LBC r0 = new X.LBC
            r0.<init>(r6)
            r1.setOnClickListener(r0)
            X.Krw r2 = new X.Krw
            r1 = r6
            X.KmO r0 = r6.LJ
            if (r0 != 0) goto L_0x00f3
            kotlin.h.b.n.LIZ(r7)
        L_0x00f3:
            r2.<init>(r6, r1, r0)
            r6.LJFF = r2
            r2.LIZ()
            r0 = 2131369737(0x7f0a1f09, float:1.835946E38)
            android.view.View r1 = r6._$_findCachedViewById(r0)
            X.LBD r0 = new X.LBD
            r0.<init>(r6)
            androidx.core.g.t.LIZ(r1, r0)
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r5, r4, r3)
            return
        L_0x010e:
            r0 = 0
            goto L_0x00bd
        L_0x0110:
            r8 = 0
            goto L_0x0051
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity.onCreate(android.os.Bundle):void");
    }

    public static String LIZ(Intent intent, String str) {
        try {
            return intent.getStringExtra(str);
        } catch (Exception unused) {
            return null;
        }
    }

    public final void onActivityResult(int i, int i2, Intent intent) {
        ReportWebPageDialogActivity.super.onActivityResult(i, i2, intent);
        CWM cwm = this.LIZLLL;
        if (cwm != null) {
            cwm.LIZ(i, i2, intent);
        }
    }
}
