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 ItemAssignmentFileSubmissionHeaderBindingImpl extends ItemAssignmentFileSubmissionHeaderBinding  {

    @Nullable
    private static final androidx.databinding.ViewDataBinding.IncludedLayouts sIncludes;
    @Nullable
    private static final android.util.SparseIntArray sViewsWithIds;
    static {
        sIncludes = null;
        sViewsWithIds = new android.util.SparseIntArray();
        sViewsWithIds.put(R.id.submission_status_label, 7);
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemAssignmentFileSubmissionHeaderBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 8, sIncludes, sViewsWithIds));
    }
    private ItemAssignmentFileSubmissionHeaderBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.TextView) bindings[6]
            , (android.widget.ImageView) bindings[1]
            , (android.widget.TextView) bindings[7]
            , (android.widget.ImageView) bindings[3]
            , (android.widget.TextView) bindings[5]
            , (android.widget.TextView) bindings[4]
            , (android.widget.TextView) bindings[2]
            );
        this.itemPersonPenalty.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        this.submissionStatusIcon.setTag(null);
        this.submissionStatusScoreIcon.setTag(null);
        this.submissionStatusScoreLabel.setTag(null);
        this.submissionStatusScoreValue.setTag(null);
        this.submissionStatusValue.setTag(null);
        setRootTag(root);
        // listeners
        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.showPoints == variableId) {
            setShowPoints((java.lang.Boolean) variable);
        }
        else if (BR.assignment == variableId) {
            setAssignment((com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock) variable);
        }
        else if (BR.assignmentMark == variableId) {
            setAssignmentMark((com.ustadmobile.lib.db.entities.CourseAssignmentMark) variable);
        }
        else if (BR.assignmentStatus == variableId) {
            setAssignmentStatus((int) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setShowPoints(@Nullable java.lang.Boolean ShowPoints) {
        this.mShowPoints = ShowPoints;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.showPoints);
        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 setAssignmentMark(@Nullable com.ustadmobile.lib.db.entities.CourseAssignmentMark AssignmentMark) {
        this.mAssignmentMark = AssignmentMark;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.assignmentMark);
        super.requestRebind();
    }
    public void setAssignmentStatus(int AssignmentStatus) {
        this.mAssignmentStatus = AssignmentStatus;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.assignmentStatus);
        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 showPointsAssignmentMarkCamPenaltyInt0 = false;
        boolean assignmentMarkCamPenaltyInt0 = false;
        java.lang.Boolean showPoints = mShowPoints;
        java.lang.String assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPointsJavaLangString = null;
        java.lang.String assignmentMarkCamMarkJavaLangString = null;
        java.lang.String assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPointsJavaLangStringSubmissionStatusScoreValueAndroidStringPoints = null;
        com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock assignment = mAssignment;
        java.lang.String itemPersonPenaltyAndroidStringLatePenaltyAssignmentBlockCbLateSubmissionPenalty = null;
        int assignmentBlockCbMaxPoints = 0;
        com.ustadmobile.lib.db.entities.CourseAssignmentMark assignmentMark = mAssignmentMark;
        int showPointsViewVISIBLEViewGONE = 0;
        java.lang.String assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPoints = null;
        com.ustadmobile.lib.db.entities.CourseBlock assignmentBlock = null;
        boolean assignmentStatusCourseAssignmentSubmissionNOTSUBMITTED = false;
        float assignmentMarkCamMark = 0f;
        int assignmentMarkCamPenalty = 0;
        int showPointsAssignmentMarkCamPenaltyInt0ViewVISIBLEViewGONE = 0;
        int assignmentBlockCbLateSubmissionPenalty = 0;
        int assignmentStatusCourseAssignmentSubmissionNOTSUBMITTEDViewINVISIBLEViewVISIBLE = 0;
        int assignmentStatus = mAssignmentStatus;
        boolean androidxDatabindingViewDataBindingSafeUnboxShowPoints = false;

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



                // read androidx.databinding.ViewDataBinding.safeUnbox(showPoints)
                androidxDatabindingViewDataBindingSafeUnboxShowPoints = androidx.databinding.ViewDataBinding.safeUnbox(showPoints);
            if((dirtyFlags & 0x11L) != 0) {
                if(androidxDatabindingViewDataBindingSafeUnboxShowPoints) {
                        dirtyFlags |= 0x40L;
                }
                else {
                        dirtyFlags |= 0x20L;
                }
            }

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

                    // read androidx.databinding.ViewDataBinding.safeUnbox(showPoints) ? View.VISIBLE : View.GONE
                    showPointsViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxShowPoints) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
            }
        }
        if ((dirtyFlags & 0x16L) != 0) {



                if (assignment != null) {
                    // read assignment.block
                    assignmentBlock = assignment.getBlock();
                }


                if (assignmentBlock != null) {
                    // read assignment.block.cbMaxPoints
                    assignmentBlockCbMaxPoints = assignmentBlock.getCbMaxPoints();
                }
            if ((dirtyFlags & 0x12L) != 0) {

                    if (assignmentBlock != null) {
                        // read assignment.block.cbLateSubmissionPenalty
                        assignmentBlockCbLateSubmissionPenalty = assignmentBlock.getCbLateSubmissionPenalty();
                    }


                    // read @android:string/late_penalty
                    itemPersonPenaltyAndroidStringLatePenaltyAssignmentBlockCbLateSubmissionPenalty = itemPersonPenalty.getResources().getString(R.string.late_penalty, assignmentBlockCbLateSubmissionPenalty);
            }
        }
        if ((dirtyFlags & 0x17L) != 0) {


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

                    if (assignmentMark != null) {
                        // read assignmentMark.camMark
                        assignmentMarkCamMark = assignmentMark.getCamMark();
                    }


                    // read (assignmentMark.camMark) + ("/")
                    assignmentMarkCamMarkJavaLangString = (assignmentMarkCamMark) + ("/");


                    // read ((assignmentMark.camMark) + ("/")) + (assignment.block.cbMaxPoints)
                    assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPoints = (assignmentMarkCamMarkJavaLangString) + (assignmentBlockCbMaxPoints);


                    // read (((assignmentMark.camMark) + ("/")) + (assignment.block.cbMaxPoints)) + (" ")
                    assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPointsJavaLangString = (assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPoints) + (" ");


                    // read ((((assignmentMark.camMark) + ("/")) + (assignment.block.cbMaxPoints)) + (" ")) + (@android:string/points)
                    assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPointsJavaLangStringSubmissionStatusScoreValueAndroidStringPoints = (assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPointsJavaLangString) + (submissionStatusScoreValue.getResources().getString(R.string.points));
            }
            if ((dirtyFlags & 0x15L) != 0) {

                    if (assignmentMark != null) {
                        // read assignmentMark.camPenalty
                        assignmentMarkCamPenalty = assignmentMark.getCamPenalty();
                    }


                    // read assignmentMark.camPenalty != 0
                    assignmentMarkCamPenaltyInt0 = (assignmentMarkCamPenalty) != (0);


                    // read (androidx.databinding.ViewDataBinding.safeUnbox(showPoints)) & (assignmentMark.camPenalty != 0)
                    showPointsAssignmentMarkCamPenaltyInt0 = (androidxDatabindingViewDataBindingSafeUnboxShowPoints) & (assignmentMarkCamPenaltyInt0);
                if((dirtyFlags & 0x15L) != 0) {
                    if(showPointsAssignmentMarkCamPenaltyInt0) {
                            dirtyFlags |= 0x100L;
                    }
                    else {
                            dirtyFlags |= 0x80L;
                    }
                }


                    // read (androidx.databinding.ViewDataBinding.safeUnbox(showPoints)) & (assignmentMark.camPenalty != 0) ? View.VISIBLE : View.GONE
                    showPointsAssignmentMarkCamPenaltyInt0ViewVISIBLEViewGONE = ((showPointsAssignmentMarkCamPenaltyInt0) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
            }
        }
        if ((dirtyFlags & 0x18L) != 0) {



                // read assignmentStatus == CourseAssignmentSubmission.NOT_SUBMITTED
                assignmentStatusCourseAssignmentSubmissionNOTSUBMITTED = (assignmentStatus) == (com.ustadmobile.lib.db.entities.CourseAssignmentSubmission.NOT_SUBMITTED);
            if((dirtyFlags & 0x18L) != 0) {
                if(assignmentStatusCourseAssignmentSubmissionNOTSUBMITTED) {
                        dirtyFlags |= 0x400L;
                }
                else {
                        dirtyFlags |= 0x200L;
                }
            }


                // read assignmentStatus == CourseAssignmentSubmission.NOT_SUBMITTED ? View.INVISIBLE : View.VISIBLE
                assignmentStatusCourseAssignmentSubmissionNOTSUBMITTEDViewINVISIBLEViewVISIBLE = ((assignmentStatusCourseAssignmentSubmissionNOTSUBMITTED) ? (android.view.View.INVISIBLE) : (android.view.View.VISIBLE));
        }
        // batch finished
        if ((dirtyFlags & 0x12L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonPenalty, itemPersonPenaltyAndroidStringLatePenaltyAssignmentBlockCbLateSubmissionPenalty);
        }
        if ((dirtyFlags & 0x15L) != 0) {
            // api target 1

            this.itemPersonPenalty.setVisibility(showPointsAssignmentMarkCamPenaltyInt0ViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x18L) != 0) {
            // api target 1

            this.submissionStatusIcon.setVisibility(assignmentStatusCourseAssignmentSubmissionNOTSUBMITTEDViewINVISIBLEViewVISIBLE);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupKey(this.submissionStatusIcon, assignmentStatus);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setTextMessageIdOptionSelected(this.submissionStatusValue, assignmentStatus);
        }
        if ((dirtyFlags & 0x10L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupMap(this.submissionStatusIcon, com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragment.ASSIGNMENT_STATUS_MAP, (java.lang.Integer)null);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setTextMessageIdOptions(this.submissionStatusValue, com.ustadmobile.core.controller.SubmissionConstants.STATUS_MAP, (java.lang.Integer)null, (java.lang.String)null);
        }
        if ((dirtyFlags & 0x11L) != 0) {
            // api target 1

            this.submissionStatusScoreIcon.setVisibility(showPointsViewVISIBLEViewGONE);
            this.submissionStatusScoreLabel.setVisibility(showPointsViewVISIBLEViewGONE);
            this.submissionStatusScoreValue.setVisibility(showPointsViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x16L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.submissionStatusScoreValue, assignmentMarkCamMarkJavaLangStringAssignmentBlockCbMaxPointsJavaLangStringSubmissionStatusScoreValueAndroidStringPoints);
        }
    }
    // Listener Stub Implementations
    // callback impls
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): showPoints
        flag 1 (0x2L): assignment
        flag 2 (0x3L): assignmentMark
        flag 3 (0x4L): assignmentStatus
        flag 4 (0x5L): null
        flag 5 (0x6L): androidx.databinding.ViewDataBinding.safeUnbox(showPoints) ? View.VISIBLE : View.GONE
        flag 6 (0x7L): androidx.databinding.ViewDataBinding.safeUnbox(showPoints) ? View.VISIBLE : View.GONE
        flag 7 (0x8L): (androidx.databinding.ViewDataBinding.safeUnbox(showPoints)) & (assignmentMark.camPenalty != 0) ? View.VISIBLE : View.GONE
        flag 8 (0x9L): (androidx.databinding.ViewDataBinding.safeUnbox(showPoints)) & (assignmentMark.camPenalty != 0) ? View.VISIBLE : View.GONE
        flag 9 (0xaL): assignmentStatus == CourseAssignmentSubmission.NOT_SUBMITTED ? View.INVISIBLE : View.VISIBLE
        flag 10 (0xbL): assignmentStatus == CourseAssignmentSubmission.NOT_SUBMITTED ? View.INVISIBLE : View.VISIBLE
    flag mapping end*/
    //end
}