package com.bytedance.android.livesdk.qa;

import X.0HH;
import X.C1059Fv2;
import X.C1434G2p;
import X.C4306HFb;
import X.C4334HGd;
import X.GSF;
import X.M12;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.livesdk.model.UserAttr;
import com.bytedance.android.livesdk.ui.BaseFragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import java.util.HashMap;

public abstract class BaseQATabFragment extends BaseFragment {
    public DataChannel LIZ;
    public boolean LIZIZ;
    public boolean LIZJ;
    public String LIZLLL = "";
    public final String LJ = "qa_list";
    public HashMap LJFF;

    static {
        Covode.recordClassIndex(20056);
    }

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

    public void LIZIZ() {
        HashMap hashMap = this.LJFF;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

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

    public void onDestroy() {
        super.onDestroy();
        LIZ(true);
    }

    public final boolean LIZ() {
        Boolean bool;
        DataChannel dataChannel = this.LIZ;
        if (dataChannel == null || (bool = (Boolean) dataChannel.LIZIZ(C4306HFb.class)) == null) {
            return true;
        }
        return bool.booleanValue();
    }

    public final void LIZ(boolean z) {
        DataChannel dataChannel = this.LIZ;
        if (dataChannel != null) {
            dataChannel.LIZ(C4306HFb.class, Boolean.valueOf(z));
        }
    }

    public void onCreate(Bundle bundle) {
        boolean z;
        String str;
        User user;
        UserAttr userAttr;
        Boolean bool;
        super.onCreate(bundle);
        DataChannel LIZ2 = GSF.LIZ((Fragment) this);
        this.LIZ = LIZ2;
        boolean z2 = false;
        if (LIZ2 == null || (bool = (Boolean) LIZ2.LIZIZ(C1059Fv2.class)) == null) {
            z = false;
        } else {
            z = bool.booleanValue();
        }
        this.LIZIZ = z;
        DataChannel dataChannel = this.LIZ;
        if (!(dataChannel == null || (user = (User) dataChannel.LIZIZ(C1434G2p.class)) == null || (userAttr = user.getUserAttr()) == null)) {
            z2 = userAttr.LIZIZ;
        }
        this.LIZJ = z2;
        DataChannel dataChannel2 = this.LIZ;
        if (dataChannel2 == null || (str = (String) dataChannel2.LIZIZ(C4334HGd.class)) == null) {
            str = "";
        }
        this.LIZLLL = str;
    }

    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return 0HH.LIZ(layoutInflater, 2131561661, viewGroup, false);
    }
}
