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 FragmentLanguageEditBindingImpl extends FragmentLanguageEditBinding  {

    @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_language_edit_edit_clx, 5);
        sViewsWithIds.put(R.id.lang_edit_twocode_textinput, 6);
        sViewsWithIds.put(R.id.lang_edit_threecode_textinput, 7);
    }
    // views
    // variables
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener langEditNameTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of language.name
            //         is language.setName((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(langEditNameText);
            // localize variables for thread safety
            // language.name
            java.lang.String languageName = null;
            // language
            com.ustadmobile.lib.db.entities.Language language = mLanguage;
            // language != null
            boolean languageJavaLangObjectNull = false;



            languageJavaLangObjectNull = (language) != (null);
            if (languageJavaLangObjectNull) {




                language.setName(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener langEditThreecodeTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of language.iso_639_2_standard
            //         is language.setIso_639_2_standard((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(langEditThreecodeText);
            // localize variables for thread safety
            // language.iso_639_2_standard
            java.lang.String languageIso6392Standard = null;
            // language
            com.ustadmobile.lib.db.entities.Language language = mLanguage;
            // language != null
            boolean languageJavaLangObjectNull = false;



            languageJavaLangObjectNull = (language) != (null);
            if (languageJavaLangObjectNull) {




                language.setIso_639_2_standard(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener langEditTwocodeTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of language.iso_639_1_standard
            //         is language.setIso_639_1_standard((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(langEditTwocodeText);
            // localize variables for thread safety
            // language
            com.ustadmobile.lib.db.entities.Language language = mLanguage;
            // language.iso_639_1_standard
            java.lang.String languageIso6391Standard = null;
            // language != null
            boolean languageJavaLangObjectNull = false;



            languageJavaLangObjectNull = (language) != (null);
            if (languageJavaLangObjectNull) {




                language.setIso_639_1_standard(((java.lang.String) (callbackArg_0)));
            }
        }
    };

    public FragmentLanguageEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 8, sIncludes, sViewsWithIds));
    }
    private FragmentLanguageEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[5]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            , (com.google.android.material.textfield.TextInputEditText) bindings[2]
            , (com.google.android.material.textfield.TextInputLayout) bindings[1]
            , (com.google.android.material.textfield.TextInputEditText) bindings[4]
            , (com.google.android.material.textfield.TextInputLayout) bindings[7]
            , (com.google.android.material.textfield.TextInputEditText) bindings[3]
            , (com.google.android.material.textfield.TextInputLayout) bindings[6]
            );
        this.fragmentLanguageEditEditScroll.setTag(null);
        this.langEditNameText.setTag(null);
        this.langEditNameTextinput.setTag(null);
        this.langEditThreecodeText.setTag(null);
        this.langEditTwocodeText.setTag(null);
        setRootTag(root);
        // listeners
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x10L;
        }
        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.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.language == variableId) {
            setLanguage((com.ustadmobile.lib.db.entities.Language) variable);
        }
        else if (BR.langNameError == variableId) {
            setLangNameError((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLoading(boolean Loading) {
        this.mLoading = Loading;
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
    }
    public void setLanguage(@Nullable com.ustadmobile.lib.db.entities.Language Language) {
        this.mLanguage = Language;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.language);
        super.requestRebind();
    }
    public void setLangNameError(@Nullable java.lang.String LangNameError) {
        this.mLangNameError = LangNameError;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.langNameError);
        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 languageIso6392Standard = null;
        java.lang.String languageName = null;
        com.ustadmobile.lib.db.entities.Language language = mLanguage;
        java.lang.String languageIso6391Standard = null;
        java.lang.String langNameError = mLangNameError;

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



                if (language != null) {
                    // read language.iso_639_2_standard
                    languageIso6392Standard = language.getIso_639_2_standard();
                    // read language.name
                    languageName = language.getName();
                    // read language.iso_639_1_standard
                    languageIso6391Standard = language.getIso_639_1_standard();
                }
        }
        if ((dirtyFlags & 0x18L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x14L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.langEditNameText, languageName);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.langEditThreecodeText, languageIso6392Standard);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.langEditTwocodeText, languageIso6391Standard);
        }
        if ((dirtyFlags & 0x10L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.langEditNameText, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, langEditNameTextandroidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.langEditThreecodeText, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, langEditThreecodeTextandroidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.langEditTwocodeText, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, langEditTwocodeTextandroidTextAttrChanged);
        }
        if ((dirtyFlags & 0x18L) != 0) {
            // api target 1

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