package com.ss.android.ugc.aweme.comment.supporterpanel;

import X.0EK;
import X.0HH;
import X.2XC;
import X.2cN;
import X.2uR;
import X.3YD;
import X.3cA;
import X.3cC;
import X.3cI;
import X.9DY;
import X.C00969ps;
import X.C01019px;
import X.C01569sa;
import X.C0874AJq;
import X.C0875AJr;
import X.C0876AJs;
import X.C0877AJt;
import X.C0881AJx;
import X.EdN;
import X.M12;
import X.Mk2;
import X.Mk3;
import X.OFc;
import X.PhE;
import X.PlI;
import X.Qeg;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.ugc.aweme.network.RetrofitFactory;
import com.ss.android.ugc.aweme.base.model.UrlModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import java.util.List;
import kotlin.h.b.n;

public final class VGGifterPanelFragment extends Fragment implements 3YD {
    public C00969ps LIZ;
    public C01569sa LIZIZ;
    public String LIZJ;
    public Aweme LIZLLL;
    public String LJ;
    public final 2XC LJFF = RetrofitFactory.LIZ().LIZIZ(9DY.LJ).LIZJ();
    public 2cN LJI;
    public VGGifterPanelService LJII;
    public boolean LJIIIIZZ;
    public boolean LJIIIZ = true;
    public long LJIIJ;
    public LinearLayoutManager LJIIJJI;
    public C0881AJx LJIIL;
    public LinearLayout LJIILIIL;
    public LinearLayout LJIILJJIL;
    public OFc LJIILL;
    public RecyclerView LJIILLIIL;
    public 0EK LJIIZILJ;
    public SparseArray LJIJ;

    static {
        Covode.recordClassIndex(57254);
    }

    public final /* synthetic */ void onDestroyView() {
        VGGifterPanelFragment.super.onDestroyView();
        SparseArray sparseArray = this.LJIJ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final OFc LIZ() {
        OFc oFc = this.LJIILL;
        if (oFc == null) {
            n.LIZ("");
        }
        return oFc;
    }

    public final void LIZJ() {
        RecyclerView recyclerView = this.LJIILLIIL;
        if (recyclerView == null) {
            n.LIZ("");
        }
        if (recyclerView.getVisibility() != 0) {
            LinearLayout linearLayout = this.LJIILIIL;
            if (linearLayout == null) {
                n.LIZ("");
            }
            linearLayout.setVisibility(0);
        }
    }

    public final void LIZLLL() {
        OFc oFc = this.LJIILL;
        if (oFc == null) {
            n.LIZ("");
        }
        oFc.LIZIZ();
        VGGifterPanelService vGGifterPanelService = this.LJII;
        if (vGGifterPanelService == null) {
            n.LIZ("");
        }
        LIZ(vGGifterPanelService);
    }

    public final 2uR ch_() {
        2uR r4 = new 2uR();
        3cA r1 = new 3cA();
        r1.LIZ(2131755247);
        r1.LIZIZ = true;
        r1.LIZ(new C0877AJt(this));
        r4.LIZ(new 3cI[]{r1});
        3cC r12 = new 3cC();
        r12.LIZ("Gifters");
        r4.LIZ(r12);
        return r4;
    }

    public static final /* synthetic */ C0881AJx LIZ(VGGifterPanelFragment vGGifterPanelFragment) {
        C0881AJx aJx = vGGifterPanelFragment.LJIIL;
        if (aJx == null) {
            n.LIZ("");
        }
        return aJx;
    }

    public final void LIZ(VGGifterPanelService vGGifterPanelService) {
        Long l;
        String str = this.LIZJ;
        C01569sa r0 = this.LIZIZ;
        if (r0 != null) {
            l = Long.valueOf(r0.LIZ);
        } else {
            l = null;
        }
        vGGifterPanelService.getGifterPanel(str, l, Long.valueOf(this.LJIIJ)).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZIZ(new C0874AJq(this));
    }

    public final void onViewCreated(View view, Bundle bundle) {
        String str;
        Qeg qeg;
        EdN edN;
        UrlModel urlModel;
        List urlList;
        String str2;
        M12.LIZ(view);
        VGGifterPanelFragment.super.onViewCreated(view, bundle);
        Aweme aweme = this.LIZLLL;
        String str3 = null;
        if (aweme != null) {
            str = aweme.getAid();
        } else {
            str = null;
        }
        this.LIZJ = str;
        OFc findViewById = view.findViewById(2131365370);
        n.LIZIZ(findViewById, "");
        this.LJIILL = findViewById;
        View findViewById2 = view.findViewById(2131365366);
        n.LIZIZ(findViewById2, "");
        this.LJIILIIL = (LinearLayout) findViewById2;
        View findViewById3 = view.findViewById(2131365369);
        n.LIZIZ(findViewById3, "");
        this.LJIILJJIL = (LinearLayout) findViewById3;
        RecyclerView findViewById4 = view.findViewById(2131365371);
        n.LIZIZ(findViewById4, "");
        this.LJIILLIIL = findViewById4;
        this.LJIIL = new C0881AJx();
        RecyclerView recyclerView = this.LJIILLIIL;
        if (recyclerView == null) {
            n.LIZ("");
        }
        C0881AJx aJx = this.LJIIL;
        if (aJx == null) {
            n.LIZ("");
        }
        recyclerView.setAdapter(aJx);
        getContext();
        this.LJIIJJI = new LinearLayoutManager();
        RecyclerView recyclerView2 = this.LJIILLIIL;
        if (recyclerView2 == null) {
            n.LIZ("");
        }
        recyclerView2.setLayoutManager(this.LJIIJJI);
        this.LJIIZILJ = new C0875AJr(this);
        RecyclerView recyclerView3 = this.LJIILLIIL;
        if (recyclerView3 == null) {
            n.LIZ("");
        }
        0EK r1 = this.LJIIZILJ;
        if (r1 == null) {
            n.LIZ("");
        }
        recyclerView3.LIZ(r1);
        View view2 = getView();
        if (view2 != null) {
            qeg = (Qeg) view2.findViewById(2131365331);
        } else {
            qeg = null;
        }
        View view3 = getView();
        if (view3 != null) {
            edN = view3.findViewById(2131365325);
        } else {
            edN = null;
        }
        if (qeg != null) {
            C01569sa r12 = this.LIZIZ;
            if (r12 != null) {
                str2 = r12.LIZIZ;
            } else {
                str2 = null;
            }
            qeg.setText(str2);
        }
        if (edN != null) {
            C01569sa r13 = this.LIZIZ;
            if (!(r13 == null || (urlModel = r13.LJ) == null || (urlList = urlModel.getUrlList()) == null)) {
                str3 = (String) urlList.get(0);
            }
            edN.setImageURI(str3);
            edN.setOnClickListener(new C01019px(this));
        }
        Object LIZ2 = this.LJFF.LIZ(VGGifterPanelService.class);
        n.LIZIZ(LIZ2, "");
        this.LJII = (VGGifterPanelService) LIZ2;
        LIZLLL();
        Qeg findViewById5 = view.findViewById(2131365367);
        n.LIZIZ(findViewById5, "");
        findViewById5.setClickable(true);
        findViewById5.setOnClickListener(new C0876AJs(this));
    }

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