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 FragmentSiteEnterLinkBindingImpl extends FragmentSiteEnterLinkBinding 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.imageView, 6);
        sViewsWithIds.put(R.id.site_link_instructions_text, 7);
        sViewsWithIds.put(R.id.next_button_bottom_barrier, 8);
        sViewsWithIds.put(R.id.or_text, 9);
    }
    // views
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback178;
    @Nullable
    private final android.view.View.OnClickListener mCallback179;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener organisationLinkandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of siteLink
            //         is com.toughra.ustadmobile.databinding.FragmentSiteEnterLinkBindingImpl.this.setSiteLink(callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(organisationLink);
            // localize variables for thread safety
            // siteLink
            java.lang.String siteLink = mSiteLink;


            if ((com.toughra.ustadmobile.databinding.FragmentSiteEnterLinkBindingImpl.this) != (null)) {



                com.toughra.ustadmobile.databinding.FragmentSiteEnterLinkBindingImpl.this.setSiteLink(callbackArg_0);
            }
        }
    };

    public FragmentSiteEnterLinkBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 10, sIncludes, sViewsWithIds));
    }
    private FragmentSiteEnterLinkBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (com.google.android.material.button.MaterialButton) bindings[5]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            , (android.widget.ImageView) bindings[6]
            , (com.google.android.material.button.MaterialButton) bindings[4]
            , (androidx.constraintlayout.widget.Barrier) bindings[8]
            , (android.widget.TextView) bindings[9]
            , (com.google.android.material.textfield.TextInputEditText) bindings[2]
            , (com.google.android.material.progressindicator.CircularProgressIndicator) bindings[3]
            , (android.widget.TextView) bindings[7]
            , (com.google.android.material.textfield.TextInputLayout) bindings[1]
            );
        this.createNewSite.setTag(null);
        this.fragmentSiteEnterLinkScrollview.setTag(null);
        this.nextButton.setTag(null);
        this.organisationLink.setTag(null);
        this.progressBar.setTag(null);
        this.siteLinkView.setTag(null);
        setRootTag(root);
        // listeners
        mCallback178 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        mCallback179 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        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.linkError == variableId) {
            setLinkError((boolean) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.SiteEnterLinkPresenter) variable);
        }
        else if (BR.showButton == variableId) {
            setShowButton((boolean) variable);
        }
        else if (BR.siteLink == variableId) {
            setSiteLink((java.lang.String) variable);
        }
        else if (BR.showProgress == variableId) {
            setShowProgress((boolean) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLinkError(boolean LinkError) {
        this.mLinkError = LinkError;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.linkError);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.SiteEnterLinkPresenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }
    public void setShowButton(boolean ShowButton) {
        this.mShowButton = ShowButton;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.showButton);
        super.requestRebind();
    }
    public void setSiteLink(@Nullable java.lang.String SiteLink) {
        this.mSiteLink = SiteLink;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.siteLink);
        super.requestRebind();
    }
    public void setShowProgress(boolean ShowProgress) {
        this.mShowProgress = ShowProgress;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.showProgress);
        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 linkError = mLinkError;
        int showProgressViewVISIBLEViewGONE = 0;
        com.ustadmobile.core.controller.SiteEnterLinkPresenter presenter = mPresenter;
        boolean showButton = mShowButton;
        int showButtonViewVISIBLEViewGONE = 0;
        java.lang.String siteLink = mSiteLink;
        boolean showProgress = mShowProgress;

        if ((dirtyFlags & 0x21L) != 0) {
        }
        if ((dirtyFlags & 0x24L) != 0) {

            if((dirtyFlags & 0x24L) != 0) {
                if(showButton) {
                        dirtyFlags |= 0x200L;
                }
                else {
                        dirtyFlags |= 0x100L;
                }
            }


                // read showButton ? View.VISIBLE : View.GONE
                showButtonViewVISIBLEViewGONE = ((showButton) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        if ((dirtyFlags & 0x28L) != 0) {
        }
        if ((dirtyFlags & 0x30L) != 0) {

            if((dirtyFlags & 0x30L) != 0) {
                if(showProgress) {
                        dirtyFlags |= 0x80L;
                }
                else {
                        dirtyFlags |= 0x40L;
                }
            }


                // read showProgress ? View.VISIBLE : View.GONE
                showProgressViewVISIBLEViewGONE = ((showProgress) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
        }
        // batch finished
        if ((dirtyFlags & 0x20L) != 0) {
            // api target 1

            this.createNewSite.setOnClickListener(mCallback179);
            this.nextButton.setOnClickListener(mCallback178);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.organisationLink, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, organisationLinkandroidTextAttrChanged);
        }
        if ((dirtyFlags & 0x24L) != 0) {
            // api target 1

            this.nextButton.setVisibility(showButtonViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x28L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.organisationLink, siteLink);
        }
        if ((dirtyFlags & 0x30L) != 0) {
            // api target 1

            this.progressBar.setVisibility(showProgressViewVISIBLEViewGONE);
        }
        if ((dirtyFlags & 0x21L) != 0) {
            // api target 1

            this.siteLinkView.setErrorEnabled(linkError);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        switch(sourceId) {
            case 1: {
                // localize variables for thread safety
                // presenter != null
                boolean presenterJavaLangObjectNull = false;
                // presenter
                com.ustadmobile.core.controller.SiteEnterLinkPresenter presenter = mPresenter;



                presenterJavaLangObjectNull = (presenter) != (null);
                if (presenterJavaLangObjectNull) {


                    presenter.handleClickNext();
                }
                break;
            }
            case 2: {
                // localize variables for thread safety
                // presenter != null
                boolean presenterJavaLangObjectNull = false;
                // presenter
                com.ustadmobile.core.controller.SiteEnterLinkPresenter presenter = mPresenter;



                presenterJavaLangObjectNull = (presenter) != (null);
                if (presenterJavaLangObjectNull) {


                    presenter.handleClickCreateNewSite();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): linkError
        flag 1 (0x2L): presenter
        flag 2 (0x3L): showButton
        flag 3 (0x4L): siteLink
        flag 4 (0x5L): showProgress
        flag 5 (0x6L): null
        flag 6 (0x7L): showProgress ? View.VISIBLE : View.GONE
        flag 7 (0x8L): showProgress ? View.VISIBLE : View.GONE
        flag 8 (0x9L): showButton ? View.VISIBLE : View.GONE
        flag 9 (0xaL): showButton ? View.VISIBLE : View.GONE
    flag mapping end*/
    //end
}