package com.ss.android.ugc.aweme.shoutouts.review;

import X.8gF;
import X.9DY;
import X.C206731n;
import X.Mk2;
import X.Mk3;
import X.OQg;
import X.PhE;
import X.PlI;
import X.SNU;
import android.content.Intent;
import android.os.Bundle;
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.ies.ugc.aweme.network.RetrofitFactory;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import com.ss.android.ugc.aweme.shoutouts.model.ShoutoutsCreatePermissionCheckApi;
import kotlin.h.b.n;

public final class ShoutOutWriteReviewActivity extends SNU {
    public OQg LIZ;
    public SparseArray LIZIZ;

    static {
        Covode.recordClassIndex(114243);
    }

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

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

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

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

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

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

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shoutouts.review.ShoutOutWriteReviewActivity", "onWindowFocusChanged", true);
        ShoutOutWriteReviewActivity.super.onWindowFocusChanged(z);
    }

    public final void finish() {
        ShoutOutWriteReviewActivity.super.finish();
        overridePendingTransition(0, 0);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [X.SNU, com.ss.android.ugc.aweme.shoutouts.review.ShoutOutWriteReviewActivity, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        ShoutOutWriteReviewActivity.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: r8v0, types: [X.1oX, X.SNU, com.ss.android.ugc.aweme.shoutouts.review.ShoutOutWriteReviewActivity, android.app.Activity] */
    public final void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shoutouts.review.ShoutOutWriteReviewActivity", "onCreate", true);
        ShoutOutWriteReviewActivity.super.onCreate(bundle);
        setContentView(2131561337);
        OQg findViewById = findViewById(2131367430);
        n.LIZIZ(findViewById, "");
        OQg oQg = findViewById;
        this.LIZ = oQg;
        if (oQg == null) {
            n.LIZ("");
        }
        oQg.LIZ();
        OQg oQg2 = this.LIZ;
        if (oQg2 == null) {
            n.LIZ("");
        }
        oQg2.setVisibility(0);
        String LIZ2 = LIZ(getIntent(), "product_id");
        String LIZ3 = LIZ(getIntent(), "order_id");
        if (LIZ2 == null || LIZ3 == null) {
            finish();
        }
        Object LIZ4 = RetrofitFactory.LIZ().LIZIZ(9DY.LJ).LIZJ().LIZ(ShoutoutsCreatePermissionCheckApi.class);
        n.LIZIZ(LIZ4, "");
        ((ShoutoutsCreatePermissionCheckApi) LIZ4).checkPermission(LIZ2, LIZ3).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).a_(new C206731n(this, LIZ2, LIZ3));
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.shoutouts.review.ShoutOutWriteReviewActivity", "onCreate", false);
    }

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