package com.ss.android.ugc.aweme.im.sdk.chat.feature.input.gifpanel.bottomsheet;

import X.2VM;
import X.CtK;
import X.SCN;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.os.Bundle;
import android.view.LayoutInflater;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.foundation.fragment.BaseFragment;

public abstract class Hilt_GifChoosePanelBottomSheet extends BaseFragment implements CtK<Object> {
    public ContextWrapper LJ;
    public volatile SCN LJFF;
    public final Object LJI = new Object();

    static {
        Covode.recordClassIndex(84530);
    }

    public Context getContext() {
        return this.LJ;
    }

    public final Object generatedComponent() {
        return LIZIZ().generatedComponent();
    }

    private void LIZ() {
        if (this.LJ == null) {
            this.LJ = SCN.LIZ(Hilt_GifChoosePanelBottomSheet.super.getContext(), (Fragment) this);
            generatedComponent();
        }
    }

    private SCN LIZIZ() {
        if (this.LJFF == null) {
            synchronized (this.LJI) {
                if (this.LJFF == null) {
                    this.LJFF = new SCN(this);
                }
            }
        }
        return this.LJFF;
    }

    public void onAttach(Context context) {
        Hilt_GifChoosePanelBottomSheet.super.onAttach(context);
        LIZ();
    }

    public LayoutInflater onGetLayoutInflater(Bundle bundle) {
        return LayoutInflater.from(SCN.LIZ(Hilt_GifChoosePanelBottomSheet.super.onGetLayoutInflater(bundle), (Fragment) this));
    }

    public void onAttach(Activity activity) {
        boolean z;
        Hilt_GifChoosePanelBottomSheet.super.onAttach(activity);
        ContextWrapper contextWrapper = this.LJ;
        if (contextWrapper == null || SCN.LIZ(contextWrapper) == activity) {
            z = true;
        } else {
            z = false;
        }
        2VM.LIZ(z, "onAttach called multiple times with different Context! Hilt Fragments should not be retained.", new Object[0]);
        LIZ();
    }
}
