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 ItemAssignmentDetailAttemptBindingImpl extends ItemAssignmentDetailAttemptBinding 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 = null;
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback176;
    @Nullable
    private final com.ustadmobile.port.android.view.binding.OnSelectionStateChangedListener mCallback175;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemAssignmentDetailAttemptBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 7, sIncludes, sViewsWithIds));
    }
    private ItemAssignmentDetailAttemptBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.TextView) bindings[6]
            , (android.widget.ImageView) bindings[5]
            , (android.widget.TextView) bindings[4]
            , (de.hdodenhof.circleimageview.CircleImageView) bindings[1]
            , (android.widget.TextView) bindings[2]
            , (android.widget.ImageView) bindings[3]
            );
        this.attemptPrivateComment.setTag(null);
        this.attemptPrivateCommentImage.setTag(null);
        this.itemPersonFileSubmissionStatus.setTag(null);
        this.itemPersonNewitemicon.setTag(null);
        this.itemPersonText.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        this.submissionStatusIcon.setTag(null);
        setRootTag(root);
        // listeners
        mCallback176 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback175 = new com.toughra.ustadmobile.generated.callback.OnSelectionStateChangedListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x8L;
        }
        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.listener == variableId) {
            setListener((com.ustadmobile.core.controller.SubmissionSummaryListener) variable);
        }
        else if (BR.selectablePagedListAdapter == variableId) {
            setSelectablePagedListAdapter((com.ustadmobile.port.android.view.ClazzAssignmentDetailStudentProgressListOverviewFragment.PersonWithAssignmentStatementDisplayListRecyclerAdapter) variable);
        }
        else if (BR.person == variableId) {
            setPerson((com.ustadmobile.lib.db.entities.PersonGroupAssignmentSummary) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setListener(@Nullable com.ustadmobile.core.controller.SubmissionSummaryListener Listener) {
        this.mListener = Listener;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.listener);
        super.requestRebind();
    }
    public void setSelectablePagedListAdapter(@Nullable com.ustadmobile.port.android.view.ClazzAssignmentDetailStudentProgressListOverviewFragment.PersonWithAssignmentStatementDisplayListRecyclerAdapter SelectablePagedListAdapter) {
        this.mSelectablePagedListAdapter = SelectablePagedListAdapter;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.selectablePagedListAdapter);
        super.requestRebind();
    }
    public void setPerson(@Nullable com.ustadmobile.lib.db.entities.PersonGroupAssignmentSummary Person) {
        this.mPerson = Person;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.person);
        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;
        }
        int personFileSubmissionStatus = 0;
        boolean personFileSubmissionStatusCourseAssignmentSubmissionNOTSUBMITTED = false;
        int stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment = 0;
        com.ustadmobile.port.android.view.util.ForeignKeyAttachmentUriAdapter personDetailFragmentFOREIGNKEYADAPTERPERSON = null;
        int personFileSubmissionStatusCourseAssignmentSubmissionNOTSUBMITTEDViewINVISIBLEViewVISIBLE = 0;
        boolean personIsGroupAssignment = false;
        long personIsGroupAssignmentPersonSubmitterUidInt0 = 0;
        com.ustadmobile.core.controller.SubmissionSummaryListener listener = mListener;
        boolean PersonIsGroupAssignment1 = false;
        java.lang.String personLatestPrivateComment = null;
        long personSubmitterUid = 0;
        boolean personFileSubmissionStatusInt0 = false;
        com.ustadmobile.port.android.view.ClazzAssignmentDetailStudentProgressListOverviewFragment.PersonWithAssignmentStatementDisplayListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        com.ustadmobile.lib.db.entities.PersonGroupAssignmentSummary person = mPerson;
        int personFileSubmissionStatusInt0ViewGONEViewVISIBLE = 0;
        java.lang.String personName = null;

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

                // read PersonDetailFragment.FOREIGNKEYADAPTER_PERSON
                personDetailFragmentFOREIGNKEYADAPTERPERSON = com.ustadmobile.port.android.view.PersonDetailFragment.getFOREIGNKEYADAPTER_PERSON();
        }
        if ((dirtyFlags & 0xaL) != 0) {
        }
        if ((dirtyFlags & 0xcL) != 0) {



                if (person != null) {
                    // read person.fileSubmissionStatus
                    personFileSubmissionStatus = person.getFileSubmissionStatus();
                    // read person.isGroupAssignment
                    PersonIsGroupAssignment1 = person.isGroupAssignment();
                    // read person.latestPrivateComment
                    personLatestPrivateComment = person.getLatestPrivateComment();
                    // read person.name
                    personName = person.getName();
                }


                // read person.fileSubmissionStatus == CourseAssignmentSubmission.NOT_SUBMITTED
                personFileSubmissionStatusCourseAssignmentSubmissionNOTSUBMITTED = (personFileSubmissionStatus) == (com.ustadmobile.lib.db.entities.CourseAssignmentSubmission.NOT_SUBMITTED);
                // read person.fileSubmissionStatus == 0
                personFileSubmissionStatusInt0 = (personFileSubmissionStatus) == (0);
                // read !person.isGroupAssignment
                personIsGroupAssignment = !PersonIsGroupAssignment1;
                // read StringExtKt.visibleIfNotNullOrEmpty(person.latestPrivateComment)
                stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment = com.ustadmobile.port.android.view.ext.StringExtKt.visibleIfNotNullOrEmpty(personLatestPrivateComment);
            if((dirtyFlags & 0xcL) != 0) {
                if(personFileSubmissionStatusCourseAssignmentSubmissionNOTSUBMITTED) {
                        dirtyFlags |= 0x20L;
                }
                else {
                        dirtyFlags |= 0x10L;
                }
            }
            if((dirtyFlags & 0xcL) != 0) {
                if(personFileSubmissionStatusInt0) {
                        dirtyFlags |= 0x200L;
                }
                else {
                        dirtyFlags |= 0x100L;
                }
            }
            if((dirtyFlags & 0xcL) != 0) {
                if(personIsGroupAssignment) {
                        dirtyFlags |= 0x80L;
                }
                else {
                        dirtyFlags |= 0x40L;
                }
            }


                // read person.fileSubmissionStatus == CourseAssignmentSubmission.NOT_SUBMITTED ? View.INVISIBLE : View.VISIBLE
                personFileSubmissionStatusCourseAssignmentSubmissionNOTSUBMITTEDViewINVISIBLEViewVISIBLE = ((personFileSubmissionStatusCourseAssignmentSubmissionNOTSUBMITTED) ? (android.view.View.INVISIBLE) : (android.view.View.VISIBLE));
                // read person.fileSubmissionStatus == 0 ? View.GONE : View.VISIBLE
                personFileSubmissionStatusInt0ViewGONEViewVISIBLE = ((personFileSubmissionStatusInt0) ? (android.view.View.GONE) : (android.view.View.VISIBLE));
        }
        // batch finished

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

                if (person != null) {
                    // read person.submitterUid
                    personSubmitterUid = person.getSubmitterUid();
                }
        }

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

                // read !person.isGroupAssignment ? person.submitterUid : 0
                personIsGroupAssignmentPersonSubmitterUidInt0 = ((personIsGroupAssignment) ? (personSubmitterUid) : (0));
        }
        // batch finished
        if ((dirtyFlags & 0xcL) != 0) {
            // api target 1

            this.attemptPrivateComment.setVisibility(stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.attemptPrivateComment, personLatestPrivateComment);
            this.attemptPrivateCommentImage.setVisibility(stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment);
            this.itemPersonFileSubmissionStatus.setVisibility(personFileSubmissionStatusInt0ViewGONEViewVISIBLE);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setTextMessageIdOptionSelected(this.itemPersonFileSubmissionStatus, personFileSubmissionStatus);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKey(this.itemPersonNewitemicon, personIsGroupAssignmentPersonSubmitterUidInt0, (java.lang.String)null);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonText, personName);
            this.submissionStatusIcon.setVisibility(personFileSubmissionStatusCourseAssignmentSubmissionNOTSUBMITTEDViewINVISIBLEViewVISIBLE);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupKey(this.submissionStatusIcon, personFileSubmissionStatus);
        }
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setTextMessageIdOptions(this.itemPersonFileSubmissionStatus, com.ustadmobile.core.controller.SubmissionConstants.STATUS_MAP, (java.lang.Integer)null, (java.lang.String)null);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKeyAdapter(this.itemPersonNewitemicon, personDetailFragmentFOREIGNKEYADAPTERPERSON);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.imageForeignKeyPlaceholder(this.itemPersonNewitemicon, androidx.appcompat.content.res.AppCompatResources.getDrawable(itemPersonNewitemicon.getContext(), R.drawable.ic_account_circle_black_24dp));
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupMap(this.submissionStatusIcon, com.ustadmobile.port.android.view.ClazzAssignmentDetailOverviewFragment.ASSIGNMENT_STATUS_MAP, (java.lang.Integer)null);
        }
        if ((dirtyFlags & 0xaL) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setSelectableViewHelper(this.mboundView0, selectablePagedListAdapter, mCallback176, mCallback175);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // person
        com.ustadmobile.lib.db.entities.PersonGroupAssignmentSummary person = mPerson;
        // listener != null
        boolean listenerJavaLangObjectNull = false;
        // listener
        com.ustadmobile.core.controller.SubmissionSummaryListener listener = mListener;



        listenerJavaLangObjectNull = (listener) != (null);
        if (listenerJavaLangObjectNull) {



            listener.onClickPerson(person);
        }
    }
    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.ClazzAssignmentDetailStudentProgressListOverviewFragment.PersonWithAssignmentStatementDisplayListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        // person
        com.ustadmobile.lib.db.entities.PersonGroupAssignmentSummary person = mPerson;



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




            selectablePagedListAdapter.onItemSelectedChanged(callbackArg_0, person);
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): listener
        flag 1 (0x2L): selectablePagedListAdapter
        flag 2 (0x3L): person
        flag 3 (0x4L): null
        flag 4 (0x5L): person.fileSubmissionStatus == CourseAssignmentSubmission.NOT_SUBMITTED ? View.INVISIBLE : View.VISIBLE
        flag 5 (0x6L): person.fileSubmissionStatus == CourseAssignmentSubmission.NOT_SUBMITTED ? View.INVISIBLE : View.VISIBLE
        flag 6 (0x7L): !person.isGroupAssignment ? person.submitterUid : 0
        flag 7 (0x8L): !person.isGroupAssignment ? person.submitterUid : 0
        flag 8 (0x9L): person.fileSubmissionStatus == 0 ? View.GONE : View.VISIBLE
        flag 9 (0xaL): person.fileSubmissionStatus == 0 ? View.GONE : View.VISIBLE
    flag mapping end*/
    //end
}