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

import X.0CB;
import X.0CH;
import X.0cm;
import X.29n;
import X.6Is;
import X.C1654GBb;
import X.C1655GBc;
import X.C1671GBs;
import X.C2436Gc9;
import X.C2675Gg0;
import X.C3491GtA;
import X.C4366HHj;
import X.HFY;
import android.view.View;
import android.widget.ImageView;
import com.bytedance.android.live.definition.IDefinitionService;
import com.bytedance.android.livesdk.livesetting.watchlive.LiveUnionPraiseGiftInToolBarSetting;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.widgets.LiveRecyclableWidget;
import com.bytedance.ies.sdk.widgets.WidgetExtendsKt;

public class OrientationChangeWidget extends LiveRecyclableWidget implements View.OnClickListener, 6Is {
    static {
        Covode.recordClassIndex(14695);
    }

    public int getLayoutId() {
        return 2131562169;
    }

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

    public void onUnload() {
    }

    public void onInit(Object[] objArr) {
        getView().setOnClickListener(this);
    }

    public void onLoad(Object[] objArr) {
        int i;
        ((C4366HHj) C2675Gg0.LIZ().LIZ(C1671GBs.class).LIZ(WidgetExtendsKt.autoDispose(this))).LIZ(new C1654GBb(this));
        ImageView imageView = (ImageView) getView().findViewById(2131365854);
        if (LiveUnionPraiseGiftInToolBarSetting.isEnable()) {
            i = 2131234910;
        } else {
            i = 2131234911;
        }
        imageView.setImageResource(i);
    }

    public void onClick(View view) {
        IDefinitionService LIZ;
        if (this.dataChannel != null) {
            this.dataChannel.LIZJ(C2436Gc9.class);
        }
        if (this.dataChannel != null) {
            this.dataChannel.LIZJ(29n.class);
        }
        C3491GtA LIZ2 = C3491GtA.LJFF.LIZ("livesdk_screen_rotate");
        LIZ2.LIZ(this.dataChannel);
        LIZ2.LIZ("type", "landscape_to_portrait");
        LIZ2.LIZ("room_orientation", "landscape");
        LIZ2.LIZJ("live");
        LIZ2.LIZLLL("click");
        LIZ2.LJ("live_landscape");
        LIZ2.LIZLLL();
        if (this.dataChannel != null) {
            Object LIZIZ = this.dataChannel.LIZIZ(HFY.class);
            Long l = (Long) this.dataChannel.LIZIZ(C1655GBc.class);
            if (LIZIZ != null && l != null && (LIZ = 0cm.LIZ(IDefinitionService.class)) != null) {
                LIZ.reportAudienceRotateBtnClick(String.valueOf(LIZIZ), l.longValue(), "0", "click");
                this.dataChannel.LIZIZ(C1655GBc.class, Long.valueOf(System.currentTimeMillis()));
            }
        }
    }
}
