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 ItemClazzmemberListItemBindingImpl extends ItemClazzmemberListItemBinding 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 mCallback94;
    @Nullable
    private final com.ustadmobile.port.android.view.binding.OnSelectionStateChangedListener mCallback93;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemClazzmemberListItemBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 5, sIncludes, sViewsWithIds));
    }
    private ItemClazzmemberListItemBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (androidx.appcompat.widget.AppCompatImageView) bindings[3]
            , (android.widget.TextView) bindings[4]
            , (de.hdodenhof.circleimageview.CircleImageView) bindings[1]
            , (android.widget.TextView) bindings[2]
            );
        this.itemClazzmemberLine2AttendanceTrafficlight.setTag(null);
        this.itemClazzmemberLine2Text.setTag(null);
        this.itemClazzmemberNewitemicon.setTag(null);
        this.itemClazzmemberText.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        mCallback94 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback93 = 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.personWithEnrolmentDetails == variableId) {
            setPersonWithEnrolmentDetails((com.ustadmobile.lib.db.entities.PersonWithClazzEnrolmentDetails) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.ClazzMemberListPresenter) variable);
        }
        else if (BR.selectablePagedListAdapter == variableId) {
            setSelectablePagedListAdapter((com.ustadmobile.port.android.view.ClazzMemberListFragment.ClazzMemberListRecyclerAdapter) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setPersonWithEnrolmentDetails(@Nullable com.ustadmobile.lib.db.entities.PersonWithClazzEnrolmentDetails PersonWithEnrolmentDetails) {
        this.mPersonWithEnrolmentDetails = PersonWithEnrolmentDetails;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.personWithEnrolmentDetails);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.ClazzMemberListPresenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }
    public void setSelectablePagedListAdapter(@Nullable com.ustadmobile.port.android.view.ClazzMemberListFragment.ClazzMemberListRecyclerAdapter SelectablePagedListAdapter) {
        this.mSelectablePagedListAdapter = SelectablePagedListAdapter;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.selectablePagedListAdapter);
        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;
        }
        long personWithEnrolmentDetailsPersonUid = 0;
        java.lang.String personWithEnrolmentDetailsFirstNames = null;
        java.lang.String personWithEnrolmentDetailsLastName = null;
        com.ustadmobile.lib.db.entities.PersonWithClazzEnrolmentDetails personWithEnrolmentDetails = mPersonWithEnrolmentDetails;
        com.ustadmobile.port.android.view.util.ForeignKeyAttachmentUriAdapter personDetailFragmentFOREIGNKEYADAPTERPERSON = null;
        int personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENTViewVISIBLEViewGONE = 0;
        com.ustadmobile.core.controller.ClazzMemberListPresenter presenter = mPresenter;
        java.lang.String personWithEnrolmentDetailsFirstNamesJavaLangStringPersonWithEnrolmentDetailsLastName = null;
        int personWithEnrolmentDetailsEnrolmentRole = 0;
        com.ustadmobile.port.android.view.ClazzMemberListFragment.ClazzMemberListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        float personWithEnrolmentDetailsAttendance = 0f;
        boolean personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENT = false;
        java.lang.String personWithEnrolmentDetailsFirstNamesJavaLangString = null;
        java.lang.String itemClazzmemberLine2TextAndroidStringXPercentAttendedPersonWithEnrolmentDetailsAttendance = null;

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



                if (personWithEnrolmentDetails != null) {
                    // read personWithEnrolmentDetails.personUid
                    personWithEnrolmentDetailsPersonUid = personWithEnrolmentDetails.getPersonUid();
                    // read personWithEnrolmentDetails.firstNames
                    personWithEnrolmentDetailsFirstNames = personWithEnrolmentDetails.getFirstNames();
                    // read personWithEnrolmentDetails.lastName
                    personWithEnrolmentDetailsLastName = personWithEnrolmentDetails.getLastName();
                    // read personWithEnrolmentDetails.enrolmentRole
                    personWithEnrolmentDetailsEnrolmentRole = personWithEnrolmentDetails.getEnrolmentRole();
                    // read personWithEnrolmentDetails.attendance
                    personWithEnrolmentDetailsAttendance = personWithEnrolmentDetails.getAttendance();
                }


                // read (personWithEnrolmentDetails.firstNames) + (" ")
                personWithEnrolmentDetailsFirstNamesJavaLangString = (personWithEnrolmentDetailsFirstNames) + (" ");
                // read personWithEnrolmentDetails.enrolmentRole == ClazzEnrolment.ROLE_STUDENT
                personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENT = (personWithEnrolmentDetailsEnrolmentRole) == (com.ustadmobile.lib.db.entities.ClazzEnrolment.ROLE_STUDENT);
                // read @android:string/x_percent_attended
                itemClazzmemberLine2TextAndroidStringXPercentAttendedPersonWithEnrolmentDetailsAttendance = itemClazzmemberLine2Text.getResources().getString(R.string.x_percent_attended, personWithEnrolmentDetailsAttendance);
            if((dirtyFlags & 0x9L) != 0) {
                if(personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENT) {
                        dirtyFlags |= 0x20L;
                }
                else {
                        dirtyFlags |= 0x10L;
                }
            }


                // read ((personWithEnrolmentDetails.firstNames) + (" ")) + (personWithEnrolmentDetails.lastName)
                personWithEnrolmentDetailsFirstNamesJavaLangStringPersonWithEnrolmentDetailsLastName = (personWithEnrolmentDetailsFirstNamesJavaLangString) + (personWithEnrolmentDetailsLastName);
                // read personWithEnrolmentDetails.enrolmentRole == ClazzEnrolment.ROLE_STUDENT ? View.VISIBLE : View.GONE
                personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENTViewVISIBLEViewGONE = ((personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENT) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        if ((dirtyFlags & 0x8L) != 0) {

                // read PersonDetailFragment.FOREIGNKEYADAPTER_PERSON
                personDetailFragmentFOREIGNKEYADAPTERPERSON = com.ustadmobile.port.android.view.PersonDetailFragment.getFOREIGNKEYADAPTER_PERSON();
        }
        if ((dirtyFlags & 0xcL) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x9L) != 0) {
            // api target 1

            this.itemClazzmemberLine2AttendanceTrafficlight.setVisibility(personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENTViewVISIBLEViewGONE);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setAlphaIfActiveEnrolment(this.itemClazzmemberLine2AttendanceTrafficlight, personWithEnrolmentDetails);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setAttendanceTint(this.itemClazzmemberLine2AttendanceTrafficlight, personWithEnrolmentDetailsAttendance);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setAlphaIfActiveEnrolment(this.itemClazzmemberLine2Text, personWithEnrolmentDetails);
            this.itemClazzmemberLine2Text.setVisibility(personWithEnrolmentDetailsEnrolmentRoleClazzEnrolmentROLESTUDENTViewVISIBLEViewGONE);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemClazzmemberLine2Text, itemClazzmemberLine2TextAndroidStringXPercentAttendedPersonWithEnrolmentDetailsAttendance);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setAlphaIfActiveEnrolment(this.itemClazzmemberNewitemicon, personWithEnrolmentDetails);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKey(this.itemClazzmemberNewitemicon, personWithEnrolmentDetailsPersonUid, (java.lang.String)null);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setAlphaIfActiveEnrolment(this.itemClazzmemberText, personWithEnrolmentDetails);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemClazzmemberText, personWithEnrolmentDetailsFirstNamesJavaLangStringPersonWithEnrolmentDetailsLastName);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setAlphaIfActiveEnrolment(this.mboundView0, personWithEnrolmentDetails);
        }
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKeyAdapter(this.itemClazzmemberNewitemicon, personDetailFragmentFOREIGNKEYADAPTERPERSON);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.imageForeignKeyPlaceholder(this.itemClazzmemberNewitemicon, androidx.appcompat.content.res.AppCompatResources.getDrawable(itemClazzmemberNewitemicon.getContext(), R.drawable.ic_account_circle_black_24dp));
        }
        if ((dirtyFlags & 0xcL) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setSelectableViewHelper(this.mboundView0, selectablePagedListAdapter, mCallback94, mCallback93);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // presenter != null
        boolean presenterJavaLangObjectNull = false;
        // presenter
        com.ustadmobile.core.controller.ClazzMemberListPresenter presenter = mPresenter;
        // personWithEnrolmentDetails
        com.ustadmobile.lib.db.entities.PersonWithClazzEnrolmentDetails personWithEnrolmentDetails = mPersonWithEnrolmentDetails;



        presenterJavaLangObjectNull = (presenter) != (null);
        if (presenterJavaLangObjectNull) {



            presenter.handleClickEntry(personWithEnrolmentDetails);
        }
    }
    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.ClazzMemberListFragment.ClazzMemberListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        // personWithEnrolmentDetails
        com.ustadmobile.lib.db.entities.PersonWithClazzEnrolmentDetails personWithEnrolmentDetails = mPersonWithEnrolmentDetails;



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




            selectablePagedListAdapter.onItemSelectedChanged(callbackArg_0, personWithEnrolmentDetails);
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): personWithEnrolmentDetails
        flag 1 (0x2L): presenter
        flag 2 (0x3L): selectablePagedListAdapter
        flag 3 (0x4L): null
        flag 4 (0x5L): personWithEnrolmentDetails.enrolmentRole == ClazzEnrolment.ROLE_STUDENT ? View.VISIBLE : View.GONE
        flag 5 (0x6L): personWithEnrolmentDetails.enrolmentRole == ClazzEnrolment.ROLE_STUDENT ? View.VISIBLE : View.GONE
    flag mapping end*/
    //end
}