package com.bytedance.android.livesdk.adminsetting;

import X.0HH;
import X.0cm;
import X.15l;
import X.15m;
import X.15o;
import X.1jk;
import X.2K7;
import X.9Y3;
import X.C0251FYr;
import X.C1009FuE;
import X.C1013FuI;
import X.C1014FuJ;
import X.C1015FuK;
import X.C1016FuL;
import X.C1017FuM;
import X.C1018FuN;
import X.C1020FuP;
import X.C1064Fv7;
import X.C1313Fz8;
import X.C1430G2l;
import X.C1612G9l;
import X.C3491GtA;
import X.G2L;
import X.GSF;
import X.M12;
import X.Ql4;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.live.usermanage.IUserManageService;
import com.bytedance.android.livesdk.chatroom.ui.SSLinearLayoutManager;
import com.bytedance.android.livesdk.ui.BaseFragment;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import java.util.HashMap;
import kotlin.h.b.n;

public final class LiveManageListFragment extends BaseFragment {
    public static final C1017FuM LJ = new C1017FuM((byte) 0);
    public int LIZ;
    public int LIZIZ;
    public boolean LIZJ;
    public G2L LIZLLL;
    public int LJFF;
    public int LJI;
    public String LJII;
    public String LJIIIIZZ;
    public long LJIIIZ;
    public final C1013FuI LJIIJ = new C1013FuI(this);
    public final 15o LJIIJJI = new C1015FuK(this);
    public HashMap LJIIL;

    static {
        Covode.recordClassIndex(11345);
    }

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

    public final LiveManageListFragment LIZ() {
        this.LIZ = 2;
        return this;
    }

    public final LiveManageListFragment LIZIZ() {
        this.LIZ = 3;
        return this;
    }

    public static boolean LJ() {
        try {
            return 2K7.LIZ.LIZJ();
        } catch (Exception unused) {
            return false;
        }
    }

    public final /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        HashMap hashMap = this.LJIIL;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public final void LIZJ() {
        getContext();
        if (!LJ()) {
            C1313Fz8.LIZ(getContext(), 2131829752);
            LIZ(2131369718).setStatus(2);
            return;
        }
        LIZLLL();
    }

    public final void LIZLLL() {
        if (TextUtils.equals("activity_kick_out", this.LJIIIIZZ)) {
            0cm.LIZ(IUserManageService.class).fetchKickOutList(this.LJIIJ, this.LJIIIZ, this.LIZIZ, 20);
        } else {
            0cm.LIZ(IUserManageService.class).fetchMuteList(this.LJIIJ, this.LJIIIZ, this.LIZIZ, 20);
        }
    }

    public static View LIZ(LayoutInflater layoutInflater) {
        MethodCollector.i(6267);
        if (9Y3.LIZ(9Y3.LIZ(), true, "tiktok_tux_text_view_opt", false) && layoutInflater != null && layoutInflater.getFactory() == null && layoutInflater.getFactory2() == null) {
            try {
                layoutInflater.setFactory(new Ql4());
            } catch (Exception unused) {
                View inflate = layoutInflater.inflate(2131561526, (ViewGroup) null);
                MethodCollector.o(6267);
                return inflate;
            }
        }
        View inflate2 = layoutInflater.inflate(2131561526, (ViewGroup) null);
        MethodCollector.o(6267);
        return inflate2;
    }

    public final void onEvent(C1018FuN fuN) {
        if (isViewValid() && fuN != null && !fuN.LIZ) {
            G2L g2l = this.LIZLLL;
            if (g2l != null) {
                g2l.LIZ(fuN.LIZIZ);
            }
            G2L g2l2 = this.LIZLLL;
            if (g2l2 != null && g2l2.getItemCount() == 0) {
                LIZ(2131369718).setStatus(1);
                1jk LIZ2 = LIZ(2131369717);
                if (LIZ2 != null) {
                    C1430G2l.LIZ((View) LIZ2);
                }
            }
        }
    }

    public final void onEvent(C1020FuP fuP) {
        if (isViewValid() && fuP != null && !fuP.LIZ) {
            G2L g2l = this.LIZLLL;
            if (g2l != null) {
                g2l.LIZ(fuP.LIZIZ);
            }
            G2L g2l2 = this.LIZLLL;
            if (g2l2 != null && g2l2.getItemCount() == 0) {
                LIZ(2131369718).setStatus(1);
                1jk LIZ2 = LIZ(2131369717);
                if (LIZ2 != null) {
                    C1430G2l.LIZ((View) LIZ2);
                }
            }
        }
    }

    /* JADX WARNING: type inference failed for: r1v13, types: [android.view.View, X.G9l] */
    public final void onViewCreated(View view, Bundle bundle) {
        DataChannel LIZ2;
        Room room;
        User owner;
        M12.LIZ(view);
        super.onViewCreated(view, bundle);
        if (getContext() != null && (LIZ2 = GSF.LIZ((Fragment) this)) != null && (room = (Room) LIZ2.LIZIZ(C1064Fv7.class)) != null && (owner = room.getOwner()) != null) {
            long id = owner.getId();
            long id2 = room.getId();
            ((LinearLayout) LIZ(2131369721)).setOnClickListener(new C1009FuE(this));
            RecyclerView LIZ3 = LIZ(2131369716);
            n.LIZIZ(LIZ3, "");
            LIZ3.setVisibility(0);
            RecyclerView LIZ4 = LIZ(2131369716);
            n.LIZIZ(LIZ4, "");
            getContext();
            LIZ4.setLayoutManager(new SSLinearLayoutManager(1));
            this.LJI = 2131829416;
            int i = this.LIZ;
            if (2 == i) {
                this.LJIIIIZZ = "activity_banned_talk";
                this.LJFF = 2131829415;
                this.LJII = getString(2131829411);
                C3491GtA LIZ5 = C3491GtA.LJFF.LIZ("livesdk_anchor_mute_list_show");
                LIZ5.LIZ();
                LIZ5.LIZLLL();
            } else if (3 == i) {
                this.LJIIIIZZ = "activity_kick_out";
                this.LJFF = 2131829413;
                this.LJII = getString(2131829404);
                C3491GtA LIZ6 = C3491GtA.LJFF.LIZ("livesdk_anchor_blocked_list_show");
                LIZ6.LIZ();
                LIZ6.LIZLLL();
            }
            this.LIZLLL = new G2L(getContext(), this.LJIIIIZZ, id2, id);
            RecyclerView LIZ7 = LIZ(2131369716);
            n.LIZIZ(LIZ7, "");
            LIZ7.setAdapter(this.LIZLLL);
            G2L g2l = this.LIZLLL;
            if (g2l != null) {
                g2l.LIZLLL = new C1014FuJ(this);
            }
            G2L g2l2 = this.LIZLLL;
            if (g2l2 != null) {
                g2l2.LIZ = this.LJIIJJI;
            }
            this.LIZIZ = 0;
            this.LJIIIZ = id2;
            LIZJ();
            15m LIZ8 = LIZ(2131369718);
            n.LIZIZ(LIZ8, "");
            LIZ8.setVisibility(0);
            View LIZ9 = LIZ(LayoutInflater.from(getContext()));
            LIZ9.setOnClickListener(new C1016FuL(this));
            Context context = getContext();
            if (context == null) {
                n.LIZIZ();
            }
            n.LIZIZ(context, "");
            C0251FYr fYr = new C0251FYr(context, (byte) 0);
            fYr.LIZ();
            fYr.LIZ(getString(this.LJI));
            fYr.LIZIZ(getString(this.LJFF));
            fYr.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
            15m LIZ10 = LIZ(2131369718);
            15l LIZ11 = 15l.LIZ(getContext());
            LIZ11.LIZJ = fYr;
            LIZ11.LIZLLL = LIZ9;
            Context context2 = getContext();
            if (context2 == null) {
                n.LIZIZ();
            }
            LIZ11.LIZIZ = new C1612G9l(context2);
            LIZ10.setBuilder(LIZ11);
            1jk LIZ12 = LIZ(2131369719);
            n.LIZIZ(LIZ12, "");
            LIZ12.setText(this.LJII);
        }
    }

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