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 ItemAssignmentFileSubmissionBindingImpl extends ItemAssignmentFileSubmissionBinding implements com.toughra.ustadmobile.generated.callback.OnClickListener.Listener, com.toughra.ustadmobile.generated.callback.OnSelectionStateChangedListener.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 mCallback21;
    @Nullable
    private final com.ustadmobile.port.android.view.binding.OnSelectionStateChangedListener mCallback20;
    @Nullable
    private final android.view.View.OnClickListener mCallback22;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemAssignmentFileSubmissionBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 7, sIncludes, sViewsWithIds));
    }
    private ItemAssignmentFileSubmissionBindingImpl(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
        mCallback21 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback20 = new com.toughra.ustadmobile.generated.callback.OnSelectionStateChangedListener(this, 1);
        mCallback22 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 3);
        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.ClazzAssignmentWithCourseBlock) 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.fileNameText == variableId) {
            setFileNameText((java.lang.String) 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 {
            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.ClazzAssignmentWithCourseBlock 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;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.selectablePagedListAdapter);
        super.requestRebind();
    }
    public void setFileNameText(@Nullable java.lang.String FileNameText) {
        this.mFileNameText = FileNameText;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.fileNameText);
        super.requestRebind();
    }
    public void setFileSubmission(@Nullable com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment FileSubmission) {
        this.mFileSubmission = FileSubmission;
        synchronized(this) {
            mDirtyFlags |= 0x20L;
        }
        notifyPropertyChanged(BR.fileSubmission);
        super.requestRebind();
    }
    public void setEventHandler(@Nullable com.ustadmobile.core.controller.FileSubmissionListItemListener EventHandler) {
        this.mEventHandler = EventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x40L;
        }
        notifyPropertyChanged(BR.eventHandler);
        super.requestRebind();
    }
    public void setDateTimeMode(@Nullable java.lang.Integer DateTimeMode) {
        this.mDateTimeMode = DateTimeMode;
        synchronized(this) {
            mDirtyFlags |= 0x80L;
        }
        notifyPropertyChanged(BR.dateTimeMode);
        super.requestRebind();
    }
    public void setTimeZoneId(@Nullable java.lang.String TimeZoneId) {
        this.mTimeZoneId = TimeZoneId;
        synchronized(this) {
            mDirtyFlags |= 0x100L;
        }
        notifyPropertyChanged(BR.timeZoneId);
        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;
        java.lang.Boolean showFiles = mShowFiles;
        boolean fileNameTextJavaLangObjectNull = false;
        com.ustadmobile.port.android.view.SubmissionAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        int notSubmittedViewVISIBLEViewGONE = 0;
        boolean NotSubmitted1 = false;
        java.lang.String fileNameText = mFileNameText;
        com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment fileSubmission = mFileSubmission;
        android.text.Spanned fileNameTextJavaLangObjectNullHtmlFromHtmlFileNameTextSpannedStringValueOfJavaLangString = null;
        int showFilesViewVISIBLEViewGONE = 0;
        com.ustadmobile.core.controller.FileSubmissionListItemListener eventHandler = mEventHandler;
        int NotSubmittedViewVISIBLEViewGONE1 = 0;
        int androidxDatabindingViewDataBindingSafeUnboxDateTimeMode = 0;
        java.lang.Integer dateTimeMode = mDateTimeMode;
        android.text.Spanned htmlFromHtmlFileNameText = null;
        long fileSubmissionCasUid = 0;
        java.lang.String timeZoneId = mTimeZoneId;
        long fileSubmissionCasTimestamp = 0;

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



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


                // read androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted) ? View.VISIBLE : View.GONE
                notSubmittedViewVISIBLEViewGONE = ((androidxDatabindingViewDataBindingSafeUnboxNotSubmitted) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
                // 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
                NotSubmittedViewVISIBLEViewGONE1 = ((NotSubmitted1) ? (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 & 0x208L) != 0) {
        }
        if ((dirtyFlags & 0x210L) != 0) {



                // read fileNameText != null
                fileNameTextJavaLangObjectNull = (fileNameText) != (null);
            if((dirtyFlags & 0x210L) != 0) {
                if(fileNameTextJavaLangObjectNull) {
                        dirtyFlags |= 0x2000L;
                }
                else {
                        dirtyFlags |= 0x1000L;
                }
            }
        }
        if ((dirtyFlags & 0x3a0L) != 0) {


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

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

                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(fileNameText)
                htmlFromHtmlFileNameText = android.text.Html.fromHtml(fileNameText);
        }

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

                // read fileNameText != null ? Html.fromHtml(fileNameText) : SpannedString.valueOf("")
                fileNameTextJavaLangObjectNullHtmlFromHtmlFileNameTextSpannedStringValueOfJavaLangString = ((fileNameTextJavaLangObjectNull) ? (htmlFromHtmlFileNameText) : (android.text.SpannedString.valueOf("")));
        }
        // batch finished
        if ((dirtyFlags & 0x201L) != 0) {
            // api target 1

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

            this.fileDelete.setOnClickListener(mCallback22);
            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));
        }
        if ((dirtyFlags & 0x210L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fileName, fileNameTextJavaLangObjectNullHtmlFromHtmlFileNameTextSpannedStringValueOfJavaLangString);
        }
        if ((dirtyFlags & 0x3a0L) != 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);
        }
        if ((dirtyFlags & 0x220L) != 0) {
            // api target 1

            this.mboundView0.setTag(fileSubmissionCasUid);
        }
        if ((dirtyFlags & 0x208L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setSelectableViewHelper(this.mboundView0, selectablePagedListAdapter, mCallback21, mCallback20);
        }
    }
    // 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
                // 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 3: {
                // 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;
            }
        }
    }
    public final void _internalCallbackOnSelectionStateChanged(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // selectablePagedListAdapter != null
        boolean selectablePagedListAdapterJavaLangObjectNull = false;
        // selectablePagedListAdapter
        com.ustadmobile.port.android.view.SubmissionAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        // fileSubmission
        com.ustadmobile.lib.db.entities.CourseAssignmentSubmissionWithAttachment fileSubmission = mFileSubmission;



        selectablePagedListAdapterJavaLangObjectNull = (selectablePagedListAdapter) != (null);
        if (selectablePagedListAdapterJavaLangObjectNull) {




            selectablePagedListAdapter.onItemSelectedChanged(callbackArg_0, fileSubmission);
        }
    }
    // 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): fileNameText
        flag 5 (0x6L): fileSubmission
        flag 6 (0x7L): eventHandler
        flag 7 (0x8L): dateTimeMode
        flag 8 (0x9L): timeZoneId
        flag 9 (0xaL): null
        flag 10 (0xbL): androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted) ? View.VISIBLE : View.GONE
        flag 11 (0xcL): androidx.databinding.ViewDataBinding.safeUnbox(notSubmitted) ? View.VISIBLE : View.GONE
        flag 12 (0xdL): fileNameText != null ? Html.fromHtml(fileNameText) : SpannedString.valueOf("")
        flag 13 (0xeL): fileNameText != null ? Html.fromHtml(fileNameText) : 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
}