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

import X.CVJ;
import X.CW4;
import X.CWJ;
import X.CWK;
import X.CYQ;
import X.CYU;
import X.CYW;
import X.CZ8;
import X.M12;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.SparseArray;
import android.view.View;
import android.view.Window;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.base.fragment.AmeBaseFragment;
import java.util.List;
import java.util.Map;
import kotlin.h.b.n;

public class ECBaseFragment extends AmeBaseFragment implements CVJ {
    public long LIZ = SystemClock.elapsedRealtime();
    public SparseArray LIZIZ;

    static {
        Covode.recordClassIndex(69758);
    }

    public View LIZ(int i) {
        if (this.LIZIZ == null) {
            this.LIZIZ = new SparseArray();
        }
        View view = (View) this.LIZIZ.get(i);
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LIZIZ.put(i, findViewById);
        return findViewById;
    }

    public void LJII() {
        SparseArray sparseArray = this.LIZIZ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final String ce_() {
        return "page_name";
    }

    public /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        LJII();
    }

    public final Map<String, String> cd_() {
        return CYQ.LIZIZ;
    }

    public List<String> getRegisteredLane() {
        return CYQ.LIZ;
    }

    public final CZ8 cf_() {
        return CYU.LIZIZ((Object) this);
    }

    public final long cg_() {
        return SystemClock.elapsedRealtime() - this.LIZ;
    }

    public String ck_() {
        String simpleName = getClass().getSimpleName();
        n.LIZIZ(simpleName, "");
        return simpleName;
    }

    public final CZ8 cc_() {
        CZ8 LIZ2 = CYU.LIZ((Object) this);
        if (LIZ2 != null) {
            return LIZ2;
        }
        Context context = getContext();
        if (!(context instanceof CWJ)) {
            context = null;
        }
        return (CWJ) context;
    }

    public void onStart() {
        Dialog dialog;
        Window window;
        Fragment parentFragment = getParentFragment();
        if (!(parentFragment instanceof DialogFragment)) {
            parentFragment = null;
        }
        DialogFragment dialogFragment = (DialogFragment) parentFragment;
        if (!(dialogFragment == null || (dialog = dialogFragment.getDialog()) == null || (window = dialog.getWindow()) == null)) {
            window.setWindowAnimations(2131886971);
        }
        this.LIZ = SystemClock.elapsedRealtime();
        ECBaseFragment.super.onStart();
    }

    public void LIZ(CYW cyw) {
        M12.LIZ(cyw);
        CWK.LIZ(cyw);
    }

    public void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        super.onViewCreated(view, bundle);
        CW4.LIZ(view, this);
    }
}
