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 FragmentLeavingReasonEditBindingImpl extends FragmentLeavingReasonEditBinding  {

    @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_leaving_reason_edit_edit_clx, 3);
    }
    // views
    // variables
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener leavingReasonEditDescriptionTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of leavingReason.leavingReasonTitle
            //         is leavingReason.setLeavingReasonTitle((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(leavingReasonEditDescriptionText);
            // localize variables for thread safety
            // leavingReason.leavingReasonTitle
            java.lang.String leavingReasonLeavingReasonTitle = null;
            // leavingReason
            com.ustadmobile.lib.db.entities.LeavingReason leavingReason = mLeavingReason;
            // leavingReason != null
            boolean leavingReasonJavaLangObjectNull = false;



            leavingReasonJavaLangObjectNull = (leavingReason) != (null);
            if (leavingReasonJavaLangObjectNull) {




                leavingReason.setLeavingReasonTitle(((java.lang.String) (callbackArg_0)));
            }
        }
    };

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

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x20L;
        }
        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.loading == variableId) {
            setLoading((boolean) variable);
        }
        else if (BR.reasonTitleError == variableId) {
            setReasonTitleError((java.lang.String) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.leavingReason == variableId) {
            setLeavingReason((com.ustadmobile.lib.db.entities.LeavingReason) variable);
        }
        else if (BR.activityEventHandler == variableId) {
            setActivityEventHandler((com.ustadmobile.port.android.view.LeavingReasonEditFragmentEventHandler) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLoading(boolean Loading) {
        this.mLoading = Loading;
    }
    public void setReasonTitleError(@Nullable java.lang.String ReasonTitleError) {
        this.mReasonTitleError = ReasonTitleError;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.reasonTitleError);
        super.requestRebind();
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
    }
    public void setLeavingReason(@Nullable com.ustadmobile.lib.db.entities.LeavingReason LeavingReason) {
        this.mLeavingReason = LeavingReason;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.leavingReason);
        super.requestRebind();
    }
    public void setActivityEventHandler(@Nullable com.ustadmobile.port.android.view.LeavingReasonEditFragmentEventHandler ActivityEventHandler) {
        this.mActivityEventHandler = ActivityEventHandler;
    }

    @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 leavingReasonLeavingReasonTitle = null;
        java.lang.String reasonTitleError = mReasonTitleError;
        com.ustadmobile.lib.db.entities.LeavingReason leavingReason = mLeavingReason;

        if ((dirtyFlags & 0x22L) != 0) {
        }
        if ((dirtyFlags & 0x28L) != 0) {



                if (leavingReason != null) {
                    // read leavingReason.leavingReasonTitle
                    leavingReasonLeavingReasonTitle = leavingReason.getLeavingReasonTitle();
                }
        }
        // batch finished
        if ((dirtyFlags & 0x28L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.leavingReasonEditDescriptionText, leavingReasonLeavingReasonTitle);
        }
        if ((dirtyFlags & 0x20L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.leavingReasonEditDescriptionText, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, leavingReasonEditDescriptionTextandroidTextAttrChanged);
        }
        if ((dirtyFlags & 0x22L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.leavingReasonEditDescriptionTextinput, reasonTitleError);
        }
    }
    // Listener Stub Implementations
    // callback impls
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): loading
        flag 1 (0x2L): reasonTitleError
        flag 2 (0x3L): fieldsEnabled
        flag 3 (0x4L): leavingReason
        flag 4 (0x5L): activityEventHandler
        flag 5 (0x6L): null
    flag mapping end*/
    //end
}