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 ItemAssignmentFileSubmissionBottomBindingImpl extends ItemAssignmentFileSubmissionBottomBinding 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 mCallback154;
    @Nullable
    private final android.view.View.OnClickListener mCallback155;
    // values
    // listeners
    // Inverse Binding Event Handlers

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

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x20L;
        }
        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.addFileVisible == variableId) {
            setAddFileVisible((java.lang.Boolean) variable);
        }
        else if (BR.assignment == variableId) {
            setAssignment((com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock) variable);
        }
        else if (BR.eventHandler == variableId) {
            setEventHandler((com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragmentEventHandler) variable);
        }
        else if (BR.addTextVisible == variableId) {
            setAddTextVisible((java.lang.Boolean) variable);
        }
        else if (BR.deadlinePassed == variableId) {
            setDeadlinePassed((java.lang.Boolean) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setAddFileVisible(@Nullable java.lang.Boolean AddFileVisible) {
        this.mAddFileVisible = AddFileVisible;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.addFileVisible);
        super.requestRebind();
    }
    public void setAssignment(@Nullable com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock Assignment) {
        this.mAssignment = Assignment;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.assignment);
        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 setAddTextVisible(@Nullable java.lang.Boolean AddTextVisible) {
        this.mAddTextVisible = AddTextVisible;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.addTextVisible);
        super.requestRebind();
    }
    public void setDeadlinePassed(@Nullable java.lang.Boolean DeadlinePassed) {
        this.mDeadlinePassed = DeadlinePassed;
    }

    @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;
        }
        java.lang.Boolean addFileVisible = mAddFileVisible;
        int assignmentCaFileType = 0;
        int addTextVisibleViewVISIBLEViewGONE = 0;
        com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock assignment = mAssignment;
        com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragmentEventHandler eventHandler = mEventHandler;
        java.lang.Boolean addTextVisible = mAddTextVisible;
        java.lang.String itemFileMaxNumberAndroidStringMaxNumberOfFilesAssignmentCaNumberOfFiles = null;
        boolean androidxDatabindingViewDataBindingSafeUnboxAddFileVisible = false;
        int assignmentCaNumberOfFiles = 0;
        int addFileVisibleViewVISIBLEViewGONE = 0;
        boolean androidxDatabindingViewDataBindingSafeUnboxAddTextVisible = false;

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



                // read androidx.databinding.ViewDataBinding.safeUnbox(addFileVisible)
                androidxDatabindingViewDataBindingSafeUnboxAddFileVisible = androidx.databinding.ViewDataBinding.safeUnbox(addFileVisible);
            if((dirtyFlags & 0x21L) != 0) {
                if(androidxDatabindingViewDataBindingSafeUnboxAddFileVisible) {
                        dirtyFlags |= 0x200L;
                }
                else {
                        dirtyFlags |= 0x100L;
                }
            }


                // read androidx.databinding.ViewDataBinding.safeUnbox(addFileVisible) ? View.VISIBLE : View.GONE
                addFileVisibleViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxAddFileVisible) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        if ((dirtyFlags & 0x22L) != 0) {



                if (assignment != null) {
                    // read assignment.caFileType
                    assignmentCaFileType = assignment.getCaFileType();
                    // read assignment.caNumberOfFiles
                    assignmentCaNumberOfFiles = assignment.getCaNumberOfFiles();
                }


                // read @android:string/max_number_of_files
                itemFileMaxNumberAndroidStringMaxNumberOfFilesAssignmentCaNumberOfFiles = itemFileMaxNumber.getResources().getString(R.string.max_number_of_files, assignmentCaNumberOfFiles);
        }
        if ((dirtyFlags & 0x28L) != 0) {



                // read androidx.databinding.ViewDataBinding.safeUnbox(addTextVisible)
                androidxDatabindingViewDataBindingSafeUnboxAddTextVisible = androidx.databinding.ViewDataBinding.safeUnbox(addTextVisible);
            if((dirtyFlags & 0x28L) != 0) {
                if(androidxDatabindingViewDataBindingSafeUnboxAddTextVisible) {
                        dirtyFlags |= 0x80L;
                }
                else {
                        dirtyFlags |= 0x40L;
                }
            }


                // read androidx.databinding.ViewDataBinding.safeUnbox(addTextVisible) ? View.VISIBLE : View.GONE
                addTextVisibleViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxAddTextVisible) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        // batch finished
        if ((dirtyFlags & 0x21L) != 0) {
            // api target 1

            this.itemFileMaxNumber.setVisibility(addFileVisibleViewVISIBLEViewGONE);
            this.itemFileTypeLabel.setVisibility(addFileVisibleViewVISIBLEViewGONE);
            this.itemFileTypeSelection.setVisibility(addFileVisibleViewVISIBLEViewGONE);
            this.submissionAddFileButton.setVisibility(addFileVisibleViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x22L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemFileMaxNumber, itemFileMaxNumberAndroidStringMaxNumberOfFilesAssignmentCaNumberOfFiles);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setTextMessageIdOptionSelected(this.itemFileTypeSelection, assignmentCaFileType);
        }
        if ((dirtyFlags & 0x20L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setTextMessageIdOptions(this.itemFileTypeSelection, com.ustadmobile.core.controller.SubmissionConstants.FILE_TYPE_MAP, (java.lang.Integer)null, (java.lang.String)null);
            this.submissionAddFileButton.setOnClickListener(mCallback155);
            this.submissionAddTextButton.setOnClickListener(mCallback154);
        }
        if ((dirtyFlags & 0x28L) != 0) {
            // api target 1

            this.submissionAddTextButton.setVisibility(addTextVisibleViewVISIBLEViewGONE);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        switch(sourceId) {
            case 1: {
                // 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.onAddTextClicked();
                }
                break;
            }
            case 2: {
                // 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.onAddFileClicked();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): addFileVisible
        flag 1 (0x2L): assignment
        flag 2 (0x3L): eventHandler
        flag 3 (0x4L): addTextVisible
        flag 4 (0x5L): deadlinePassed
        flag 5 (0x6L): null
        flag 6 (0x7L): androidx.databinding.ViewDataBinding.safeUnbox(addTextVisible) ? View.VISIBLE : View.GONE
        flag 7 (0x8L): androidx.databinding.ViewDataBinding.safeUnbox(addTextVisible) ? View.VISIBLE : View.GONE
        flag 8 (0x9L): androidx.databinding.ViewDataBinding.safeUnbox(addFileVisible) ? View.VISIBLE : View.GONE
        flag 9 (0xaL): androidx.databinding.ViewDataBinding.safeUnbox(addFileVisible) ? View.VISIBLE : View.GONE
    flag mapping end*/
    //end
}