package com.bytedance.android.livesdk.adminsetting;

import X.041;
import X.0HH;
import X.7he;
import X.C1007FuC;
import X.C1008FuD;
import X.C1123Fw4;
import X.Crj;
import X.M12;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import com.bytedance.android.livesdk.model.RoomAuthStatus;
import com.bytedance.android.livesdk.ui.BaseFragment;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.covode.number.Covode;
import java.util.HashMap;
import kotlin.h.b.n;

public final class LiveRankingsSettingFragment extends BaseFragment {
    public final Crj LIZ = 7he.LIZ(new C1007FuC(this));
    public HashMap LIZIZ;

    static {
        Covode.recordClassIndex(11359);
    }

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

    public final Room LIZ() {
        return (Room) this.LIZ.getValue();
    }

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

    public final void onViewCreated(View view, Bundle bundle) {
        int i;
        RoomAuthStatus roomAuthStatus;
        RoomAuthStatus roomAuthStatus2;
        M12.LIZ(view);
        super.onViewCreated(view, bundle);
        if (LIZ() != null) {
            ((FrameLayout) LIZ(2131362569)).setOnClickListener(new C1008FuD(this));
            LinearLayout linearLayout = (LinearLayout) LIZ(2131369260);
            n.LIZIZ(linearLayout, "");
            Room LIZ2 = LIZ();
            boolean z = false;
            if (LIZ2 == null || (roomAuthStatus2 = LIZ2.getRoomAuthStatus()) == null || roomAuthStatus2.getRankingsSwitchStatus() != 0) {
                i = 0;
            } else {
                i = 8;
            }
            linearLayout.setVisibility(i);
            041 LIZ3 = LIZ(2131369258);
            n.LIZIZ(LIZ3, "");
            Room LIZ4 = LIZ();
            if (!(LIZ4 == null || (roomAuthStatus = LIZ4.getRoomAuthStatus()) == null || roomAuthStatus.getRankingsSwitchStatus() != 1)) {
                z = true;
            }
            LIZ3.setChecked(z);
            ((FrameLayout) LIZ(2131369261)).setOnClickListener(new C1123Fw4(this));
        }
    }

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