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 ItemCourseTerminologyEntryBindingImpl extends ItemCourseTerminologyEntryBinding  {

    @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
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener fragmentCourseTerminologyEditTeacherTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of entry.term
            //         is entry.setTerm((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(fragmentCourseTerminologyEditTeacherText);
            // localize variables for thread safety
            // entry.term
            java.lang.String entryTerm = null;
            // entry
            com.ustadmobile.lib.db.entities.TerminologyEntry entry = mEntry;
            // entry != null
            boolean entryJavaLangObjectNull = false;



            entryJavaLangObjectNull = (entry) != (null);
            if (entryJavaLangObjectNull) {




                entry.setTerm(((java.lang.String) (callbackArg_0)));
            }
        }
    };

    public ItemCourseTerminologyEntryBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 3, sIncludes, sViewsWithIds));
    }
    private ItemCourseTerminologyEntryBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (com.google.android.material.textfield.TextInputLayout) bindings[1]
            , (com.google.android.material.textfield.TextInputEditText) bindings[2]
            );
        this.fragmentCourseTerminologyEditTeacher.setTag(null);
        this.fragmentCourseTerminologyEditTeacherText.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x2L;
        }
        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.entry == variableId) {
            setEntry((com.ustadmobile.lib.db.entities.TerminologyEntry) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setEntry(@Nullable com.ustadmobile.lib.db.entities.TerminologyEntry Entry) {
        this.mEntry = Entry;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.entry);
        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;
        }
        java.lang.String entryErrorMessage = null;
        java.lang.String entryTerm = null;
        int entryMessageId = 0;
        com.ustadmobile.lib.db.entities.TerminologyEntry entry = mEntry;
        boolean entryErrorMessageJavaLangObjectNull = false;

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



                if (entry != null) {
                    // read entry.errorMessage
                    entryErrorMessage = entry.getErrorMessage();
                    // read entry.term
                    entryTerm = entry.getTerm();
                    // read entry.messageId
                    entryMessageId = entry.getMessageId();
                }


                // read entry.errorMessage != null
                entryErrorMessageJavaLangObjectNull = (entryErrorMessage) != (null);
        }
        // batch finished
        if ((dirtyFlags & 0x3L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setHintMessageId(this.fragmentCourseTerminologyEditTeacher, entryMessageId);
            this.fragmentCourseTerminologyEditTeacher.setErrorEnabled(entryErrorMessageJavaLangObjectNull);
            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.fragmentCourseTerminologyEditTeacher, entryErrorMessage);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fragmentCourseTerminologyEditTeacherText, entryTerm);
        }
        if ((dirtyFlags & 0x2L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.fragmentCourseTerminologyEditTeacherText, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, fragmentCourseTerminologyEditTeacherTextandroidTextAttrChanged);
        }
    }
    // Listener Stub Implementations
    // callback impls
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): entry
        flag 1 (0x2L): null
    flag mapping end*/
    //end
}