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 ItemAssignmentSubmitButtonBindingImpl extends ItemAssignmentSubmitButtonBinding 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;
    @NonNull
    private final android.widget.TextView mboundView1;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback27;
    // values
    // listeners
    // Inverse Binding Event Handlers

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

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x10L;
        }
        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.deadlinePassed == variableId) {
            setDeadlinePassed((java.lang.Boolean) variable);
        }
        else if (BR.hasFilesToSubmit == variableId) {
            setHasFilesToSubmit((java.lang.Boolean) variable);
        }
        else if (BR.eventHandler == variableId) {
            setEventHandler((com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragmentEventHandler) variable);
        }
        else if (BR.unassignedError == variableId) {
            setUnassignedError((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setDeadlinePassed(@Nullable java.lang.Boolean DeadlinePassed) {
        this.mDeadlinePassed = DeadlinePassed;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.deadlinePassed);
        super.requestRebind();
    }
    public void setHasFilesToSubmit(@Nullable java.lang.Boolean HasFilesToSubmit) {
        this.mHasFilesToSubmit = HasFilesToSubmit;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.hasFilesToSubmit);
        super.requestRebind();
    }
    public void setEventHandler(@Nullable com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragmentEventHandler EventHandler) {
        this.mEventHandler = EventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.eventHandler);
        super.requestRebind();
    }
    public void setUnassignedError(@Nullable java.lang.String UnassignedError) {
        this.mUnassignedError = UnassignedError;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.unassignedError);
        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;
        }
        boolean androidxDatabindingViewDataBindingSafeUnboxDeadlinePassed = false;
        boolean unassignedErrorJavaLangObjectNull = false;
        java.lang.Boolean deadlinePassed = mDeadlinePassed;
        java.lang.Boolean hasFilesToSubmit = mHasFilesToSubmit;
        boolean DeadlinePassed1 = false;
        int unassignedErrorJavaLangObjectNullViewGONEViewVISIBLE = 0;
        int hasFilesToSubmitDeadlinePassedUnassignedErrorJavaLangObjectNullViewVISIBLEViewGONE = 0;
        com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragmentEventHandler eventHandler = mEventHandler;
        boolean hasFilesToSubmitDeadlinePassedUnassignedErrorJavaLangObjectNull = false;
        boolean hasFilesToSubmitDeadlinePassed = false;
        boolean androidxDatabindingViewDataBindingSafeUnboxHasFilesToSubmit = false;
        java.lang.String unassignedError = mUnassignedError;

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



                // read androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed)
                androidxDatabindingViewDataBindingSafeUnboxDeadlinePassed = androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed);
                // read androidx.databinding.ViewDataBinding.safeUnbox(hasFilesToSubmit)
                androidxDatabindingViewDataBindingSafeUnboxHasFilesToSubmit = androidx.databinding.ViewDataBinding.safeUnbox(hasFilesToSubmit);
                // read unassignedError == null
                unassignedErrorJavaLangObjectNull = (unassignedError) == (null);
            if((dirtyFlags & 0x18L) != 0) {
                if(unassignedErrorJavaLangObjectNull) {
                        dirtyFlags |= 0x40L;
                }
                else {
                        dirtyFlags |= 0x20L;
                }
            }


                // read !androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed)
                DeadlinePassed1 = !androidxDatabindingViewDataBindingSafeUnboxDeadlinePassed;


                // read (androidx.databinding.ViewDataBinding.safeUnbox(hasFilesToSubmit)) & (!androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed))
                hasFilesToSubmitDeadlinePassed = (androidxDatabindingViewDataBindingSafeUnboxHasFilesToSubmit) & (DeadlinePassed1);


                // read ((androidx.databinding.ViewDataBinding.safeUnbox(hasFilesToSubmit)) & (!androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed))) & (unassignedError == null)
                hasFilesToSubmitDeadlinePassedUnassignedErrorJavaLangObjectNull = (hasFilesToSubmitDeadlinePassed) & (unassignedErrorJavaLangObjectNull);
            if((dirtyFlags & 0x1bL) != 0) {
                if(hasFilesToSubmitDeadlinePassedUnassignedErrorJavaLangObjectNull) {
                        dirtyFlags |= 0x100L;
                }
                else {
                        dirtyFlags |= 0x80L;
                }
            }


                // read ((androidx.databinding.ViewDataBinding.safeUnbox(hasFilesToSubmit)) & (!androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed))) & (unassignedError == null) ? View.VISIBLE : View.GONE
                hasFilesToSubmitDeadlinePassedUnassignedErrorJavaLangObjectNullViewVISIBLEViewGONE = ((hasFilesToSubmitDeadlinePassedUnassignedErrorJavaLangObjectNull) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
            if ((dirtyFlags & 0x18L) != 0) {

                    // read unassignedError == null ? View.GONE : View.VISIBLE
                    unassignedErrorJavaLangObjectNullViewGONEViewVISIBLE = ((unassignedErrorJavaLangObjectNull) ? (android.view.View.GONE) : (android.view.View.VISIBLE));
            }
        }
        // batch finished
        if ((dirtyFlags & 0x18L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView1, unassignedError);
            this.mboundView1.setVisibility(unassignedErrorJavaLangObjectNullViewGONEViewVISIBLE);
        }
        if ((dirtyFlags & 0x10L) != 0) {
            // api target 1

            this.submissionAddTextButton.setOnClickListener(mCallback27);
        }
        if ((dirtyFlags & 0x1bL) != 0) {
            // api target 1

            this.submissionAddTextButton.setVisibility(hasFilesToSubmitDeadlinePassedUnassignedErrorJavaLangObjectNullViewVISIBLEViewGONE);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // eventHandler
        com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragmentEventHandler eventHandler = mEventHandler;
        // eventHandler != null
        boolean eventHandlerJavaLangObjectNull = false;



        eventHandlerJavaLangObjectNull = (eventHandler) != (null);
        if (eventHandlerJavaLangObjectNull) {


            eventHandler.onSubmitButtonClicked();
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): deadlinePassed
        flag 1 (0x2L): hasFilesToSubmit
        flag 2 (0x3L): eventHandler
        flag 3 (0x4L): unassignedError
        flag 4 (0x5L): null
        flag 5 (0x6L): unassignedError == null ? View.GONE : View.VISIBLE
        flag 6 (0x7L): unassignedError == null ? View.GONE : View.VISIBLE
        flag 7 (0x8L): ((androidx.databinding.ViewDataBinding.safeUnbox(hasFilesToSubmit)) & (!androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed))) & (unassignedError == null) ? View.VISIBLE : View.GONE
        flag 8 (0x9L): ((androidx.databinding.ViewDataBinding.safeUnbox(hasFilesToSubmit)) & (!androidx.databinding.ViewDataBinding.safeUnbox(deadlinePassed))) & (unassignedError == null) ? View.VISIBLE : View.GONE
    flag mapping end*/
    //end
}