package com.bytedance.android.livesdk.chatroom.widget;

import X.0AA;
import X.0CB;
import X.0CH;
import X.0cm;
import X.1ey;
import X.6Is;
import X.C1653GBa;
import X.C1671GBs;
import X.C2675Gg0;
import X.C3026Glf;
import X.C4366HHj;
import X.GAX;
import X.GB7;
import X.GBF;
import X.GBX;
import X.GBY;
import X.GBZ;
import X.HG2;
import X.LnI;
import android.content.res.Resources;
import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
import com.bytedance.android.live.definition.IDefinitionService;
import com.bytedance.android.live.livepullstream.api.IPullStreamService;
import com.bytedance.android.livesdk.livesetting.watchlive.LiveUnionPraiseGiftInToolBarSetting;
import com.bytedance.android.livesdkapi.session.EnterRoomLinkSession;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import com.bytedance.ies.sdk.widgets.LiveRecyclableWidget;
import com.bytedance.ies.sdk.widgets.WidgetExtendsKt;
import kotlin.h.b.n;

public final class DefinitionSelectionWidget extends LiveRecyclableWidget implements View.OnClickListener, 6Is {
    public static final C1653GBa LIZ = new C1653GBa((byte) 0);
    public ImageView LIZIZ;

    static {
        Covode.recordClassIndex(14680);
    }

    public final int getLayoutId() {
        return 2131562172;
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final void onUnload() {
    }

    public final void onClick(View view) {
        0AA r2;
        DataChannel dataChannel = this.dataChannel;
        if (dataChannel != null && (r2 = (0AA) dataChannel.LIZIZ(HG2.class)) != null) {
            0cm.LIZ(IDefinitionService.class).showDefinitionSelectionDialog(r2, false);
        }
    }

    public final void onInit(Object[] objArr) {
        View view = getView();
        if (view != null) {
            view.setOnClickListener(this);
        }
        this.LIZIZ = (ImageView) getView();
        if (!LiveUnionPraiseGiftInToolBarSetting.isEnable()) {
            ImageView imageView = this.LIZIZ;
            if (imageView != null) {
                imageView.setBackgroundResource(2131235070);
            }
            Resources system = Resources.getSystem();
            n.LIZIZ(system, "");
            int LIZ2 = LnI.LIZ(TypedValue.applyDimension(1, 5.0f, system.getDisplayMetrics()));
            ImageView imageView2 = this.LIZIZ;
            if (imageView2 != null) {
                imageView2.setPadding(LIZ2, 0, LIZ2, 0);
            }
        }
    }

    public final void onLoad(Object[] objArr) {
        String LJI;
        ((C4366HHj) C2675Gg0.LIZ().LIZ(C1671GBs.class).LIZ(WidgetExtendsKt.autoDispose(this))).LIZ(new GBZ(this));
        DataChannel dataChannel = this.dataChannel;
        if (dataChannel != null) {
            dataChannel.LIZ((0CH) this, GB7.class, new GBY(this));
            dataChannel.LIZ((0CH) this, GBF.class, new GBX(this));
        }
        C3026Glf glf = GAX.LIZ;
        String str = "";
        n.LIZIZ(glf, str);
        EnterRoomLinkSession LIZ2 = glf.LIZ();
        n.LIZIZ(LIZ2, str);
        String str2 = LIZ2.LIZIZ.LIZLLL.LJJIJLIJ;
        if (str2 == null) {
            str2 = str;
        }
        IPullStreamService LIZ3 = 0cm.LIZ(IPullStreamService.class);
        n.LIZIZ(LIZ3, str);
        1ey LIZIZ2 = LIZ3.getLivePlayControllerManager().LIZIZ(str2);
        if (!(LIZIZ2 == null || (LJI = LIZIZ2.LJI()) == null)) {
            str = LJI;
        }
        LIZ(str);
    }

    /* JADX WARNING: Can't fix incorrect switch cases order */
    /* JADX WARNING: Code restructure failed: missing block: B:19:0x0052, code lost:
        if (r4.equals("hd") != false) goto L_0x0010;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:7:0x001e, code lost:
        if (r4.equals("hd_60") != false) goto L_0x0010;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(java.lang.String r4) {
        /*
            r3 = this;
            int r2 = r4.hashCode()
            r1 = 2131234692(0x7f080f84, float:1.8085557E38)
            r0 = 2131234689(0x7f080f81, float:1.808555E38)
            switch(r2) {
                case -1008619738: goto L_0x005c;
                case -846238328: goto L_0x0055;
                case 3324: goto L_0x004c;
                case 3448: goto L_0x0040;
                case 3665: goto L_0x0034;
                case 115761: goto L_0x002d;
                case 3005871: goto L_0x0021;
                case 99118301: goto L_0x0018;
                default: goto L_0x000d;
            }
        L_0x000d:
            r1 = 2131234689(0x7f080f81, float:1.808555E38)
        L_0x0010:
            android.widget.ImageView r0 = r3.LIZIZ
            if (r0 == 0) goto L_0x0017
            r0.setImageResource(r1)
        L_0x0017:
            return
        L_0x0018:
            java.lang.String r0 = "hd_60"
            boolean r0 = r4.equals(r0)
            if (r0 == 0) goto L_0x000d
            goto L_0x0010
        L_0x0021:
            java.lang.String r0 = "auto"
            boolean r0 = r4.equals(r0)
            if (r0 == 0) goto L_0x000d
            r1 = 2131234693(0x7f080f85, float:1.8085559E38)
            goto L_0x0010
        L_0x002d:
            java.lang.String r0 = "uhd"
            boolean r0 = r4.equals(r0)
            goto L_0x000d
        L_0x0034:
            java.lang.String r0 = "sd"
            boolean r0 = r4.equals(r0)
            if (r0 == 0) goto L_0x000d
            r1 = 2131234691(0x7f080f83, float:1.8085555E38)
            goto L_0x0010
        L_0x0040:
            java.lang.String r0 = "ld"
            boolean r0 = r4.equals(r0)
            if (r0 == 0) goto L_0x000d
            r1 = 2131234690(0x7f080f82, float:1.8085553E38)
            goto L_0x0010
        L_0x004c:
            java.lang.String r0 = "hd"
            boolean r0 = r4.equals(r0)
            if (r0 == 0) goto L_0x000d
            goto L_0x0010
        L_0x0055:
            java.lang.String r0 = "uhd_60"
            boolean r0 = r4.equals(r0)
            goto L_0x000d
        L_0x005c:
            java.lang.String r0 = "origin"
            boolean r0 = r4.equals(r0)
            if (r0 == 0) goto L_0x000d
            r1 = 2131234694(0x7f080f86, float:1.808556E38)
            goto L_0x0010
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.livesdk.chatroom.widget.DefinitionSelectionWidget.LIZ(java.lang.String):void");
    }
}
