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 ItemCourseTerminologyEditHeaderBindingImpl extends ItemCourseTerminologyEditHeaderBinding  {

    @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.fragment_course_terminology_edit_words_label, 3);
    }
    // views
    // variables
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener fragmentCourseTerminologyEditTitleTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of courseTerminology.ctTitle
            //         is courseTerminology.setCtTitle((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(fragmentCourseTerminologyEditTitleText);
            // localize variables for thread safety
            // courseTerminology != null
            boolean courseTerminologyJavaLangObjectNull = false;
            // courseTerminology
            com.ustadmobile.lib.db.entities.CourseTerminology courseTerminology = mCourseTerminology;
            // courseTerminology.ctTitle
            java.lang.String courseTerminologyCtTitle = null;



            courseTerminologyJavaLangObjectNull = (courseTerminology) != (null);
            if (courseTerminologyJavaLangObjectNull) {




                courseTerminology.setCtTitle(((java.lang.String) (callbackArg_0)));
            }
        }
    };

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

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x4L;
        }
        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.courseTerminology == variableId) {
            setCourseTerminology((com.ustadmobile.lib.db.entities.CourseTerminology) variable);
        }
        else if (BR.titleErrorText == variableId) {
            setTitleErrorText((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setCourseTerminology(@Nullable com.ustadmobile.lib.db.entities.CourseTerminology CourseTerminology) {
        this.mCourseTerminology = CourseTerminology;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.courseTerminology);
        super.requestRebind();
    }
    public void setTitleErrorText(@Nullable java.lang.String TitleErrorText) {
        this.mTitleErrorText = TitleErrorText;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.titleErrorText);
        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 titleErrorTextJavaLangObjectNull = false;
        com.ustadmobile.lib.db.entities.CourseTerminology courseTerminology = mCourseTerminology;
        java.lang.String titleErrorText = mTitleErrorText;
        java.lang.String courseTerminologyCtTitle = null;

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



                if (courseTerminology != null) {
                    // read courseTerminology.ctTitle
                    courseTerminologyCtTitle = courseTerminology.getCtTitle();
                }
        }
        if ((dirtyFlags & 0x6L) != 0) {



                // read titleErrorText != null
                titleErrorTextJavaLangObjectNull = (titleErrorText) != (null);
        }
        // batch finished
        if ((dirtyFlags & 0x6L) != 0) {
            // api target 1

            this.fragmentCourseTerminologyEditTitle.setErrorEnabled(titleErrorTextJavaLangObjectNull);
            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.fragmentCourseTerminologyEditTitle, titleErrorText);
        }
        if ((dirtyFlags & 0x5L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fragmentCourseTerminologyEditTitleText, courseTerminologyCtTitle);
        }
        if ((dirtyFlags & 0x4L) != 0) {
            // api target 1

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