package com.ss.android.ugc.aweme.ecommerce.review.gallery;

import X.0AP;
import X.8gF;
import X.AnonymousClass2RS;
import X.AnonymousClass3T4;
import X.AnonymousClass3T9;
import X.CWJ;
import X.LWw;
import X.Szo;
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.sysoptimizer.EnterTransitionCrashOptimizer;
import com.ss.android.ugc.aweme.ecommerce.track.TrackerProvider;
import java.util.HashMap;
import java.util.Map;
import kotlin.h.b.n;

public final class ReviewGalleryActivity extends CWJ {
    public SparseArray LIZ;

    static {
        Covode.recordClassIndex(72099);
    }

    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;
    }

    public final String ck_() {
        return "review_photo";
    }

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

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

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

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

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

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.ecommerce.review.gallery.ReviewGalleryActivity, android.app.Activity, X.CWJ] */
    public final void finish() {
        ReviewGalleryActivity.super.finish();
        AnonymousClass3T4.LIZ.LIZ(this, 2, false);
    }

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

    public static Bundle LIZ(Intent intent) {
        try {
            return intent.getExtras();
        } catch (Exception unused) {
            return null;
        }
    }

    /* JADX WARNING: type inference failed for: r9v0, types: [com.ss.android.ugc.aweme.ecommerce.review.gallery.ReviewGalleryActivity, X.1hK, X.SNU, android.app.Activity, X.CWJ] */
    public final void onCreate(Bundle bundle) {
        Object obj;
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.review.gallery.ReviewGalleryActivity", "onCreate", true);
        ReviewGalleryActivity.super.onCreate(bundle);
        setContentView(2131559170);
        setTheme(2131886667);
        AnonymousClass3T4.LIZ.LIZ(this, 2, true);
        Szo LIZ2 = Szo.LIZIZ.LIZ(this);
        LIZ2.LIZIZ(true);
        LIZ2.LIZ();
        LIZ2.LIZ.LIZJ();
        AnonymousClass3T9 r5 = AnonymousClass3T9.LIZ;
        try {
            obj = r5.LIZ().LIZ(LIZ(getIntent(), "track_params"), Map.class);
        } catch (Exception unused) {
            obj = null;
        }
        Map map = (Map) obj;
        if (map == null) {
            map = new HashMap();
        }
        String LIZ3 = LIZ(getIntent(), "review_product_id_key");
        if (LIZ3 == null) {
            LIZ3 = "";
        }
        n.LIZIZ(LIZ3, "");
        Map LIZLLL = LWw.LIZLLL(map);
        LIZLLL.put("page_name", "review_photo");
        LIZLLL.put("product_id", LIZ3);
        LIZLLL.putAll(map);
        LIZLLL.put("EVENT_ORIGIN_FEATURE", "TEMAI");
        TrackerProvider.LIZIZ.LIZ(this, new AnonymousClass2RS(LIZLLL));
        0AP LIZ4 = getSupportFragmentManager().LIZ();
        ReviewGalleryFragment reviewGalleryFragment = new ReviewGalleryFragment();
        reviewGalleryFragment.setArguments(LIZ(getIntent()));
        LIZ4.LIZIZ(2131369724, reviewGalleryFragment);
        LIZ4.LIZJ();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.ecommerce.review.gallery.ReviewGalleryActivity", "onCreate", false);
    }

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