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 ItemClazzLogAttendanceRecordEditBindingImpl extends ItemClazzLogAttendanceRecordEditBinding  {

    @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.present_button, 4);
        sViewsWithIds.put(R.id.absent_button, 5);
        sViewsWithIds.put(R.id.late_button, 6);
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    @NonNull
    private final com.google.android.material.button.MaterialButtonToggleGroup mboundView3;
    // variables
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener mboundView3messageGroupSelectedIdAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of clazzLogAttendanceRecordWithPerson.attendanceStatus
            //         is clazzLogAttendanceRecordWithPerson.setAttendanceStatus((int) callbackArg_0)
            int callbackArg_0 = com.ustadmobile.port.android.view.binding.MaterialButtonToggleGroupBindingsKt.getSelectedOptionId(mboundView3);
            // localize variables for thread safety
            // clazzLogAttendanceRecordWithPerson.attendanceStatus
            int clazzLogAttendanceRecordWithPersonAttendanceStatus = 0;
            // clazzLogAttendanceRecordWithPerson
            com.ustadmobile.lib.db.entities.ClazzLogAttendanceRecordWithPerson clazzLogAttendanceRecordWithPerson = mClazzLogAttendanceRecordWithPerson;
            // clazzLogAttendanceRecordWithPerson != null
            boolean clazzLogAttendanceRecordWithPersonJavaLangObjectNull = false;



            clazzLogAttendanceRecordWithPersonJavaLangObjectNull = (clazzLogAttendanceRecordWithPerson) != (null);
            if (clazzLogAttendanceRecordWithPersonJavaLangObjectNull) {




                clazzLogAttendanceRecordWithPerson.setAttendanceStatus(((int) (callbackArg_0)));
            }
        }
    };

    public ItemClazzLogAttendanceRecordEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 7, sIncludes, sViewsWithIds));
    }
    private ItemClazzLogAttendanceRecordEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (com.google.android.material.button.MaterialButton) bindings[5]
            , (android.widget.TextView) bindings[2]
            , (de.hdodenhof.circleimageview.CircleImageView) bindings[1]
            , (com.google.android.material.button.MaterialButton) bindings[6]
            , (com.google.android.material.button.MaterialButton) bindings[4]
            );
        this.itemClazzlogDetailStudentName.setTag(null);
        this.itemClazzlogDetailStudentPersonIcon.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        this.mboundView3 = (com.google.android.material.button.MaterialButtonToggleGroup) bindings[3];
        this.mboundView3.setTag(null);
        setRootTag(root);
        // listeners
        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.attendanceRecordStatusMap == variableId) {
            setAttendanceRecordStatusMap((java.util.Map<java.lang.Integer,java.lang.Integer>) variable);
        }
        else if (BR.clazzLogAttendanceRecordWithPerson == variableId) {
            setClazzLogAttendanceRecordWithPerson((com.ustadmobile.lib.db.entities.ClazzLogAttendanceRecordWithPerson) variable);
        }
        else if (BR.mPresenter == variableId) {
            setMPresenter((com.ustadmobile.core.controller.ClazzLogEditAttendancePresenter) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setAttendanceRecordStatusMap(@Nullable java.util.Map<java.lang.Integer,java.lang.Integer> AttendanceRecordStatusMap) {
        this.mAttendanceRecordStatusMap = AttendanceRecordStatusMap;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.attendanceRecordStatusMap);
        super.requestRebind();
    }
    public void setClazzLogAttendanceRecordWithPerson(@Nullable com.ustadmobile.lib.db.entities.ClazzLogAttendanceRecordWithPerson ClazzLogAttendanceRecordWithPerson) {
        this.mClazzLogAttendanceRecordWithPerson = ClazzLogAttendanceRecordWithPerson;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.clazzLogAttendanceRecordWithPerson);
        super.requestRebind();
    }
    public void setMPresenter(@Nullable com.ustadmobile.core.controller.ClazzLogEditAttendancePresenter MPresenter) {
        this.mMPresenter = MPresenter;
    }

    @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 personExtKtPersonFullNameClazzLogAttendanceRecordWithPersonPerson = null;
        com.ustadmobile.lib.db.entities.Person clazzLogAttendanceRecordWithPersonPerson = null;
        java.util.Map<java.lang.Integer,java.lang.Integer> attendanceRecordStatusMap = mAttendanceRecordStatusMap;
        int clazzLogAttendanceRecordWithPersonAttendanceStatus = 0;
        long clazzLogAttendanceRecordWithPersonPersonPersonUid = 0;
        com.ustadmobile.lib.db.entities.ClazzLogAttendanceRecordWithPerson clazzLogAttendanceRecordWithPerson = mClazzLogAttendanceRecordWithPerson;

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


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

                    if (clazzLogAttendanceRecordWithPerson != null) {
                        // read clazzLogAttendanceRecordWithPerson.person
                        clazzLogAttendanceRecordWithPersonPerson = clazzLogAttendanceRecordWithPerson.getPerson();
                    }


                    // read PersonExtKt.personFullName(clazzLogAttendanceRecordWithPerson.person)
                    personExtKtPersonFullNameClazzLogAttendanceRecordWithPersonPerson = com.ustadmobile.core.util.ext.PersonExtKt.personFullName(clazzLogAttendanceRecordWithPersonPerson);
                    if (clazzLogAttendanceRecordWithPersonPerson != null) {
                        // read clazzLogAttendanceRecordWithPerson.person.personUid
                        clazzLogAttendanceRecordWithPersonPersonPersonUid = clazzLogAttendanceRecordWithPersonPerson.getPersonUid();
                    }
            }

                if (clazzLogAttendanceRecordWithPerson != null) {
                    // read clazzLogAttendanceRecordWithPerson.attendanceStatus
                    clazzLogAttendanceRecordWithPersonAttendanceStatus = clazzLogAttendanceRecordWithPerson.getAttendanceStatus();
                }
        }
        // batch finished
        if ((dirtyFlags & 0xaL) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemClazzlogDetailStudentName, personExtKtPersonFullNameClazzLogAttendanceRecordWithPersonPerson);
            com.ustadmobile.port.android.view.binding.PersonPictureBindingAdapterKt.setPersonPicture(this.itemClazzlogDetailStudentPersonIcon, clazzLogAttendanceRecordWithPersonPersonPersonUid, (java.lang.Boolean)null);
        }
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.MaterialButtonToggleGroupBindingsKt.setSelectedOptionChangedListener(this.mboundView3, mboundView3messageGroupSelectedIdAttrChanged);
        }
        if ((dirtyFlags & 0xbL) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.MaterialButtonToggleGroupBindingsKt.setMessageOptions(this.mboundView3, attendanceRecordStatusMap, clazzLogAttendanceRecordWithPersonAttendanceStatus);
        }
    }
    // Listener Stub Implementations
    // callback impls
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): attendanceRecordStatusMap
        flag 1 (0x2L): clazzLogAttendanceRecordWithPerson
        flag 2 (0x3L): mPresenter
        flag 3 (0x4L): null
    flag mapping end*/
    //end
}