package com.toughra.ustadmobile.databinding;
import com.toughra.ustadmobile.R;
import com.toughra.ustadmobile.BR;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
@SuppressWarnings("unchecked")
public class ItemClazzEnrolmentListBindingImpl extends ItemClazzEnrolmentListBinding implements com.toughra.ustadmobile.generated.callback.OnClickListener.Listener {

    @Nullable
    private static final androidx.databinding.ViewDataBinding.IncludedLayouts sIncludes;
    @Nullable
    private static final android.util.SparseIntArray sViewsWithIds;
    static {
        sIncludes = null;
        sViewsWithIds = null;
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback184;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemClazzEnrolmentListBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 4, sIncludes, sViewsWithIds));
    }
    private ItemClazzEnrolmentListBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.ImageView) bindings[1]
            , (android.widget.TextView) bindings[2]
            , (android.widget.TextView) bindings[3]
            );
        this.itemClazzEnrolmentEditEnrolment.setTag(null);
        this.line1Text.setTag(null);
        this.line2Text.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        mCallback184 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x8L;
        }
        requestRebind();
    }

    @Override
    public boolean hasPendingBindings() {
        synchronized(this) {
            if (mDirtyFlags != 0) {
                return true;
            }
        }
        return false;
    }

    @Override
    public boolean setVariable(int variableId, @Nullable Object variable)  {
        boolean variableSet = true;
        if (BR.clazzEnrolment == variableId) {
            setClazzEnrolment((com.ustadmobile.lib.db.entities.ClazzEnrolmentWithLeavingReason) variable);
        }
        else if (BR.isEditVisible == variableId) {
            setIsEditVisible((java.lang.Boolean) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.ClazzEnrolmentListPresenter) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setClazzEnrolment(@Nullable com.ustadmobile.lib.db.entities.ClazzEnrolmentWithLeavingReason ClazzEnrolment) {
        this.mClazzEnrolment = ClazzEnrolment;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.clazzEnrolment);
        super.requestRebind();
    }
    public void setIsEditVisible(@Nullable java.lang.Boolean IsEditVisible) {
        this.mIsEditVisible = IsEditVisible;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.isEditVisible);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.ClazzEnrolmentListPresenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }

    @Override
    protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
        switch (localFieldId) {
        }
        return false;
    }

    @Override
    protected void executeBindings() {
        long dirtyFlags = 0;
        synchronized(this) {
            dirtyFlags = mDirtyFlags;
            mDirtyFlags = 0;
        }
        com.ustadmobile.lib.db.entities.ClazzEnrolmentWithLeavingReason clazzEnrolment = mClazzEnrolment;
        java.lang.Boolean isEditVisible = mIsEditVisible;
        long clazzEnrolmentClazzEnrolmentDateLeft = 0;
        int isEditVisibleViewVISIBLEViewGONE = 0;
        com.ustadmobile.core.controller.ClazzEnrolmentListPresenter presenter = mPresenter;
        boolean androidxDatabindingViewDataBindingSafeUnboxIsEditVisible = false;
        long clazzEnrolmentClazzEnrolmentDateJoined = 0;

        if ((dirtyFlags & 0x9L) != 0) {



                if (clazzEnrolment != null) {
                    // read clazzEnrolment.clazzEnrolmentDateLeft
                    clazzEnrolmentClazzEnrolmentDateLeft = clazzEnrolment.getClazzEnrolmentDateLeft();
                    // read clazzEnrolment.clazzEnrolmentDateJoined
                    clazzEnrolmentClazzEnrolmentDateJoined = clazzEnrolment.getClazzEnrolmentDateJoined();
                }
        }
        if ((dirtyFlags & 0xaL) != 0) {



                // read androidx.databinding.ViewDataBinding.safeUnbox(isEditVisible)
                androidxDatabindingViewDataBindingSafeUnboxIsEditVisible = androidx.databinding.ViewDataBinding.safeUnbox(isEditVisible);
            if((dirtyFlags & 0xaL) != 0) {
                if(androidxDatabindingViewDataBindingSafeUnboxIsEditVisible) {
                        dirtyFlags |= 0x20L;
                }
                else {
                        dirtyFlags |= 0x10L;
                }
            }


                // read androidx.databinding.ViewDataBinding.safeUnbox(isEditVisible) ? View.VISIBLE : View.GONE
                isEditVisibleViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxIsEditVisible) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        // batch finished
        if ((dirtyFlags & 0xaL) != 0) {
            // api target 1

            this.itemClazzEnrolmentEditEnrolment.setVisibility(isEditVisibleViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            this.itemClazzEnrolmentEditEnrolment.setOnClickListener(mCallback184);
        }
        if ((dirtyFlags & 0x9L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setMemberEnrolmentOutcome(this.line1Text, clazzEnrolment);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setEnrolmentTextFromToDateLong(this.line2Text, clazzEnrolmentClazzEnrolmentDateJoined, clazzEnrolmentClazzEnrolmentDateLeft);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // presenter != null
        boolean presenterJavaLangObjectNull = false;
        // clazzEnrolment
        com.ustadmobile.lib.db.entities.ClazzEnrolmentWithLeavingReason clazzEnrolment = mClazzEnrolment;
        // presenter
        com.ustadmobile.core.controller.ClazzEnrolmentListPresenter presenter = mPresenter;



        presenterJavaLangObjectNull = (presenter) != (null);
        if (presenterJavaLangObjectNull) {



            presenter.handleClickClazzEnrolment(clazzEnrolment);
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): clazzEnrolment
        flag 1 (0x2L): isEditVisible
        flag 2 (0x3L): presenter
        flag 3 (0x4L): null
        flag 4 (0x5L): androidx.databinding.ViewDataBinding.safeUnbox(isEditVisible) ? View.VISIBLE : View.GONE
        flag 5 (0x6L): androidx.databinding.ViewDataBinding.safeUnbox(isEditVisible) ? View.VISIBLE : View.GONE
    flag mapping end*/
    //end
}