package com.ss.android.ugc.aweme.donation.webpage;

import X.8gF;
import X.9Y3;
import X.C0385K1w;
import X.C0386K1x;
import X.C2041KmO;
import X.C2285KqK;
import X.C2289KqO;
import X.DNU;
import X.K2H;
import X.K2K;
import X.SNU;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.SparseArray;
import android.view.View;
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 DonationWebPageDialogActivity extends SNU {
    public static final K2H LIZ = new K2H((byte) 0);
    public C2041KmO LIZIZ;
    public C2285KqK LIZJ;
    public long LIZLLL = -1;
    public SparseArray LJ;

    static {
        Covode.recordClassIndex(66383);
    }

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

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

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

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

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

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

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.donation.webpage.DonationWebPageDialogActivity", "onWindowFocusChanged", true);
        DonationWebPageDialogActivity.super.onWindowFocusChanged(z);
    }

    public final void onBackPressed() {
        C2285KqK kqK = this.LIZJ;
        if (kqK == null) {
            n.LIZ("");
        }
        C2289KqO LJFF = kqK.LJFF();
        if (LJFF == null || !LJFF.LIZ()) {
            DonationWebPageDialogActivity.super.onBackPressed();
        }
    }

    public final void finish() {
        if (DNU.LIZ.LIZ() && SystemClock.elapsedRealtime() - this.LIZLLL > ((long) (9Y3.LIZ(9Y3.LIZ(), true, "donation_flow_timer_threshold", 0) * 1000))) {
            setResult(-1);
        }
        DonationWebPageDialogActivity.super.finish();
        DonationWebPageDialogActivity.super.overridePendingTransition(0, 2130772013);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.donation.webpage.DonationWebPageDialogActivity, X.SNU, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        DonationWebPageDialogActivity.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: r7v0, types: [com.ss.android.ugc.aweme.donation.webpage.DonationWebPageDialogActivity, X.SNU, android.app.Activity] */
    public final void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.donation.webpage.DonationWebPageDialogActivity", "onCreate", true);
        activityConfiguration(C0386K1x.LIZ);
        DonationWebPageDialogActivity.super.onCreate(bundle);
        setContentView(2131559585);
        DonationWebPageDialogActivity.super.overridePendingTransition(2130772011, 0);
        C2041KmO LIZ2 = K2K.LIZ(getIntent());
        n.LIZIZ(LIZ2, "");
        this.LIZIZ = LIZ2;
        C2041KmO kmO = this.LIZIZ;
        if (kmO == null) {
            n.LIZ("");
        }
        C2285KqK kqK = new C2285KqK(this, kmO, (byte) 0);
        this.LIZJ = kqK;
        kqK.LIZ();
        C2285KqK kqK2 = this.LIZJ;
        if (kqK2 == null) {
            n.LIZ("");
        }
        kqK2.LJ = new C0385K1w(this);
        this.LIZLLL = SystemClock.elapsedRealtime();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.donation.webpage.DonationWebPageDialogActivity", "onCreate", false);
    }
}
