package com.bytedance.android.live.rank.impl.list.fragment.list;

import X.2Pr;
import X.AnonymousClass0EK;
import X.AnonymousClass13N;
import X.AnonymousClass13O;
import X.AnonymousClass13P;
import X.AnonymousClass13Q;
import X.AnonymousClass13R;
import X.AnonymousClass1MM;
import X.C07930Ul;
import X.C09630aP;
import X.C10000b0;
import X.C11340dA;
import X.C12080eM;
import X.C263813k;
import X.C263913l;
import X.C264013m;
import X.C264113n;
import X.C264513r;
import X.C31271Mf;
import X.C37441eA;
import X.C37451eB;
import X.C37461eC;
import X.C37471eD;
import X.C37481eE;
import X.C37601eQ;
import X.C37621eS;
import X.C37661eW;
import X.C37681eY;
import X.C37771eh;
import X.C37781ei;
import X.C37791ej;
import X.C37801ek;
import X.C37811el;
import X.C37901eu;
import X.C40901jk;
import X.C46321sU;
import X.C529627q;
import X.C529727r;
import X.C529827s;
import X.FkL;
import X.Fv7;
import X.GSF;
import X.GoA;
import X.Gok;
import X.GpA;
import X.GpC;
import X.GtA;
import X.HI6;
import X.HL0;
import X.Ls2;
import X.M12;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.method.LinkMovementMethod;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.android.live.base.model.ImageModel;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.live.rank.impl.list.controller.child.RankRegionController;
import com.bytedance.android.live.rank.impl.list.controller.child.list.BaseRankListController;
import com.bytedance.android.live.rank.impl.list.vm.list.BaseRankListViewModel;
import com.bytedance.android.livesdk.model.RoomAuthStatus;
import com.bytedance.android.livesdk.rank.list.model.RankListV2Response;
import com.bytedance.android.livesdk.rank.list.model.WeeklyRankRegionInfo;
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.ies.sdk.datachannel.DataChannel;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import kotlin.h.b.n;

public abstract class RankBaseFragment<VM extends BaseRankListViewModel, C extends BaseRankListController<VM>> extends BaseFragment implements C264013m {
    public static final AnonymousClass13N LJIIJJI = new AnonymousClass13N((byte) 0);
    public HashMap LIZ;
    public RankRegionController LIZIZ;
    public Ls2<2Pr> LIZJ;
    public C LIZLLL;
    public View LJ;
    public RecyclerView LJFF;
    public View LJI;
    public FkL LJII;
    public DataChannel LJIIIIZZ;
    public AnonymousClass13O LJIIIZ = new AnonymousClass13O();
    public final C263913l LJIIJ = new C37781ei(this);

    static {
        Covode.recordClassIndex(10318);
    }

    public abstract C LIZ();

    public void LIZ(int i) {
    }

    public abstract void LIZ(FkL fkL);

    public void LIZ(RecyclerView recyclerView) {
        M12.LIZ(recyclerView);
    }

    public abstract GpC LIZIZ();

    /* JADX WARNING: type inference failed for: r3v0, types: [com.bytedance.android.live.rank.impl.list.fragment.list.RankBaseFragment, androidx.fragment.app.Fragment] */
    public View LIZIZ(int i) {
        if (this.LIZ == null) {
            this.LIZ = new HashMap();
        }
        View view = (View) this.LIZ.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LIZ.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

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

    /* JADX WARNING: type inference failed for: r5v0, types: [com.bytedance.android.live.rank.impl.list.fragment.list.RankBaseFragment, androidx.fragment.app.Fragment] */
    public final void LIZ(WeeklyRankRegionInfo weeklyRankRegionInfo) {
        C37901eu r4;
        C264513r r0;
        View view = getView();
        if (view != null && (r4 = (C37901eu) view.findViewById(2131366973)) != null) {
            r4.setEventListener(new C37811el(this, weeklyRankRegionInfo));
            if (weeklyRankRegionInfo == null || weeklyRankRegionInfo.LIZ != 1) {
                r4.setVisibility(8);
                return;
            }
            if (r4.getVisibility() == 8 && (r0 = r4.LIZJ) != null) {
                r0.LIZJ();
            }
            r4.setVisibility(0);
            if (weeklyRankRegionInfo.LIZIZ == Gok.VIEWER.getValue()) {
                r4.LIZ.setVisibility(8);
                r4.LIZIZ.setVisibility(0);
                return;
            }
            r4.LIZ.setVisibility(0);
            r4.LIZIZ.setVisibility(8);
        }
    }

    public void LIZ(boolean z, boolean z2) {
        RankListV2Response.RankInfo rankInfo;
        RankListV2Response.WeeklyRookieRankExtra weeklyRookieRankExtra;
        if (z) {
            if (z2) {
                C c = this.LIZLLL;
                if (c == null) {
                    n.LIZ("");
                }
                C c2 = this.LIZLLL;
                if (c2 == null) {
                    n.LIZ("");
                }
                c.LIZJ(c2.LJFF().LIZJ);
            } else {
                C c3 = this.LIZLLL;
                if (c3 == null) {
                    n.LIZ("");
                }
                c3.LIZJ(true);
            }
        }
        C c4 = this.LIZLLL;
        if (c4 == null) {
            n.LIZ("");
        }
        c4.LJFF().LIZJ = false;
        StringBuilder sb = new StringBuilder();
        sb.append(this);
        sb.append(" onUserVisibleChange(");
        sb.append(z);
        sb.append(")  ");
        sb.append(LIZIZ().getRankName());
        sb.append("  ");
        RankRegionController rankRegionController = this.LIZIZ;
        if (rankRegionController == null) {
            n.LIZ("");
        }
        sb.append(rankRegionController.LIZ().LIZ);
        C09630aP.LIZ(3, "RankBaseFragment", sb.toString());
        if (z) {
            if (this.LJIIIZ.LIZJ && this.LJIIIZ.LIZLLL) {
                this.LJIIIZ.LIZLLL = false;
                GpA gpA = GpA.LIZ;
                DataChannel dataChannel = this.LJIIIIZZ;
                C c5 = this.LIZLLL;
                if (c5 == null) {
                    n.LIZ("");
                }
                gpA.LIZ(dataChannel, c5.LJ().LIZLLL, false);
                GpA gpA2 = GpA.LIZ;
                C c6 = this.LIZLLL;
                if (c6 == null) {
                    n.LIZ("");
                }
                RankListV2Response.RankView rankView = c6.LJ().LIZLLL;
                C c7 = this.LIZLLL;
                if (c7 == null) {
                    n.LIZ("");
                }
                gpA2.LIZ(rankView, c7.LIZ.LIZIZ().LJFF, this.LJIIIIZZ);
                GpA gpA3 = GpA.LIZ;
                C c8 = this.LIZLLL;
                if (c8 == null) {
                    n.LIZ("");
                }
                gpA3.LIZ(c8.LJ().LIZLLL, LIZIZ().getRankName(), this.LJIIIIZZ);
                C c9 = this.LIZLLL;
                if (c9 == null) {
                    n.LIZ("");
                }
                RankListV2Response.RankView rankView2 = c9.LJ().LIZLLL;
                if (rankView2 != null && !rankView2.LJIIIIZZ) {
                    C c10 = this.LIZLLL;
                    if (c10 == null) {
                        n.LIZ("");
                    }
                    if (c10.LIZ.LIZIZ().LJFF) {
                        GpA gpA4 = GpA.LIZ;
                        C c11 = this.LIZLLL;
                        if (c11 == null) {
                            n.LIZ("");
                        }
                        RankListV2Response.RankView rankView3 = c11.LJ().LIZLLL;
                        gpA4.LIZ(rankView3, LIZIZ().getRankName() + "_unstable_location", this.LJIIIIZZ);
                    }
                }
                if (LIZIZ() == GpC.WEEKLY_ROOKIE_RANK) {
                    C c12 = this.LIZLLL;
                    if (c12 == null) {
                        n.LIZ("");
                    }
                    if (c12.LIZ.LIZIZ().LJFF) {
                        C c13 = this.LIZLLL;
                        if (c13 == null) {
                            n.LIZ("");
                        }
                        RankListV2Response.RankView rankView4 = c13.LJ().LIZLLL;
                        if (!(rankView4 == null || (rankInfo = rankView4.LIZLLL) == null || (weeklyRookieRankExtra = rankInfo.LJIIIIZZ) == null || !weeklyRookieRankExtra.LIZ)) {
                            GpA gpA5 = GpA.LIZ;
                            C c14 = this.LIZLLL;
                            if (c14 == null) {
                                n.LIZ("");
                            }
                            RankListV2Response.RankView rankView5 = c14.LJ().LIZLLL;
                            gpA5.LIZ(rankView5, LIZIZ().getRankName() + "_bottom_bar", this.LJIIIIZZ);
                        }
                    }
                }
            }
            if (this.LJIIIZ.LJFF) {
                GpA gpA6 = GpA.LIZ;
                GpC LIZIZ2 = LIZIZ();
                C c15 = this.LIZLLL;
                if (c15 == null) {
                    n.LIZ("");
                }
                boolean z3 = c15.LIZ.LIZIZ().LJFF;
                C c16 = this.LIZLLL;
                if (c16 == null) {
                    n.LIZ("");
                }
                gpA6.LIZ(LIZIZ2, z3, c16.LJ().LIZLLL, false, this.LJIIIIZZ);
                this.LJIIIZ.LJFF = false;
            }
        } else if (this.LJIIIZ.LJ) {
            this.LJIIIZ.LJ = false;
            GpA gpA7 = GpA.LIZ;
            C c17 = this.LIZLLL;
            if (c17 == null) {
                n.LIZ("");
            }
            RankListV2Response.RankView rankView6 = c17.LJ().LIZLLL;
            C c18 = this.LIZLLL;
            if (c18 == null) {
                n.LIZ("");
            }
            long j = c18.LJ().LJFF;
            C c19 = this.LIZLLL;
            if (c19 == null) {
                n.LIZ("");
            }
            boolean z4 = c19.LIZ.LIZIZ().LJFF;
            C c20 = this.LIZLLL;
            if (c20 == null) {
                n.LIZ("");
            }
            boolean z5 = c20.LIZ.LIZIZ().LJ;
            GpC LIZIZ3 = LIZIZ();
            M12.LIZ(LIZIZ3);
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            if (rankView6 != null) {
                gpA7.LIZ(linkedHashMap, rankView6);
            }
            linkedHashMap.put("last_user_rank", String.valueOf(j));
            if (z4) {
                gpA7.LIZ(linkedHashMap);
            } else {
                gpA7.LIZIZ(linkedHashMap);
            }
            linkedHashMap.put("room_orientation", z5 ? "portrait" : "landscape");
            linkedHashMap.put("rank_type", LIZIZ3.getRankName());
            GtA LIZ2 = gpA7.LIZ("livesdk_hourly_user_rank_swipe_to_end", linkedHashMap);
            LIZ2.LIZ("rank_period", (rankView6 == null || rankView6.LJIIIZ != -1) ? "this_week" : "last_week");
            LIZ2.LIZLLL();
        }
    }

    public final void LIZ(boolean z) {
        this.LJIIIZ.LIZ = !z;
        if (z) {
            if (this.LJIIIZ.LIZIZ) {
                LIZ(false, false);
            }
        } else if (this.LJIIIZ.LIZIZ) {
            C c = this.LIZLLL;
            if (c == null) {
                n.LIZ("");
            }
            if (!c.LJFF().LIZJ) {
                LIZ(true, false);
            }
        }
    }

    public final RankRegionController LIZLLL() {
        RankRegionController rankRegionController = this.LIZIZ;
        if (rankRegionController == null) {
            n.LIZ("");
        }
        return rankRegionController;
    }

    public final Ls2<2Pr> LJ() {
        Ls2<2Pr> ls2 = this.LIZJ;
        if (ls2 == null) {
            n.LIZ("");
        }
        return ls2;
    }

    public final C LJFF() {
        C c = this.LIZLLL;
        if (c == null) {
            n.LIZ("");
        }
        return c;
    }

    public final View LJI() {
        View view = this.LJI;
        if (view == null) {
            n.LIZ("");
        }
        return view;
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.android.live.rank.impl.list.fragment.list.RankBaseFragment, com.bytedance.android.livesdk.ui.BaseFragment, androidx.fragment.app.Fragment] */
    public void onDestroy() {
        RankBaseFragment.super.onDestroy();
        if (getUserVisibleHint() && this.LJIIIZ.LIZ) {
            this.LJIIIZ.LIZIZ = false;
            LIZ(false, false);
        }
    }

    public void onDestroyView() {
        RankBaseFragment.super.onDestroyView();
        C c = this.LIZLLL;
        if (c == null) {
            n.LIZ("");
        }
        c.LIZLLL();
        LIZJ();
    }

    public final void LIZ(Ls2<2Pr> ls2) {
        M12.LIZ(ls2);
        this.LIZJ = ls2;
    }

    /* JADX WARNING: type inference failed for: r4v0, types: [com.bytedance.android.live.rank.impl.list.fragment.list.RankBaseFragment, com.bytedance.android.livesdk.ui.BaseFragment, androidx.fragment.app.Fragment] */
    public void onCreate(Bundle bundle) {
        RankBaseFragment.super.onCreate(bundle);
        C LIZ2 = LIZ();
        getLifecycle().LIZ(LIZ2);
        RankRegionController rankRegionController = this.LIZIZ;
        if (rankRegionController == null) {
            n.LIZ("");
        }
        if (rankRegionController == null) {
            throw new IllegalStateException("Required value was null.".toString());
        } else if (this.LIZJ == null) {
            n.LIZ("");
            throw new IllegalStateException("Required value was null.".toString());
        } else {
            this.LIZLLL = LIZ2;
            this.LJIIIIZZ = GSF.LIZ(this);
        }
    }

    public String LIZ(long j) {
        long j2 = j / 86400;
        long j3 = j % 86400;
        long j4 = j3 / 3600;
        long j5 = j3 % 3600;
        long j6 = j5 / 60;
        long j7 = j5 % 60;
        if (j2 > 0) {
            String LIZ2 = C10000b0.LIZ(2131828481, Long.valueOf(j2), Long.valueOf(j4), Long.valueOf(j6));
            n.LIZIZ(LIZ2, "");
            return LIZ2;
        }
        String LIZ3 = C10000b0.LIZ(2131828482, Long.valueOf(j4), Long.valueOf(j6), Long.valueOf(j7));
        n.LIZIZ(LIZ3, "");
        return LIZ3;
    }

    public void setUserVisibleHint(boolean z) {
        RankBaseFragment.super.setUserVisibleHint(z);
        StringBuilder sb = new StringBuilder();
        sb.append(this);
        sb.append(" setUserVisibleHint(");
        sb.append(z);
        sb.append(")  ");
        sb.append(LIZIZ().getRankName());
        sb.append("  ");
        RankRegionController rankRegionController = this.LIZIZ;
        if (rankRegionController == null) {
            n.LIZ("");
        }
        sb.append(rankRegionController.LIZ().LIZ);
        C09630aP.LIZ(3, "RankBaseFragment", sb.toString());
        if (z) {
            if (this.mStatusActive) {
                this.LJIIIZ.LIZIZ = true;
                LIZ(true, true);
            }
        } else if (this.mStatusActive) {
            this.LJIIIZ.LIZIZ = false;
            C c = this.LIZLLL;
            if (c == null) {
                n.LIZ("");
            }
            if (!c.LJFF().LIZJ) {
                LIZ(false, true);
            }
        }
    }

    public final void LIZ(C37441eA r8) {
        M12.LIZ(r8);
        C40901jk r0 = (C40901jk) LIZIZ(2131371899);
        n.LIZIZ(r0, "");
        r0.setVisibility(0);
        C40901jk r02 = (C40901jk) LIZIZ(2131371895);
        n.LIZIZ(r02, "");
        r02.setVisibility(0);
        C40901jk r2 = (C40901jk) LIZIZ(2131371895);
        n.LIZIZ(r2, "");
        r2.setText(LIZ(r8.LIZJ));
        if (r8.LIZLLL) {
            C40901jk r03 = (C40901jk) LIZIZ(2131371899);
            n.LIZIZ(r03, "");
            ((C40901jk) LIZIZ(2131371895)).setTextColor(C11340dA.LIZ(r03.getContext(), 2130971317));
        }
        AnonymousClass1MM r04 = (AnonymousClass1MM) LIZIZ(2131369249);
        n.LIZIZ(r04, "");
        r04.setVisibility(0);
        ((AnonymousClass1MM) LIZIZ(2131369249)).setOnClickListener(new AnonymousClass13Q(this));
        if (LIZIZ() == GpC.WEEKLY_RANK) {
            C c = this.LIZLLL;
            if (c == null) {
                n.LIZ("");
            }
            RankListV2Response.RankView rankView = c.LJ().LIZLLL;
            if (rankView != null && rankView.LJII) {
                C40901jk r05 = (C40901jk) LIZIZ(2131366776);
                n.LIZIZ(r05, "");
                r05.setVisibility(0);
                C31271Mf r06 = (C31271Mf) LIZIZ(2131366774);
                n.LIZIZ(r06, "");
                r06.setVisibility(0);
                if (C10000b0.LJI()) {
                    C31271Mf r1 = (C31271Mf) LIZIZ(2131366774);
                    n.LIZIZ(r1, "");
                    r1.setTranslationX((float) C10000b0.LIZ(12.0f));
                } else {
                    C31271Mf r12 = (C31271Mf) LIZIZ(2131366774);
                    n.LIZIZ(r12, "");
                    r12.setTranslationX((float) C10000b0.LIZ(-12.0f));
                }
                ((C40901jk) LIZIZ(2131366776)).setOnClickListener(new AnonymousClass13R(this));
            }
        }
    }

    public final void LIZ(RankRegionController rankRegionController) {
        M12.LIZ(rankRegionController);
        this.LIZIZ = rankRegionController;
    }

    /* JADX WARNING: type inference failed for: r21v0, types: [com.bytedance.android.live.rank.impl.list.fragment.list.RankBaseFragment, androidx.fragment.app.Fragment] */
    public void LIZ(RankListV2Response.RankInfo rankInfo) {
        int i;
        Room room;
        RoomAuthStatus roomAuthStatus;
        int i2;
        List list;
        if (this.LJI == null) {
            n.LIZ("");
        }
        RankListV2Response.RankInfo rankInfo2 = rankInfo;
        if (rankInfo2 != null) {
            C40901jk r9 = (C40901jk) LIZIZ(2131369252);
            r9.setText(rankInfo2.LIZJ);
            long j = rankInfo2.LIZIZ;
            if (j == 1) {
                i = 2131100724;
            } else if (j == 2) {
                i = 2131100725;
            } else if (j == 3) {
                i = 2131100726;
            } else {
                i = 2131099752;
            }
            int LIZIZ2 = C10000b0.LIZIZ(i);
            r9.setTextColor(LIZIZ2);
            View view = getView();
            if (view != null && C263813k.LIZ.get(LIZIZ().getType()) && rankInfo2.LIZIZ > 0) {
                StringBuilder sb = new StringBuilder();
                C c = this.LIZLLL;
                if (c == null) {
                    n.LIZ("");
                }
                RankListV2Response.RankView rankView = c.LJ().LIZLLL;
                if (rankView == null || (list = rankView.LIZJ) == null) {
                    i2 = 99;
                } else {
                    i2 = list.size();
                }
                sb.append(i2);
                sb.append('+');
                r9.setText(sb.toString());
                C263813k r13 = C263813k.LIZJ;
                View findViewById = view.findViewById(2131369254);
                n.LIZIZ(findViewById, "");
                View findViewById2 = view.findViewById(2131369253);
                n.LIZIZ(findViewById2, "");
                View findViewById3 = view.findViewById(2131369252);
                n.LIZIZ(findViewById3, "");
                String str = rankInfo2.LIZJ;
                n.LIZIZ(str, "");
                TextView textView = (TextView) findViewById3;
                r13.LIZ(findViewById, findViewById2, textView, str, C10000b0.LIZIZ(2131099752), LIZIZ2, LIZIZ().getType());
            }
            String rankName = LIZIZ().getRankName();
            if (n.LIZ(rankName, GpC.HOURLY_RANK.getRankName())) {
                GoA.LJI.LIZ(GpC.HOURLY_RANK.getType(), rankInfo2.LIZIZ);
            } else if (n.LIZ(rankName, GpC.WEEKLY_RANK.getRankName())) {
                GoA.LJI.LIZ(GpC.WEEKLY_RANK.getType(), rankInfo2.LIZIZ);
            }
            User user = rankInfo2.LIZ;
            n.LIZIZ(user, "");
            ImageModel avatarThumb = user.getAvatarThumb();
            ImageView imageView = (ImageView) LIZIZ(2131372614);
            n.LIZIZ(imageView, "");
            int width = imageView.getWidth();
            ImageView imageView2 = (ImageView) LIZIZ(2131372614);
            n.LIZIZ(imageView2, "");
            HI6.LIZ((ImageView) LIZIZ(2131372614), avatarThumb, width, imageView2.getHeight(), 2131234890);
            C40901jk r4 = (C40901jk) LIZIZ(2131367877);
            n.LIZIZ(r4, "");
            r4.setText(C07930Ul.LIZ(rankInfo2.LIZ));
            if (rankInfo2.LIZIZ > 0) {
                LIZ((int) rankInfo2.LIZIZ);
            }
            C c2 = this.LIZLLL;
            if (c2 == null) {
                n.LIZ("");
            }
            RankListV2Response.RankView rankView2 = c2.LJ().LIZLLL;
            boolean z = false;
            if (rankView2 == null || !rankView2.LJIIIIZZ) {
                RelativeLayout relativeLayout = (RelativeLayout) LIZIZ(2131369648);
                n.LIZIZ(relativeLayout, "");
                relativeLayout.setVisibility(8);
                C40901jk r0 = (C40901jk) LIZIZ(2131372028);
                n.LIZIZ(r0, "");
                r0.setVisibility(0);
                C c3 = this.LIZLLL;
                if (c3 == null) {
                    n.LIZ("");
                }
                if (c3.LIZ.LIZIZ().LJFF) {
                    C40901jk r42 = (C40901jk) LIZIZ(2131372028);
                    n.LIZIZ(r42, "");
                    SpannableString spannableString = new SpannableString(C10000b0.LIZ(2131830193) + ' ');
                    LIZ(r42, spannableString, LIZIZ().getRankName() + "_unstable_location");
                    return;
                }
                C40901jk r1 = (C40901jk) LIZIZ(2131372028);
                n.LIZIZ(r1, "");
                r1.setText(C10000b0.LIZ(2131830192));
                return;
            }
            RelativeLayout relativeLayout2 = (RelativeLayout) LIZIZ(2131369648);
            n.LIZIZ(relativeLayout2, "");
            relativeLayout2.setVisibility(0);
            C40901jk r02 = (C40901jk) LIZIZ(2131372028);
            n.LIZIZ(r02, "");
            r02.setVisibility(8);
            C40901jk r43 = (C40901jk) LIZIZ(2131371997);
            n.LIZIZ(r43, "");
            r43.setText(HL0.LIZ(rankInfo2.LJI.LIZ, "").toString());
            C46321sU r6 = (C46321sU) LIZIZ(2131363033);
            if (r6 != null) {
                if (getUserVisibleHint() && r6.getVisibility() != 0) {
                    GpA gpA = GpA.LIZ;
                    GpC LIZIZ3 = LIZIZ();
                    boolean isEnabled = r6.isEnabled();
                    DataChannel dataChannel = this.LJIIIIZZ;
                    C c4 = this.LIZLLL;
                    if (c4 == null) {
                        n.LIZ("");
                    }
                    gpA.LIZ(LIZIZ3, isEnabled, dataChannel, c4.LIZ.LIZIZ().LJFF);
                }
                r6.setVisibility(0);
                DataChannel dataChannel2 = this.LJIIIIZZ;
                if (!(dataChannel2 == null || (room = (Room) dataChannel2.LIZIZ(Fv7.class)) == null || (roomAuthStatus = room.getRoomAuthStatus()) == null || !roomAuthStatus.isEnableGift())) {
                    z = true;
                }
                r6.setEnabled(z);
                r6.setOnClickListener(new AnonymousClass13P(rankInfo2, this, rankInfo2));
            }
        }
    }

    /* JADX WARNING: type inference failed for: r9v0, types: [com.bytedance.android.live.rank.impl.list.fragment.list.RankBaseFragment, com.bytedance.android.livesdk.ui.BaseFragment, androidx.fragment.app.Fragment] */
    public void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        RankBaseFragment.super.onViewCreated(view, bundle);
        C c = this.LIZLLL;
        if (c == null) {
            n.LIZ("");
        }
        c.LIZ((C264013m) this);
        if (this.LJFF == null) {
            View findViewById = view.findViewById(2131366973);
            n.LIZIZ(findViewById, "");
            findViewById.setVisibility(8);
            View findViewById2 = view.findViewById(2131369397);
            n.LIZIZ(findViewById2, "");
            this.LJFF = (RecyclerView) findViewById2;
            View findViewById3 = view.findViewById(2131370079);
            n.LIZIZ(findViewById3, "");
            this.LJI = findViewById3;
            RecyclerView recyclerView = this.LJFF;
            if (recyclerView == null) {
                n.LIZ("");
            }
            getContext();
            recyclerView.setLayoutManager(new LinearLayoutManager(1, false));
            RecyclerView recyclerView2 = this.LJFF;
            if (recyclerView2 == null) {
                n.LIZ("");
            }
            FkL fkL = this.LJII;
            if (fkL == null) {
                fkL = new FkL();
                this.LJII = fkL;
                fkL.LIZ(C37471eD.class, new C37661eW());
                fkL.LIZ(C37481eE.class, new C37681eY(LIZ().LIZ.LIZIZ().LJ, new C529627q(this)));
                fkL.LIZ(C37461eC.class, new C37621eS(LIZ().LIZ.LIZIZ().LJ, new C529727r(this)));
                fkL.LIZ(C37451eB.class, new C37601eQ());
                LIZ(fkL);
                RecyclerView recyclerView3 = this.LJFF;
                if (recyclerView3 == null) {
                    n.LIZ("");
                }
                LIZ(recyclerView3);
            }
            recyclerView2.setAdapter(fkL);
            RecyclerView recyclerView4 = this.LJFF;
            if (recyclerView4 == null) {
                n.LIZ("");
            }
            recyclerView4.LIZ((AnonymousClass0EK) new C37771eh(this));
            C c2 = this.LIZLLL;
            if (c2 == null) {
                n.LIZ("");
            }
            BaseRankListViewModel LJ2 = c2.LJ();
            LJ2.LIZ.observe(this, new C37791ej(this, view));
            LJ2.LIZIZ.observe(this, new C37801ek(this, view));
            if (getUserVisibleHint() && this.LJIIIZ.LIZ) {
                this.LJIIIZ.LIZIZ = true;
                LIZ(true, false);
            }
        }
    }

    /* JADX WARNING: type inference failed for: r11v0, types: [com.bytedance.android.live.rank.impl.list.fragment.list.RankBaseFragment, androidx.fragment.app.Fragment] */
    public final void LIZ(C40901jk r12, Spannable spannable, String str) {
        M12.LIZ(r12, spannable, str);
        r12.setVisibility(0);
        spannable.setSpan(new ForegroundColorSpan(C10000b0.LIZIZ(2131099758)), 0, spannable.length(), 33);
        SpannableString spannableString = new SpannableString(C10000b0.LIZ(2131830196));
        ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(C10000b0.LIZIZ(2131099732));
        C264113n r1 = new C264113n(new C529827s(this, str));
        C12080eM.LIZ(getContext(), spannableString, 0, spannableString.length(), 6, 600);
        spannableString.setSpan(foregroundColorSpan, 0, spannableString.length(), 33);
        spannableString.setSpan(r1, 0, spannableString.length(), 33);
        SpannableStringBuilder append = new SpannableStringBuilder(spannable).append(spannableString);
        r12.setMovementMethod(LinkMovementMethod.getInstance());
        r12.setText(append);
    }
}
