package com.bytedance.android.live.broadcast.extendedscreen;

import X.2HN;
import X.2Pr;
import X.3G2;
import X.6Is;
import X.7vl;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.AnonymousClass10I;
import X.C10000b0;
import X.C45771rb;
import X.C45861rk;
import X.C45871rl;
import X.C45881rm;
import X.Crj;
import X.Fv7;
import X.GRs;
import X.GVK;
import X.GVZ;
import X.LsC;
import X.TZ1;
import android.view.View;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.widgets.LiveRecyclableWidget;
import com.bytedance.ies.sdk.widgets.LiveWidget;
import com.bytedance.ies.sdk.widgets.WidgetCreateTimeUtil;
import kotlin.h.b.n;

public final class ExtendedScreenWidget extends LiveRecyclableWidget implements 6Is {
    public GVK LIZ;
    public TZ1 LIZIZ;
    public final int LIZJ = 3G2.LIZIZ();
    public boolean LIZLLL;
    public GRs LJ = GRs.HIDE;
    public boolean LJFF;
    public boolean LJI;
    public String LJII = "draw";
    public LiveWidget LJIIIIZZ;
    public long LJIIIZ;
    public GVZ LJIIJ;
    public Room LJIIJJI;
    public final WidgetCreateTimeUtil LJIIL = new WidgetCreateTimeUtil((LsC) null, 1, (2HN) null);
    public int LJIILIIL = C10000b0.LIZ(200.0f);
    public int LJIILJJIL = C10000b0.LIZ(90.0f);
    public int LJIILL = C10000b0.LIZ(148.0f);
    public final Crj LJIILLIIL = 7vl.LIZ(new C45881rm(this));
    public final Crj LJIIZILJ = 7vl.LIZ(new C45861rk(this));
    public final Crj LJIJ = 7vl.LIZ(new C45871rl(this));
    public AnonymousClass10I LJIJI;
    public LsC<? super Float, 2Pr> LJIJJ;
    public final Crj LJIJJLI = 7vl.LIZ(new C45771rb(this));

    static {
        Covode.recordClassIndex(5160);
    }

    private final View LIZLLL() {
        return (View) this.LJIJJLI.getValue();
    }

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

    public final int getLayoutId() {
        return 2131562175;
    }

    public final void onStateChanged(AnonymousClass0CH r1, AnonymousClass0CB r2) {
        ExtendedScreenWidget.super.onStateChanged(r1, r2);
    }

    public final void onUnload() {
        TZ1 tz1 = this.LIZIZ;
        if (tz1 != null) {
            tz1.LIZIZ();
        }
    }

    public final void LIZIZ() {
        TZ1 tz1 = this.LIZIZ;
        if (tz1 != null) {
            tz1.setShouldHandleMove(false);
        }
        this.LJII = "link_accept";
        this.LJFF = true;
        LIZJ();
    }

    public final void LIZJ() {
        if (this.LJ != GRs.HIDE && !this.LJI) {
            this.LJI = true;
            TZ1 tz1 = this.LIZIZ;
            if (tz1 != null) {
                tz1.LIZ();
            }
        }
    }

    public final void LIZ(GVK gvk) {
        this.LIZ = gvk;
        TZ1 tz1 = this.LIZIZ;
        if (tz1 != null) {
            tz1.setGestureDetectLayout(gvk);
        }
        TZ1 tz12 = this.LIZIZ;
        if (tz12 != null) {
            LsC<? super Float, 2Pr> lsC = this.LJIJJ;
            if (lsC == null) {
                n.LIZ("");
            }
            tz12.setOnScrollListener(lsC);
        }
    }

    public final void onInit(Object[] objArr) {
        this.LIZIZ = findViewById(2131371567);
        this.LJIIJJI = (Room) this.dataChannel.LIZIZ(Fv7.class);
    }

    /* JADX WARNING: type inference failed for: r2v6, types: [X.0CH] */
    /* JADX WARNING: type inference failed for: r5v2, types: [X.0CH] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onLoad(java.lang.Object[] r13) {
        /*
            r12 = this;
            r4 = 1
            r2 = 0
            r0 = 0
            r3 = r13
            if (r3 == 0) goto L_0x0189
            int r1 = r3.length
            if (r1 != 0) goto L_0x0186
            r1 = 1
        L_0x000a:
            r1 = r1 ^ r4
            java.lang.Boolean r1 = java.lang.Boolean.valueOf(r1)
        L_0x000f:
            boolean r1 = X.G2l.LIZ(r1)
            if (r1 == 0) goto L_0x0028
            if (r3 == 0) goto L_0x0183
            r1 = r3[r2]
        L_0x0019:
            boolean r1 = r1 instanceof X.GVZ
            if (r1 == 0) goto L_0x0028
            r2 = r3[r2]
            java.lang.String r1 = "null cannot be cast to non-null type com.bytedance.android.livesdk.model.ViewLevelInExtendScreen"
            java.util.Objects.requireNonNull(r2, r1)
            X.GVZ r2 = (X.GVZ) r2
            r12.LJIIJ = r2
        L_0x0028:
            r12.hide()
            com.bytedance.android.livesdk.livesetting.broadcast.LiveEnableExtendedScreenSetting r2 = com.bytedance.android.livesdk.livesetting.broadcast.LiveEnableExtendedScreenSetting.INSTANCE
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r12.dataChannel
            if (r1 == 0) goto L_0x0039
            java.lang.Class<X.Fv7> r0 = X.Fv7.class
            java.lang.Object r0 = r1.LIZIZ(r0)
            com.bytedance.android.livesdkapi.depend.model.live.Room r0 = (com.bytedance.android.livesdkapi.depend.model.live.Room) r0
        L_0x0039:
            boolean r2 = r2.showTopInfo(r0)
            X.TZ1 r1 = r12.LIZIZ
            if (r1 == 0) goto L_0x0046
            X.GVK r0 = r12.LIZ
            r1.setGestureDetectLayout(r0)
        L_0x0046:
            X.1ri r1 = new X.1ri
            r1.<init>(r12)
            r12.LJIJJ = r1
            X.TZ1 r0 = r12.LIZIZ
            if (r0 == 0) goto L_0x0054
            r0.setOnScrollListener(r1)
        L_0x0054:
            X.TZ1 r1 = r12.LIZIZ
            if (r1 == 0) goto L_0x0060
            X.1rj r0 = new X.1rj
            r0.<init>(r12)
            r1.setOnScrollInterceptor(r0)
        L_0x0060:
            com.bytedance.ies.sdk.widgets.WidgetCreateTimeUtil r1 = r12.LJIIL
            X.1Mn r0 = X.C31351Mn.LIZ
            r12.enableSubWidgetManager(r1, r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r12.dataChannel
            java.lang.String r3 = ""
            if (r1 == 0) goto L_0x00ba
            java.lang.Class<X.HFc> r0 = X.HFc.class
            java.lang.Object r0 = r1.LIZIZ(r0)
            X.GIv r0 = (X.GIv) r0
            if (r0 == 0) goto L_0x00ba
            boolean r0 = X.G1a.LJ(r0)
            if (r0 != r4) goto L_0x00ba
            com.bytedance.android.livesdk.livesetting.broadcast.LiveEnableGiftRecordFilter r0 = com.bytedance.android.livesdk.livesetting.broadcast.LiveEnableGiftRecordFilter.INSTANCE
            boolean r0 = r0.isEnable()
            if (r0 == 0) goto L_0x00ba
            java.lang.Class<com.bytedance.android.live.publicscreen.api.IPublicScreenService> r0 = com.bytedance.android.live.publicscreen.api.IPublicScreenService.class
            X.0UT r4 = X.C11100cm.LIZ(r0)
            com.bytedance.android.live.publicscreen.api.IPublicScreenService r4 = (com.bytedance.android.live.publicscreen.api.IPublicScreenService) r4
            r5 = r12
            com.bytedance.ies.sdk.datachannel.DataChannel r6 = r12.dataChannel
            kotlin.h.b.n.LIZIZ(r6, r3)
            X.Crj r0 = r12.LJIILLIIL
            java.lang.Object r7 = r0.getValue()
            android.widget.TextView r7 = (android.widget.TextView) r7
            kotlin.h.b.n.LIZIZ(r7, r3)
            X.Crj r0 = r12.LJIJ
            java.lang.Object r8 = r0.getValue()
            X.GjM r8 = (X.GjM) r8
            kotlin.h.b.n.LIZIZ(r8, r3)
            r9 = 2131371561(0x7f0a2629, float:1.836316E38)
            r10 = 2131371565(0x7f0a262d, float:1.8363168E38)
            X.1KP r11 = new X.1KP
            r11.<init>(r12)
            X.10I r0 = r4.getGiftHistoryWidgetHelper(r5, r6, r7, r8, r9, r10, r11)
            r12.LJIJI = r0
        L_0x00ba:
            android.view.View r0 = r12.LIZLLL()
            kotlin.h.b.n.LIZIZ(r0, r3)
            android.view.ViewGroup$LayoutParams r5 = r0.getLayoutParams()
            java.lang.String r4 = "null cannot be cast to non-null type android.view.ViewGroup.MarginLayoutParams"
            java.util.Objects.requireNonNull(r5, r4)
            android.view.ViewGroup$MarginLayoutParams r5 = (android.view.ViewGroup.MarginLayoutParams) r5
            if (r2 == 0) goto L_0x0177
            int r2 = r12.LJIILIIL
            int r0 = r12.LJIILJJIL
            r5.topMargin = r0
        L_0x00d4:
            android.view.View r0 = r12.LIZ()
            kotlin.h.b.n.LIZIZ(r0, r3)
            android.view.ViewGroup$LayoutParams r1 = r0.getLayoutParams()
            java.util.Objects.requireNonNull(r1, r4)
            android.view.ViewGroup$MarginLayoutParams r1 = (android.view.ViewGroup.MarginLayoutParams) r1
            r1.topMargin = r2
            android.view.View r0 = r12.LIZ()
            kotlin.h.b.n.LIZIZ(r0, r3)
            r0.setLayoutParams(r1)
            X.10I r0 = r12.LJIJI
            if (r0 == 0) goto L_0x00f7
            r0.LIZ(r2)
        L_0x00f7:
            android.view.View r0 = r12.LIZLLL()
            kotlin.h.b.n.LIZIZ(r0, r3)
            r0.setLayoutParams(r5)
            com.bytedance.ies.sdk.widgets.RecyclableWidgetManager r2 = r12.subWidgetManager
            android.view.View r1 = r12.LIZ()
            java.lang.Class<com.bytedance.android.live.publicscreen.api.IPublicScreenService> r0 = com.bytedance.android.live.publicscreen.api.IPublicScreenService.class
            X.0UT r0 = X.C11100cm.LIZ(r0)
            com.bytedance.android.live.publicscreen.api.IPublicScreenService r0 = (com.bytedance.android.live.publicscreen.api.IPublicScreenService) r0
            java.lang.Class r0 = r0.getExtendedPublicScreenWidget()
            com.bytedance.ies.sdk.widgets.LiveRecyclableWidget r0 = r2.load(r1, r0)
            r12.LJIIIIZZ = r0
            boolean r0 = X.HM6.LIZ()
            if (r0 == 0) goto L_0x0137
            com.bytedance.ies.sdk.widgets.RecyclableWidgetManager r2 = r12.subWidgetManager
            android.view.View r1 = r12.LIZLLL()
            java.lang.Class<com.bytedance.android.live.gift.IGiftService> r0 = com.bytedance.android.live.gift.IGiftService.class
            X.0UT r0 = X.C11100cm.LIZ(r0)
            kotlin.h.b.n.LIZIZ(r0, r3)
            com.bytedance.android.live.gift.IGiftService r0 = (com.bytedance.android.live.gift.IGiftService) r0
            java.lang.Class r0 = r0.getExtendScreenGiftTrayWidget()
            r2.load(r1, r0)
        L_0x0137:
            com.bytedance.ies.sdk.datachannel.DataChannel r3 = r12.dataChannel
            r2 = r12
            java.lang.Class<X.GPI> r1 = X.GPI.class
            X.1rc r0 = new X.1rc
            r0.<init>(r12)
            r3.LIZ(r2, r1, r0)
            java.lang.Class<X.2A8> r1 = X.AnonymousClass2A8.class
            X.1rd r0 = new X.1rd
            r0.<init>(r12)
            r3.LIZIZ(r2, r1, r0)
            java.lang.Class<X.29w> r1 = X.C535429w.class
            X.1re r0 = new X.1re
            r0.<init>(r12)
            r3.LIZIZ(r2, r1, r0)
            java.lang.Class<X.2Ak> r1 = X.C53682Ak.class
            X.1rf r0 = new X.1rf
            r0.<init>(r12)
            r3.LIZIZ(r2, r1, r0)
            java.lang.Class<X.2AS> r1 = X.AnonymousClass2AS.class
            X.1rg r0 = new X.1rg
            r0.<init>(r12)
            r3.LIZIZ(r2, r1, r0)
            java.lang.Class<X.Gcc> r1 = X.Gcc.class
            X.1rh r0 = new X.1rh
            r0.<init>(r12)
            r3.LIZ(r2, r1, r0)
            return
        L_0x0177:
            int r2 = r12.LJIILL
            r0 = 1106247680(0x41f00000, float:30.0)
            int r0 = X.C10000b0.LIZ((float) r0)
            r5.topMargin = r0
            goto L_0x00d4
        L_0x0183:
            r1 = r0
            goto L_0x0019
        L_0x0186:
            r1 = 0
            goto L_0x000a
        L_0x0189:
            r1 = r0
            goto L_0x000f
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.broadcast.extendedscreen.ExtendedScreenWidget.onLoad(java.lang.Object[]):void");
    }
}
