package com.bytedance.android.live.liveinteract.multiguest.opt.widget;

import X.2cN;
import X.6Is;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.C10420bg;
import X.C10430bh;
import X.C14730id;
import X.C33671Vl;
import X.C33681Vm;
import X.C40901jk;
import X.C46271sP;
import X.GbK;
import X.HEP;
import X.HI6;
import X.HIR;
import X.Hjh;
import X.Mk2;
import X.Mk3;
import X.QDE;
import X.QDF;
import X.QDG;
import X.QHV;
import X.QHl;
import X.QIA;
import android.view.View;
import com.bytedance.android.live.base.model.ImageModel;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannelGlobal;
import com.bytedance.ies.sdk.widgets.LiveWidget;
import java.util.List;
import java.util.concurrent.TimeUnit;
import kotlin.h.b.n;

public final class MultiGuestAnchorAvatarBgWidget extends LiveWidget implements C14730id, 6Is {
    public C40901jk LIZ;
    public 2cN LIZIZ;
    public C46271sP LIZJ;
    public C46271sP LIZLLL;

    static {
        Covode.recordClassIndex(8083);
    }

    public final int getLayoutId() {
        return 2131561985;
    }

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

    public final void onDestroy() {
        MultiGuestAnchorAvatarBgWidget.super.onDestroy();
        2cN r0 = this.LIZIZ;
        if (r0 != null) {
            r0.dispose();
        }
    }

    /* JADX WARNING: type inference failed for: r2v2, types: [X.1sP, android.widget.ImageView] */
    /* JADX WARNING: type inference failed for: r0v24, types: [X.1sP, android.view.View] */
    public final void onCreate() {
        ImageModel imageModel;
        List<String> urls;
        User owner;
        MultiGuestAnchorAvatarBgWidget.super.onCreate();
        View findViewById = findViewById(2131368222);
        n.LIZIZ(findViewById, "");
        this.LIZJ = (C46271sP) findViewById;
        View findViewById2 = findViewById(2131368225);
        n.LIZIZ(findViewById2, "");
        this.LIZLLL = (C46271sP) findViewById2;
        View findViewById3 = findViewById(2131371886);
        n.LIZIZ(findViewById3, "");
        C40901jk r0 = (C40901jk) findViewById3;
        this.LIZ = r0;
        if (r0 == null) {
            n.LIZ("");
        }
        r0.setVisibility(0);
        this.LIZIZ = Hjh.LIZ(1, TimeUnit.SECONDS).LIZIZ(6).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZ(new C33671Vl(this), C33681Vm.LIZ);
        C46271sP r02 = this.LIZJ;
        if (r02 == null) {
            n.LIZ("");
        }
        r02.setVisibility(0);
        Room room = (Room) DataChannelGlobal.LIZLLL.LIZIZ(HEP.class);
        if (room == null || (owner = room.getOwner()) == null) {
            imageModel = null;
        } else {
            imageModel = owner.getAvatarThumb();
        }
        ? r2 = this.LIZJ;
        if (r2 == 0) {
            n.LIZ("");
        }
        C46271sP r03 = this.LIZJ;
        if (r03 == null) {
            n.LIZ("");
        }
        int width = r03.getWidth();
        C46271sP r04 = this.LIZJ;
        if (r04 == null) {
            n.LIZ("");
        }
        HI6.LIZ(r2, imageModel, width, r04.getHeight(), 2131234641);
        C46271sP r05 = this.LIZLLL;
        if (r05 == null) {
            n.LIZ("");
        }
        r05.setVisibility(0);
        HIR hir = new HIR(5, 0.74698794f);
        if (imageModel == null || (urls = imageModel.getUrls()) == null || urls.size() != 0) {
            GbK LIZ2 = C10420bg.LIZ();
            C10430bh.LIZ(LIZ2, imageModel);
            LIZ2.LIZ(0.74698794f);
            ? r06 = this.LIZLLL;
            if (r06 == 0) {
                n.LIZ("");
            }
            LIZ2.LIZ(r06);
            return;
        }
        QDF LIZ3 = QDF.LIZ(QDG.LIZ(2131234641));
        LIZ3.LJIIJ = hir;
        QDE LIZ4 = LIZ3.LIZ();
        QHl LIZIZ2 = QHV.LIZIZ();
        LIZIZ2.LIZIZ(LIZ4);
        C46271sP r07 = this.LIZLLL;
        if (r07 == null) {
            n.LIZ("");
        }
        LIZIZ2.LIZ(r07.getController());
        QIA LIZJ2 = LIZIZ2.LIZJ();
        C46271sP r08 = this.LIZLLL;
        if (r08 == null) {
            n.LIZ("");
        }
        r08.setController(LIZJ2);
    }
}
