package com.bytedance.android.livesdk.hashtag;

import X.0AA;
import X.0CB;
import X.0CH;
import X.0b0;
import X.0cm;
import X.6Is;
import X.C2478Gcp;
import X.C3491GtA;
import X.HFP;
import X.M12;
import com.bytedance.android.live.microom.IMicRoomService;
import com.bytedance.android.livesdk.model.Hashtag;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.covode.number.Covode;
import kotlin.h.b.n;

public final class AudienceHashTagWidget extends BaseHashTagWidget implements 6Is {
    public boolean LJ;
    public boolean LJFF;

    static {
        Covode.recordClassIndex(16777);
    }

    public final void LIZ(Hashtag hashtag) {
        M12.LIZ(hashtag);
    }

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

    public final void LIZIZ() {
        if (this.LJFF && !this.LJ) {
            this.LJ = true;
            C3491GtA LIZ = C3491GtA.LJFF.LIZ("livesdk_viewer_topic_show");
            LIZ.LIZ(this.dataChannel);
            LIZ.LIZLLL();
        }
    }

    public final void LIZ() {
        String str;
        C3491GtA LIZ = C3491GtA.LJFF.LIZ("livesdk_viewer_topic_click");
        if (0b0.LJFF()) {
            str = "portrait";
        } else {
            str = "landscape";
        }
        LIZ.LIZ("room_orientation", str);
        LIZ.LIZ(this.dataChannel);
        LIZ.LIZLLL();
    }

    public final void onGetRoomInfo(Room room) {
        super.onGetRoomInfo(room);
        attach();
    }

    public final void LIZ(0AA r4) {
        M12.LIZ(r4);
        HashtagAudienceDialog hashtagAudienceDialog = new HashtagAudienceDialog();
        String simpleName = BaseHashTagWidget.class.getSimpleName();
        n.LIZIZ(simpleName, "");
        hashtagAudienceDialog.show(r4, simpleName);
    }

    public final void onVisibilityToUser(boolean z) {
        super.onVisibilityToUser(z);
        this.LJFF = z;
        if (!z) {
            this.LJ = false;
        }
        if (isShowing()) {
            LIZIZ();
        }
    }

    public final void onLoad(Object[] objArr) {
        Boolean bool;
        super.onLoad(objArr);
        this.LJ = false;
        IMicRoomService LIZ = 0cm.LIZ(IMicRoomService.class);
        if (LIZ != null) {
            bool = Boolean.valueOf(LIZ.isMicRoomForCurrentRoom());
        } else {
            bool = null;
        }
        if (n.LIZ(bool, true)) {
            this.dataChannel.LIZ(HFP.class, false);
            hide();
        } else {
            this.dataChannel.LIZ(HFP.class, true);
            LIZJ();
        }
        this.dataChannel.LIZJ(C2478Gcp.class);
    }
}
