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 ItemAssignmentAddSubmissionBindingImpl extends ItemAssignmentAddSubmissionBinding 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.barrier_end, 6);
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback157;
    @Nullable
    private final android.view.View.OnClickListener mCallback158;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemAssignmentAddSubmissionBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 7, sIncludes, sViewsWithIds));
    }
    private ItemAssignmentAddSubmissionBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (androidx.constraintlayout.widget.Barrier) bindings[6]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[5]
            , (android.widget.TextView) bindings[2]
            , (android.widget.TextView) bindings[4]
            , (android.widget.TextView) bindings[3]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[1]
            );
        this.fileDelete.setTag(null);
        this.fileName.setTag(null);
        this.fileSubmissionDate.setTag(null);
        this.fileSubmissionDateLabel.setTag(null);
        this.fileThumbnail.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        mCallback157 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        mCallback158 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x200L;
        }
        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.notSubmitted == variableId) {
            setNotSubmitted((java.lang.Boolean) variable);
        }
        else if (BR.assignment == variableId) {
            setAssignment((com.ustadmobile.lib.db.entities.ClazzAssignment) variable);
        }
        else if (BR.showFiles == variableId) {
            setShowFiles((java.lang.Boolean) variable);
        }
        else if (BR.selectablePagedListAdapter == variableId) {
            setSelectablePagedListAdapter((com.ustadmobile.port.android.view.SubmissionAdapter) variable);
        }
        else if (BR.fileSubmission == variableId) {
            setFileSubmission((com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment) variable);
        }
        else if (BR.eventHandler == variableId) {
            setEventHandler((com.ustadmobile.core.controller.FileSubmissionListItemListener) variable);
        }
        else if (BR.dateTimeMode == variableId) {
            setDateTimeMode((java.lang.Integer) variable);
        }
        else if (BR.timeZoneId == variableId) {
            setTimeZoneId((java.lang.String) variable);
        }
        else if (BR.hasPassedDeadline == variableId) {
            setHasPassedDeadline((java.lang.Boolean) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setNotSubmitted(@Nullable java.lang.Boolean NotSubmitted) {
        this.mNotSubmitted = NotSubmitted;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.notSubmitted);
        super.requestRebind();
    }
    public void setAssignment(@Nullable com.ustadmobile.lib.db.entities.ClazzAssignment Assignment) {
        this.mAssignment = Assignment;
    }
    public void setShowFiles(@Nullable java.lang.Boolean ShowFiles) {
        this.mShowFiles = ShowFiles;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.showFiles);
        super.requestRebind();
    }
    public void setSelectablePagedListAdapter(@Nullable com.ustadmobile.port.android.view.SubmissionAdapter SelectablePagedListAdapter) {
        this.mSelectablePagedListAdapter = SelectablePagedListAdapter;
    }
    public void setFileSubmission(@Nullable com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment FileSubmission) {
        this.mFileSubmission = FileSubmission;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.fileSubmission);
        super.requestRebind();
    }
    public void setEventHandler(@Nullable com.ustadmobile.core.controller.FileSubmissionListItemListener EventHandler) {
        this.mEventHandler = EventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x20L;
        }
        notifyPropertyChanged(BR.eventHandler);
        super.requestRebind();
    }
    public void setDateTimeMode(@Nullable java.lang.Integer DateTimeMode) {
        this.mDateTimeMode = DateTimeMode;
        synchronized(this) {
            mDirtyFlags |= 0x40L;
        }
        notifyPropertyChanged(BR.dateTimeMode);
        super.requestRebind();
    }
    public void setTimeZoneId(@Nullable java.lang.String TimeZoneId) {
        this.mTimeZoneId = TimeZoneId;
        synchronized(this) {
            mDirtyFlags |= 0x80L;
        }
        notifyPropertyChanged(BR.timeZoneId);
        super.requestRebind();
    }
    public void setHasPassedDeadline(@Nullable java.lang.Boolean HasPassedDeadline) {
        this.mHasPassedDeadline = HasPassedDeadline;
        synchronized(this) {
            mDirtyFlags |= 0x100L;
        }
        notifyPropertyChanged(BR.hasPassedDeadline);
        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 androidxDatabindingViewDataBindingSafeUnboxNotSubmitted = false;
        java.lang.Boolean notSubmitted = mNotSubmitted;
        boolean androidxDatabindingViewDataBindingSafeUnboxShowFiles = false;
        int notSubmittedHasPassedDeadlineViewVISIBLEViewGONE = 0;
        boolean notSubmittedHasPassedDeadline = false;
        java.lang.Boolean showFiles = mShowFiles;
        java.lang.String fileSubmissionCasText = null;
        boolean NotSubmitted1 = false;
        android.text.Spanned fileSubmissionCasTextJavaLangObjectNullHtmlFromHtmlFileSubmissionCasTextSpannedStringValueOfJavaLangString = null;
        com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment fileSubmission = mFileSubmission;
        boolean androidxDatabindingViewDataBindingSafeUnboxHasPassedDeadline = false;
        int showFilesViewVISIBLEViewGONE = 0;
        boolean fileSubmissionCasTextJavaLangObjectNull = false;
        com.ustadmobile.core.controller.FileSubmissionListItemListener eventHandler = mEventHandler;
        int notSubmittedViewVISIBLEViewGONE = 0;
        android.text.Spanned htmlFromHtmlFileSubmissionCasText = null;
        int androidxDatabindingViewDataBindingSafeUnboxDateTimeMode = 0;
        java.lang.Integer dateTimeMode = mDateTimeMode;
        boolean hasPassedDeadline = false;
        long fileSubmissionCasUid = 0;
        java.lang.String timeZoneId = mTimeZoneId;
        java.lang.Boolean HasPassedDeadline1 = mHasPassedDeadline;
        long fileSubmissionCasTimestamp = 0;

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



                // read androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted)
                androidxDatabindingViewDataBindingSafeUnboxNotSubmitted = androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted);
                // read androidx.databinding.ViewDataBinding.safeUnbox(hasPassedDeadline)
                androidxDatabindingViewDataBindingSafeUnboxHasPassedDeadline = androidx.databinding.ViewDataBinding.safeUnbox(HasPassedDeadline1);

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

                    // read !androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted)
                    NotSubmitted1 = !androidxDatabindingViewDataBindingSafeUnboxNotSubmitted;
                if((dirtyFlags & 0x201L) != 0) {
                    if(NotSubmitted1) {
                            dirtyFlags |= 0x20000L;
                    }
                    else {
                            dirtyFlags |= 0x10000L;
                    }
                }


                    // read !androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted) ? View.VISIBLE : View.GONE
                    notSubmittedViewVISIBLEViewGONE = ((NotSubmitted1) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
            }

                // read !androidx.databinding.ViewDataBinding.safeUnbox(hasPassedDeadline)
                hasPassedDeadline = !androidxDatabindingViewDataBindingSafeUnboxHasPassedDeadline;


                // read (androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted)) & (!androidx.databinding.ViewDataBinding.safeUnbox(hasPassedDeadline))
                notSubmittedHasPassedDeadline = (androidxDatabindingViewDataBindingSafeUnboxNotSubmitted) & (hasPassedDeadline);
            if((dirtyFlags & 0x301L) != 0) {
                if(notSubmittedHasPassedDeadline) {
                        dirtyFlags |= 0x800L;
                }
                else {
                        dirtyFlags |= 0x400L;
                }
            }


                // read (androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted)) & (!androidx.databinding.ViewDataBinding.safeUnbox(hasPassedDeadline)) ? View.VISIBLE : View.GONE
                notSubmittedHasPassedDeadlineViewVISIBLEViewGONE = ((notSubmittedHasPassedDeadline) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        if ((dirtyFlags & 0x204L) != 0) {



                // read androidx.databinding.ViewDataBinding.safeUnbox(showFiles)
                androidxDatabindingViewDataBindingSafeUnboxShowFiles = androidx.databinding.ViewDataBinding.safeUnbox(showFiles);
            if((dirtyFlags & 0x204L) != 0) {
                if(androidxDatabindingViewDataBindingSafeUnboxShowFiles) {
                        dirtyFlags |= 0x8000L;
                }
                else {
                        dirtyFlags |= 0x4000L;
                }
            }


                // read androidx.databinding.ViewDataBinding.safeUnbox(showFiles) ? View.VISIBLE : View.GONE
                showFilesViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxShowFiles) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        if ((dirtyFlags & 0x2d0L) != 0) {


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

                    if (fileSubmission != null) {
                        // read fileSubmission.casText
                        fileSubmissionCasText = fileSubmission.getCasText();
                        // read fileSubmission.casUid
                        fileSubmissionCasUid = fileSubmission.getCasUid();
                    }


                    // read fileSubmission.casText != null
                    fileSubmissionCasTextJavaLangObjectNull = (fileSubmissionCasText) != (null);
                if((dirtyFlags & 0x210L) != 0) {
                    if(fileSubmissionCasTextJavaLangObjectNull) {
                            dirtyFlags |= 0x2000L;
                    }
                    else {
                            dirtyFlags |= 0x1000L;
                    }
                }
            }

                if (fileSubmission != null) {
                    // read fileSubmission.casTimestamp
                    fileSubmissionCasTimestamp = fileSubmission.getCasTimestamp();
                }
                // read androidx.databinding.ViewDataBinding.safeUnbox(dateTimeMode)
                androidxDatabindingViewDataBindingSafeUnboxDateTimeMode = androidx.databinding.ViewDataBinding.safeUnbox(dateTimeMode);
        }
        // batch finished

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

                // read Html.fromHtml(fileSubmission.casText)
                htmlFromHtmlFileSubmissionCasText = android.text.Html.fromHtml(fileSubmissionCasText);
        }

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

                // read fileSubmission.casText != null ? Html.fromHtml(fileSubmission.casText) : SpannedString.valueOf("")
                fileSubmissionCasTextJavaLangObjectNullHtmlFromHtmlFileSubmissionCasTextSpannedStringValueOfJavaLangString = ((fileSubmissionCasTextJavaLangObjectNull) ? (htmlFromHtmlFileSubmissionCasText) : (android.text.SpannedString.valueOf("")));
        }
        // batch finished
        if ((dirtyFlags & 0x301L) != 0) {
            // api target 1

            this.fileDelete.setVisibility(notSubmittedHasPassedDeadlineViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x200L) != 0) {
            // api target 1

            this.fileDelete.setOnClickListener(mCallback158);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fileSubmissionDateLabel, (fileSubmissionDateLabel.getResources().getString(R.string.submitted_cap)) + (':'));
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageFilePath(this.fileThumbnail, (java.lang.String)null, androidx.appcompat.content.res.AppCompatResources.getDrawable(fileThumbnail.getContext(), R.drawable.book_24px));
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setSelectableViewHelper(this.mboundView0, (com.ustadmobile.port.android.view.util.SelectableViewHelper)null, mCallback157, (com.ustadmobile.port.android.view.binding.OnSelectionStateChangedListener)null);
        }
        if ((dirtyFlags & 0x210L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fileName, fileSubmissionCasTextJavaLangObjectNullHtmlFromHtmlFileSubmissionCasTextSpannedStringValueOfJavaLangString);
            this.mboundView0.setTag(fileSubmissionCasUid);
        }
        if ((dirtyFlags & 0x201L) != 0) {
            // api target 1

            this.fileSubmissionDate.setVisibility(notSubmittedViewVISIBLEViewGONE);
            this.fileSubmissionDateLabel.setVisibility(notSubmittedViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x2d0L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.DatePickerBindingAdapter2Kt.setDateTime2(this.fileSubmissionDate, fileSubmissionCasTimestamp, timeZoneId, androidxDatabindingViewDataBindingSafeUnboxDateTimeMode);
        }
        if ((dirtyFlags & 0x204L) != 0) {
            // api target 1

            this.mboundView0.setVisibility(showFilesViewVISIBLEViewGONE);
        }
    }
    // 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
                // fileSubmission
                com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment fileSubmission = mFileSubmission;
                // eventHandler
                com.ustadmobile.core.controller.FileSubmissionListItemListener eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;



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



                    eventHandler.onClickOpenSubmission(fileSubmission);
                }
                break;
            }
            case 2: {
                // localize variables for thread safety
                // fileSubmission
                com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment fileSubmission = mFileSubmission;
                // eventHandler
                com.ustadmobile.core.controller.FileSubmissionListItemListener eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;



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



                    eventHandler.onClickDeleteSubmission(fileSubmission);
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): notSubmitted
        flag 1 (0x2L): assignment
        flag 2 (0x3L): showFiles
        flag 3 (0x4L): selectablePagedListAdapter
        flag 4 (0x5L): fileSubmission
        flag 5 (0x6L): eventHandler
        flag 6 (0x7L): dateTimeMode
        flag 7 (0x8L): timeZoneId
        flag 8 (0x9L): hasPassedDeadline
        flag 9 (0xaL): null
        flag 10 (0xbL): (androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted)) & (!androidx.databinding.ViewDataBinding.safeUnbox(hasPassedDeadline)) ? View.VISIBLE : View.GONE
        flag 11 (0xcL): (androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted)) & (!androidx.databinding.ViewDataBinding.safeUnbox(hasPassedDeadline)) ? View.VISIBLE : View.GONE
        flag 12 (0xdL): fileSubmission.casText != null ? Html.fromHtml(fileSubmission.casText) : SpannedString.valueOf("")
        flag 13 (0xeL): fileSubmission.casText != null ? Html.fromHtml(fileSubmission.casText) : SpannedString.valueOf("")
        flag 14 (0xfL): androidx.databinding.ViewDataBinding.safeUnbox(showFiles) ? View.VISIBLE : View.GONE
        flag 15 (0x10L): androidx.databinding.ViewDataBinding.safeUnbox(showFiles) ? View.VISIBLE : View.GONE
        flag 16 (0x11L): !androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted) ? View.VISIBLE : View.GONE
        flag 17 (0x12L): !androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted) ? View.VISIBLE : View.GONE
    flag mapping end*/
    //end
}