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 FragmentSiteTermsEditBindingImpl extends FragmentSiteTermsEditBinding implements com.toughra.ustadmobile.generated.callback.OnClickListener.Listener {

    @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.editor, 3);
        sViewsWithIds.put(R.id.formatting_toolbar, 4);
    }
    // views
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView2;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback4;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public FragmentSiteTermsEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 5, sIncludes, sViewsWithIds));
    }
    private FragmentSiteTermsEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (org.wordpress.aztec.AztecText) bindings[3]
            , (org.wordpress.aztec.toolbar.AztecToolbar) bindings[4]
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[0]
            , (com.google.android.material.textfield.TextInputLayout) bindings[1]
            );
        this.fragmentWorkspaceTermsEditEditClx.setTag(null);
        this.languageselectionTil.setTag(null);
        this.mboundView2 = (com.google.android.material.textfield.TextInputEditText) bindings[2];
        this.mboundView2.setTag(null);
        setRootTag(root);
        // listeners
        mCallback4 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        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.languageError == variableId) {
            setLanguageError((java.lang.String) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.siteTerms == variableId) {
            setSiteTerms((com.ustadmobile.lib.db.entities.SiteTermsWithLanguage) variable);
        }
        else if (BR.mPresenter == variableId) {
            setMPresenter((com.ustadmobile.core.controller.SiteTermsEditPresenter) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLoading(boolean Loading) {
        this.mLoading = Loading;
    }
    public void setLanguageError(@Nullable java.lang.String LanguageError) {
        this.mLanguageError = LanguageError;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.languageError);
        super.requestRebind();
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
    }
    public void setSiteTerms(@Nullable com.ustadmobile.lib.db.entities.SiteTermsWithLanguage SiteTerms) {
        this.mSiteTerms = SiteTerms;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.siteTerms);
        super.requestRebind();
    }
    public void setMPresenter(@Nullable com.ustadmobile.core.controller.SiteTermsEditPresenter MPresenter) {
        this.mMPresenter = MPresenter;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.mPresenter);
        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 languageError = mLanguageError;
        com.ustadmobile.lib.db.entities.Language siteTermsStLanguage = null;
        java.lang.String siteTermsStLanguageName = null;
        com.ustadmobile.lib.db.entities.SiteTermsWithLanguage siteTerms = mSiteTerms;
        com.ustadmobile.core.controller.SiteTermsEditPresenter mPresenter = mMPresenter;

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



                if (siteTerms != null) {
                    // read siteTerms.stLanguage
                    siteTermsStLanguage = siteTerms.getStLanguage();
                }


                if (siteTermsStLanguage != null) {
                    // read siteTerms.stLanguage.name
                    siteTermsStLanguageName = siteTermsStLanguage.getName();
                }
        }
        // batch finished
        if ((dirtyFlags & 0x22L) != 0) {
            // api target 1

            this.languageselectionTil.setError(languageError);
        }
        if ((dirtyFlags & 0x20L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.EditTextBindingsKt.setRunOnClickWhenFocused(this.mboundView2, true);
            this.mboundView2.setOnClickListener(mCallback4);
            // api target 3
            if(getBuildSdkInt() >= 3) {

                this.mboundView2.setInputType(android.text.InputType.TYPE_NULL);
            }
        }
        if ((dirtyFlags & 0x28L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView2, siteTermsStLanguageName);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // mPresenter != null
        boolean mPresenterJavaLangObjectNull = false;
        // mPresenter
        com.ustadmobile.core.controller.SiteTermsEditPresenter mPresenter = mMPresenter;



        mPresenterJavaLangObjectNull = (mPresenter) != (null);
        if (mPresenterJavaLangObjectNull) {


            mPresenter.handleClickLanguage();
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): loading
        flag 1 (0x2L): languageError
        flag 2 (0x3L): fieldsEnabled
        flag 3 (0x4L): siteTerms
        flag 4 (0x5L): mPresenter
        flag 5 (0x6L): null
    flag mapping end*/
    //end
}