package com.bytedance.ies.sdk.widgets;

import X.0CB;
import X.0CH;
import X.6Is;
import X.C2381GbG;
import com.bytedance.covode.number.Covode;

public abstract class LayeredLiveWidget extends LiveWidget implements ILayeredWidget, 6Is {
    public LayeredElementContext layeredElementContext;

    static {
        Covode.recordClassIndex(30513);
    }

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

    public LayeredElementContext getLayeredElementContext() {
        return this.layeredElementContext;
    }

    public void hide() {
        ConstraintProperty constraintPropertyById;
        LayeredElementContext layeredElementContext2 = this.layeredElementContext;
        if (layeredElementContext2 == null || (constraintPropertyById = layeredElementContext2.getConstraintPropertyById(getId())) == null) {
            super.hide();
        } else if (constraintPropertyById.visibility() == 0) {
            constraintPropertyById.visibility(8);
            C2381GbG gbG = this.widgetCallback;
            if (gbG != null) {
                gbG.onHide(this);
            }
        }
    }

    public void show() {
        ConstraintProperty constraintPropertyById;
        LayeredElementContext layeredElementContext2 = this.layeredElementContext;
        if (layeredElementContext2 == null || (constraintPropertyById = layeredElementContext2.getConstraintPropertyById(getId())) == null) {
            super.show();
        } else if (constraintPropertyById.visibility() == 8) {
            constraintPropertyById.visibility(0);
            C2381GbG gbG = this.widgetCallback;
            if (gbG != null) {
                gbG.onShow(this);
            }
        }
    }

    public void setLayeredElementContext(LayeredElementContext layeredElementContext2) {
        this.layeredElementContext = layeredElementContext2;
    }
}
