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 FragmentInviteViaLinkBindingImpl extends FragmentInviteViaLinkBinding 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.view, 6);
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    @NonNull
    private final android.widget.TextView mboundView3;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback32;
    @Nullable
    private final android.view.View.OnClickListener mCallback33;
    @Nullable
    private final android.view.View.OnClickListener mCallback31;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener mboundView3androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of link
            //         is com.toughra.ustadmobile.databinding.FragmentInviteViaLinkBindingImpl.this.setLink(callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView3);
            // localize variables for thread safety
            // link
            java.lang.String link = mLink;


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



                com.toughra.ustadmobile.databinding.FragmentInviteViaLinkBindingImpl.this.setLink(callbackArg_0);
            }
        }
    };

    public FragmentInviteViaLinkBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 7, sIncludes, sViewsWithIds));
    }
    private FragmentInviteViaLinkBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.LinearLayout) bindings[4]
            , (android.widget.TextView) bindings[1]
            , (android.widget.LinearLayout) bindings[2]
            , (android.widget.LinearLayout) bindings[5]
            , (android.view.View) bindings[6]
            );
        this.copyLinkLl.setTag(null);
        this.instructionsText.setTag(null);
        this.linkTip.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        this.mboundView3 = (android.widget.TextView) bindings[3];
        this.mboundView3.setTag(null);
        this.shareLinkLl.setTag(null);
        setRootTag(root);
        // listeners
        mCallback32 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback33 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 3);
        mCallback31 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        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.entityName == variableId) {
            setEntityName((java.lang.String) variable);
        }
        else if (BR.code == variableId) {
            setCode((java.lang.String) variable);
        }
        else if (BR.link == variableId) {
            setLink((java.lang.String) variable);
        }
        else if (BR.activityEventHandler == variableId) {
            setActivityEventHandler((com.ustadmobile.port.android.view.InvitationLinkHandler) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setEntityName(@Nullable java.lang.String EntityName) {
        this.mEntityName = EntityName;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.entityName);
        super.requestRebind();
    }
    public void setCode(@Nullable java.lang.String Code) {
        this.mCode = Code;
    }
    public void setLink(@Nullable java.lang.String Link) {
        this.mLink = Link;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.link);
        super.requestRebind();
    }
    public void setActivityEventHandler(@Nullable com.ustadmobile.port.android.view.InvitationLinkHandler ActivityEventHandler) {
        this.mActivityEventHandler = ActivityEventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.activityEventHandler);
        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 entityName = mEntityName;
        java.lang.String stringFormatInstructionsTextAndroidStringInviteLinkDescEntityName = null;
        java.lang.String link = mLink;
        com.ustadmobile.port.android.view.InvitationLinkHandler activityEventHandler = mActivityEventHandler;

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



                // read String.format(@android:string/invite_link_desc, entityName)
                stringFormatInstructionsTextAndroidStringInviteLinkDescEntityName = java.lang.String.format(instructionsText.getResources().getString(R.string.invite_link_desc), entityName);
        }
        if ((dirtyFlags & 0x14L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x10L) != 0) {
            // api target 1

            this.copyLinkLl.setOnClickListener(mCallback32);
            this.linkTip.setOnClickListener(mCallback31);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.mboundView3, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, mboundView3androidTextAttrChanged);
            this.shareLinkLl.setOnClickListener(mCallback33);
        }
        if ((dirtyFlags & 0x11L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.instructionsText, stringFormatInstructionsTextAndroidStringInviteLinkDescEntityName);
        }
        if ((dirtyFlags & 0x14L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView3, link);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        switch(sourceId) {
            case 2: {
                // localize variables for thread safety
                // link
                java.lang.String link = mLink;
                // activityEventHandler != null
                boolean activityEventHandlerJavaLangObjectNull = false;
                // activityEventHandler
                com.ustadmobile.port.android.view.InvitationLinkHandler activityEventHandler = mActivityEventHandler;



                activityEventHandlerJavaLangObjectNull = (activityEventHandler) != (null);
                if (activityEventHandlerJavaLangObjectNull) {



                    activityEventHandler.handleClickCopyLink(link);
                }
                break;
            }
            case 3: {
                // localize variables for thread safety
                // link
                java.lang.String link = mLink;
                // activityEventHandler != null
                boolean activityEventHandlerJavaLangObjectNull = false;
                // activityEventHandler
                com.ustadmobile.port.android.view.InvitationLinkHandler activityEventHandler = mActivityEventHandler;



                activityEventHandlerJavaLangObjectNull = (activityEventHandler) != (null);
                if (activityEventHandlerJavaLangObjectNull) {



                    activityEventHandler.handleClickShareLink(link);
                }
                break;
            }
            case 1: {
                // localize variables for thread safety
                // link
                java.lang.String link = mLink;
                // activityEventHandler != null
                boolean activityEventHandlerJavaLangObjectNull = false;
                // activityEventHandler
                com.ustadmobile.port.android.view.InvitationLinkHandler activityEventHandler = mActivityEventHandler;



                activityEventHandlerJavaLangObjectNull = (activityEventHandler) != (null);
                if (activityEventHandlerJavaLangObjectNull) {



                    activityEventHandler.handleClickCopyLink(link);
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): entityName
        flag 1 (0x2L): code
        flag 2 (0x3L): link
        flag 3 (0x4L): activityEventHandler
        flag 4 (0x5L): null
    flag mapping end*/
    //end
}