package com.ss.android.ugc.aweme.ecommerce.semipdp;

import X.0AP;
import X.2dc;
import X.8gF;
import X.C6192CSe;
import X.C6489CbV;
import X.CWJ;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
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 com.ss.android.ugc.aweme.ecommerce.pdp.repository.dto.ProductPackStruct;
import com.ss.android.ugc.aweme.ecommerce.semipdp.SemiPdpStarter;
import java.io.Serializable;

public final class SemiPdpActivity extends CWJ {
    public SparseArray LIZ;

    static {
        Covode.recordClassIndex(72371);
    }

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

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

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

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

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

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

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.semipdp.SemiPdpActivity", "onWindowFocusChanged", true);
        SemiPdpActivity.super.onWindowFocusChanged(z);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.ecommerce.semipdp.SemiPdpActivity, X.SNU, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        SemiPdpActivity.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: r12v0, types: [X.1hK, com.ss.android.ugc.aweme.ecommerce.semipdp.SemiPdpActivity, X.SNU, android.app.Activity, X.CWJ] */
    public final void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.semipdp.SemiPdpActivity", "onCreate", true);
        activityConfiguration(C6192CSe.LIZ);
        super.onCreate(bundle);
        setContentView(2131559111);
        String LIZ2 = LIZ(getIntent(), "ENTER_PARAMS");
        String LIZ3 = LIZ(getIntent(), "product_info");
        int intExtra = getIntent().getIntExtra("ERROR_CODE", 0);
        SemiPdpFragment semiPdpFragment = new SemiPdpFragment();
        Bundle bundle2 = new Bundle();
        bundle2.putSerializable("ENTER_PARAMS", (Serializable) 2dc.LIZ(LIZ2, SemiPdpStarter.SemiPdpEnterParams.class));
        bundle2.putParcelable("product_info", (Parcelable) 2dc.LIZ(LIZ3, ProductPackStruct.class));
        bundle2.putInt("ERROR_CODE", intExtra);
        semiPdpFragment.setArguments(bundle2);
        C6489CbV.LIZ(this).LIZIZ();
        0AP LIZ4 = getSupportFragmentManager().LIZ();
        LIZ4.LIZ(2131365158, semiPdpFragment, "SemiPdpFragment");
        LIZ4.LIZJ();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.semipdp.SemiPdpActivity", "onCreate", false);
    }

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