package com.bytedance.android.livesdk.widget;

import X.0CB;
import X.0CH;
import X.0SE;
import X.0bg;
import X.15b;
import X.1sP;
import X.6Is;
import X.C2385GbK;
import X.C3333Gqc;
import X.C3340Gqj;
import X.C3664Gvx;
import X.C5112HeD;
import android.view.View;
import com.bytedance.android.live.base.model.ImageModel;
import com.bytedance.android.livesdk.livesetting.performance.degrade.BadPhonesWatchLiveCommonUIOptSetting;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.widgets.LiveWidget;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

public final class LiveReportMaskWidget extends LiveWidget implements 6Is {
    public static final Set<Long> LIZIZ = new LinkedHashSet();
    public static final C3333Gqc LIZJ = new C3333Gqc((byte) 0);
    public Room LIZ;
    public 1sP LIZLLL;
    public View LJ;
    public 0SE LJFF;
    public int LJI;

    public final int getLayoutId() {
        return 2131562229;
    }

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

    static {
        Covode.recordClassIndex(21664);
    }

    public final void hide() {
        super.hide();
        0SE r2 = this.LJFF;
        if (r2 != null) {
            r2.setMute(false, "report");
        }
        Room room = this.LIZ;
        if (room == null || room.maskLayer == null) {
            15b.LJ.LIZ(true);
        }
    }

    public final void show() {
        super.show();
        0SE r2 = this.LJFF;
        if (r2 != null) {
            r2.setMute(true, "report");
        }
        15b.LJ.LIZ(false);
    }

    public final void onCreate() {
        super.onCreate();
        View view = getView();
        if (view != null) {
            view.setOnClickListener(C3664Gvx.LIZ);
        }
        this.LIZLLL = findViewById(2131369493);
        this.LJ = findViewById(2131369494);
        LIZ();
    }

    private final void LIZ() {
        List list;
        ImageModel cover;
        int i = this.LJI;
        if (i == 1) {
            1sP r0 = this.LIZLLL;
            if (r0 != null) {
                r0.setVisibility(8);
            }
            View view = this.LJ;
            if (view != null) {
                view.setVisibility(8);
            }
        } else if (i == 2) {
            1sP r02 = this.LIZLLL;
            if (r02 != null) {
                r02.setVisibility(0);
            }
            View view2 = this.LJ;
            if (view2 != null) {
                view2.setVisibility(0);
            }
            float LIZ2 = (float) (C5112HeD.LIZ(getContext()) / C5112HeD.LIZIZ(getContext()));
            C2385GbK LIZ3 = 0bg.LIZ();
            Room room = this.LIZ;
            if (room == null || (cover = room.getCover()) == null) {
                list = null;
            } else {
                list = cover.getUrls();
            }
            LIZ3.LIZ((List<String>) list);
            if (!BadPhonesWatchLiveCommonUIOptSetting.INSTANCE.getDisableGaussBlurred()) {
                LIZ3.LIZ(5, LIZ2);
            }
            LIZ3.LIZ((View) this.LIZLLL);
            findViewById(2131362933).setOnClickListener(new C3340Gqj(this));
        }
    }

    public LiveReportMaskWidget(Room room, 0SE r2, int i) {
        this.LIZ = room;
        this.LJFF = r2;
        this.LJI = i;
    }

    public final void LIZ(Room room, 0SE r3, int i) {
        if (!this.isDestroyed && this.hasAttached) {
            this.LIZ = room;
            this.LJFF = r3;
            this.LJI = i;
            LIZ();
        }
    }
}
