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 ItemMarkFileSubmissionBindingImpl extends ItemMarkFileSubmissionBinding 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 = new android.util.SparseIntArray();
        sViewsWithIds.put(R.id.mark_file_submission_mark, 4);
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback64;
    @Nullable
    private final android.view.View.OnClickListener mCallback63;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemMarkFileSubmissionBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 5, sIncludes, sViewsWithIds));
    }
    private ItemMarkFileSubmissionBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (com.google.android.material.textfield.TextInputEditText) bindings[4]
            , (android.widget.Button) bindings[2]
            , (android.widget.Button) bindings[3]
            , (com.google.android.material.textfield.TextInputLayout) bindings[1]
            );
        this.markFileSubmissionSubmitGrade.setTag(null);
        this.markFileSubmissionSubmitGradeAndNext.setTag(null);
        this.markFileSubmissionTextInput.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        mCallback64 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback63 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x40L;
        }
        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.mark == variableId) {
            setMark((com.ustadmobile.lib.db.entities.CourseAssignmentMark) variable);
        }
        else if (BR.markNextStudentVisible == variableId) {
            setMarkNextStudentVisible((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.ClazzAssignmentDetailStudentProgressFragmentEventHandler) variable);
        }
        else if (BR.markStudentVisible == variableId) {
            setMarkStudentVisible((java.lang.Boolean) variable);
        }
        else if (BR.errorText == variableId) {
            setErrorText((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setMark(@Nullable com.ustadmobile.lib.db.entities.CourseAssignmentMark Mark) {
        this.mMark = Mark;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.mark);
        super.requestRebind();
    }
    public void setMarkNextStudentVisible(@Nullable java.lang.Boolean MarkNextStudentVisible) {
        this.mMarkNextStudentVisible = MarkNextStudentVisible;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.markNextStudentVisible);
        super.requestRebind();
    }
    public void setAssignment(@Nullable com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock Assignment) {
        this.mAssignment = Assignment;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.assignment);
        super.requestRebind();
    }
    public void setEventHandler(@Nullable com.ustadmobile.port.android.view.ClazzAssignmentDetailStudentProgressFragmentEventHandler EventHandler) {
        this.mEventHandler = EventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.eventHandler);
        super.requestRebind();
    }
    public void setMarkStudentVisible(@Nullable java.lang.Boolean MarkStudentVisible) {
        this.mMarkStudentVisible = MarkStudentVisible;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.markStudentVisible);
        super.requestRebind();
    }
    public void setErrorText(@Nullable java.lang.String ErrorText) {
        this.mErrorText = ErrorText;
        synchronized(this) {
            mDirtyFlags |= 0x20L;
        }
        notifyPropertyChanged(BR.errorText);
        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;
        }
        java.lang.String markJavaLangObjectNullMarkFileSubmissionSubmitGradeAndroidStringSubmitGradeMarkFileSubmissionSubmitGradeAndroidStringUpdateGrade = null;
        int markNextStudentVisibleViewVISIBLEViewGONE = 0;
        boolean androidxDatabindingViewDataBindingSafeUnboxMarkNextStudentVisible = false;
        com.ustadmobile.lib.db.entities.CourseAssignmentMark mark = mMark;
        java.lang.String markJavaLangObjectNullMarkFileSubmissionSubmitGradeAndNextAndroidStringSubmitGradeAndMarkNextMarkFileSubmissionSubmitGradeAndNextAndroidStringUpdateGradeAndMarkNext = null;
        java.lang.Boolean markNextStudentVisible = mMarkNextStudentVisible;
        com.ustadmobile.lib.db.entities.ClazzAssignmentWithCourseBlock assignment = mAssignment;
        com.ustadmobile.port.android.view.ClazzAssignmentDetailStudentProgressFragmentEventHandler eventHandler = mEventHandler;
        java.lang.Boolean markStudentVisible = mMarkStudentVisible;
        int assignmentBlockCbMaxPoints = 0;
        com.ustadmobile.lib.db.entities.CourseBlock assignmentBlock = null;
        int markStudentVisibleViewVISIBLEViewGONE = 0;
        boolean errorTextJavaLangObjectNull = false;
        java.lang.String javaLangStringAssignmentBlockCbMaxPoints = null;
        boolean androidxDatabindingViewDataBindingSafeUnboxMarkStudentVisible = false;
        boolean markJavaLangObjectNull = false;
        java.lang.String errorText = mErrorText;

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



                // read mark == null
                markJavaLangObjectNull = (mark) == (null);
            if((dirtyFlags & 0x41L) != 0) {
                if(markJavaLangObjectNull) {
                        dirtyFlags |= 0x100L;
                        dirtyFlags |= 0x1000L;
                }
                else {
                        dirtyFlags |= 0x80L;
                        dirtyFlags |= 0x800L;
                }
            }


                // read mark == null ? @android:string/submit_grade : @android:string/update_grade
                markJavaLangObjectNullMarkFileSubmissionSubmitGradeAndroidStringSubmitGradeMarkFileSubmissionSubmitGradeAndroidStringUpdateGrade = ((markJavaLangObjectNull) ? (markFileSubmissionSubmitGrade.getResources().getString(R.string.submit_grade)) : (markFileSubmissionSubmitGrade.getResources().getString(R.string.update_grade)));
                // read mark == null ? @android:string/submit_grade_and_mark_next : @android:string/update_grade_and_mark_next
                markJavaLangObjectNullMarkFileSubmissionSubmitGradeAndNextAndroidStringSubmitGradeAndMarkNextMarkFileSubmissionSubmitGradeAndNextAndroidStringUpdateGradeAndMarkNext = ((markJavaLangObjectNull) ? (markFileSubmissionSubmitGradeAndNext.getResources().getString(R.string.submit_grade_and_mark_next)) : (markFileSubmissionSubmitGradeAndNext.getResources().getString(R.string.update_grade_and_mark_next)));
        }
        if ((dirtyFlags & 0x42L) != 0) {



                // read androidx.databinding.ViewDataBinding.safeUnbox(markNextStudentVisible)
                androidxDatabindingViewDataBindingSafeUnboxMarkNextStudentVisible = androidx.databinding.ViewDataBinding.safeUnbox(markNextStudentVisible);
            if((dirtyFlags & 0x42L) != 0) {
                if(androidxDatabindingViewDataBindingSafeUnboxMarkNextStudentVisible) {
                        dirtyFlags |= 0x400L;
                }
                else {
                        dirtyFlags |= 0x200L;
                }
            }


                // read androidx.databinding.ViewDataBinding.safeUnbox(markNextStudentVisible) ? View.VISIBLE : View.GONE
                markNextStudentVisibleViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxMarkNextStudentVisible) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        if ((dirtyFlags & 0x44L) != 0) {



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


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


                // read ("/") + (assignment.block.cbMaxPoints)
                javaLangStringAssignmentBlockCbMaxPoints = ("/") + (assignmentBlockCbMaxPoints);
        }
        if ((dirtyFlags & 0x50L) != 0) {



                // read androidx.databinding.ViewDataBinding.safeUnbox(markStudentVisible)
                androidxDatabindingViewDataBindingSafeUnboxMarkStudentVisible = androidx.databinding.ViewDataBinding.safeUnbox(markStudentVisible);
            if((dirtyFlags & 0x50L) != 0) {
                if(androidxDatabindingViewDataBindingSafeUnboxMarkStudentVisible) {
                        dirtyFlags |= 0x4000L;
                }
                else {
                        dirtyFlags |= 0x2000L;
                }
            }


                // read androidx.databinding.ViewDataBinding.safeUnbox(markStudentVisible) ? View.VISIBLE : View.GONE
                markStudentVisibleViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxMarkStudentVisible) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        if ((dirtyFlags & 0x60L) != 0) {



                // read errorText != null
                errorTextJavaLangObjectNull = (errorText) != (null);
        }
        // batch finished
        if ((dirtyFlags & 0x50L) != 0) {
            // api target 1

            this.markFileSubmissionSubmitGrade.setVisibility(markStudentVisibleViewVISIBLEViewGONE);
            this.markFileSubmissionTextInput.setVisibility(markStudentVisibleViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x40L) != 0) {
            // api target 1

            this.markFileSubmissionSubmitGrade.setOnClickListener(mCallback63);
            this.markFileSubmissionSubmitGradeAndNext.setOnClickListener(mCallback64);
            this.markFileSubmissionTextInput.setHint(com.ustadmobile.core.util.ext.StringExtKt.capitalizeFirstLetter(markFileSubmissionTextInput.getResources().getString(R.string.points)));
        }
        if ((dirtyFlags & 0x41L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.markFileSubmissionSubmitGrade, markJavaLangObjectNullMarkFileSubmissionSubmitGradeAndroidStringSubmitGradeMarkFileSubmissionSubmitGradeAndroidStringUpdateGrade);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.markFileSubmissionSubmitGradeAndNext, markJavaLangObjectNullMarkFileSubmissionSubmitGradeAndNextAndroidStringSubmitGradeAndMarkNextMarkFileSubmissionSubmitGradeAndNextAndroidStringUpdateGradeAndMarkNext);
        }
        if ((dirtyFlags & 0x42L) != 0) {
            // api target 1

            this.markFileSubmissionSubmitGradeAndNext.setVisibility(markNextStudentVisibleViewVISIBLEViewGONE);
            this.markFileSubmissionSubmitGradeAndNext.setEnabled(androidxDatabindingViewDataBindingSafeUnboxMarkNextStudentVisible);
        }
        if ((dirtyFlags & 0x44L) != 0) {
            // api target 1

            this.markFileSubmissionTextInput.setSuffixText(javaLangStringAssignmentBlockCbMaxPoints);
        }
        if ((dirtyFlags & 0x60L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.markFileSubmissionTextInput, errorText);
            this.markFileSubmissionTextInput.setErrorEnabled(errorTextJavaLangObjectNull);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        switch(sourceId) {
            case 2: {
                // localize variables for thread safety
                // eventHandler
                com.ustadmobile.port.android.view.ClazzAssignmentDetailStudentProgressFragmentEventHandler eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;



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


                    eventHandler.onSubmitGradeAndMarkNextClicked();
                }
                break;
            }
            case 1: {
                // localize variables for thread safety
                // eventHandler
                com.ustadmobile.port.android.view.ClazzAssignmentDetailStudentProgressFragmentEventHandler eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;



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


                    eventHandler.onSubmitGradeClicked();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): mark
        flag 1 (0x2L): markNextStudentVisible
        flag 2 (0x3L): assignment
        flag 3 (0x4L): eventHandler
        flag 4 (0x5L): markStudentVisible
        flag 5 (0x6L): errorText
        flag 6 (0x7L): null
        flag 7 (0x8L): mark == null ? @android:string/submit_grade : @android:string/update_grade
        flag 8 (0x9L): mark == null ? @android:string/submit_grade : @android:string/update_grade
        flag 9 (0xaL): androidx.databinding.ViewDataBinding.safeUnbox(markNextStudentVisible) ? View.VISIBLE : View.GONE
        flag 10 (0xbL): androidx.databinding.ViewDataBinding.safeUnbox(markNextStudentVisible) ? View.VISIBLE : View.GONE
        flag 11 (0xcL): mark == null ? @android:string/submit_grade_and_mark_next : @android:string/update_grade_and_mark_next
        flag 12 (0xdL): mark == null ? @android:string/submit_grade_and_mark_next : @android:string/update_grade_and_mark_next
        flag 13 (0xeL): androidx.databinding.ViewDataBinding.safeUnbox(markStudentVisible) ? View.VISIBLE : View.GONE
        flag 14 (0xfL): androidx.databinding.ViewDataBinding.safeUnbox(markStudentVisible) ? View.VISIBLE : View.GONE
    flag mapping end*/
    //end
}