package com.bytedance.android.livesdk.interaction.poll.ui.giftwidget;

import X.0CB;
import X.0CH;
import X.0bQ;
import X.0bX;
import X.0cm;
import X.1Mf;
import X.1sP;
import X.6Is;
import X.GTW;
import X.GWE;
import android.view.View;
import android.widget.TextView;
import com.bytedance.android.live.base.model.ImageModel;
import com.bytedance.android.live.gift.IGiftService;
import com.bytedance.android.livesdk.model.Gift;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.widgets.LiveRecyclableWidget;
import kotlin.h.b.n;

public final class GiftStartPollWidget extends LiveRecyclableWidget implements 6Is {
    public GWE LIZ;

    static {
        Covode.recordClassIndex(17287);
    }

    public final int getLayoutId() {
        return 2131562078;
    }

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

    public final void onUnload() {
    }

    public final void onInit(Object[] objArr) {
        IGiftService LIZ2 = 0cm.LIZ(IGiftService.class);
        n.LIZIZ(LIZ2, "");
        this.LIZ = LIZ2.getPollGifts();
    }

    public final void onLoad(Object[] objArr) {
        String str;
        String str2;
        Integer num;
        Integer num2;
        ImageModel imageModel;
        Gift gift;
        Gift gift2;
        Gift gift3;
        Gift gift4;
        Gift gift5;
        Gift gift6;
        1Mf findViewById = this.contentView.findViewById(2131365340);
        n.LIZIZ(findViewById, "");
        findViewById.setOutlineProvider(new GTW());
        findViewById.setClipToOutline(true);
        0bQ.LIZ(findViewById, "tiktok_live_basic_resource", "ttlive_bg_gift_poll_widget.png");
        0bQ.LIZ(this.contentView.findViewById(2131365341), "tiktok_live_basic_resource", "ttlive_icon_gift_poll_coin.png");
        0bQ.LIZ(this.contentView.findViewById(2131365342), "tiktok_live_basic_resource", "ttlive_icon_gift_poll_coin.png");
        if (this.LIZ != null) {
            1sP findViewById2 = this.contentView.findViewById(2131368646);
            1sP findViewById3 = this.contentView.findViewById(2131368652);
            View findViewById4 = this.contentView.findViewById(2131368645);
            n.LIZIZ(findViewById4, "");
            TextView textView = (TextView) findViewById4;
            GWE gwe = this.LIZ;
            ImageModel imageModel2 = null;
            if (gwe == null || (gift6 = gwe.LIZ) == null) {
                str = null;
            } else {
                str = gift6.LIZ;
            }
            textView.setText(str);
            View findViewById5 = this.contentView.findViewById(2131368651);
            n.LIZIZ(findViewById5, "");
            TextView textView2 = (TextView) findViewById5;
            GWE gwe2 = this.LIZ;
            if (gwe2 == null || (gift5 = gwe2.LIZIZ) == null) {
                str2 = null;
            } else {
                str2 = gift5.LIZ;
            }
            textView2.setText(str2);
            View findViewById6 = this.contentView.findViewById(2131367025);
            n.LIZIZ(findViewById6, "");
            TextView textView3 = (TextView) findViewById6;
            GWE gwe3 = this.LIZ;
            if (gwe3 == null || (gift4 = gwe3.LIZ) == null) {
                num = null;
            } else {
                num = Integer.valueOf(gift4.LJFF);
            }
            textView3.setText(String.valueOf(num));
            View findViewById7 = this.contentView.findViewById(2131369598);
            n.LIZIZ(findViewById7, "");
            TextView textView4 = (TextView) findViewById7;
            GWE gwe4 = this.LIZ;
            if (gwe4 == null || (gift3 = gwe4.LIZIZ) == null) {
                num2 = null;
            } else {
                num2 = Integer.valueOf(gift3.LJFF);
            }
            textView4.setText(String.valueOf(num2));
            GWE gwe5 = this.LIZ;
            if (gwe5 == null || (gift2 = gwe5.LIZ) == null) {
                imageModel = null;
            } else {
                imageModel = gift2.LJJ;
            }
            0bX.LIZIZ(findViewById2, imageModel);
            GWE gwe6 = this.LIZ;
            if (!(gwe6 == null || (gift = gwe6.LIZIZ) == null)) {
                imageModel2 = gift.LJJ;
            }
            0bX.LIZIZ(findViewById3, imageModel2);
        }
    }
}
