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 ItemCommentNewBindingImpl extends ItemCommentNewBinding 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 = null;
    }
    // views
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback152;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemCommentNewBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 3, sIncludes, sViewsWithIds));
    }
    private ItemCommentNewBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[0]
            , (android.widget.EditText) bindings[2]
            , (de.hdodenhof.circleimageview.CircleImageView) bindings[1]
            );
        this.itemCommentNewCl.setTag(null);
        this.itemCommentNewCommentEt.setTag(null);
        this.itemCommentNewPersonIcon.setTag(null);
        setRootTag(root);
        // listeners
        mCallback152 = 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.publicComment == variableId) {
            setPublicComment((boolean) variable);
        }
        else if (BR.personUid == variableId) {
            setPersonUid((java.lang.Long) variable);
        }
        else if (BR.openSheet == variableId) {
            setOpenSheet((com.ustadmobile.port.android.view.OpenSheetListener) variable);
        }
        else if (BR.hintText == variableId) {
            setHintText((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setPublicComment(boolean PublicComment) {
        this.mPublicComment = PublicComment;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.publicComment);
        super.requestRebind();
    }
    public void setPersonUid(@Nullable java.lang.Long PersonUid) {
        this.mPersonUid = PersonUid;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.personUid);
        super.requestRebind();
    }
    public void setOpenSheet(@Nullable com.ustadmobile.port.android.view.OpenSheetListener OpenSheet) {
        this.mOpenSheet = OpenSheet;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.openSheet);
        super.requestRebind();
    }
    public void setHintText(@Nullable java.lang.String HintText) {
        this.mHintText = HintText;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.hintText);
        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 publicComment = mPublicComment;
        java.lang.Long personUid = mPersonUid;
        com.ustadmobile.port.android.view.util.ForeignKeyAttachmentUriAdapter personDetailFragmentFOREIGNKEYADAPTERPERSON = null;
        com.ustadmobile.port.android.view.OpenSheetListener openSheet = mOpenSheet;
        long androidxDatabindingViewDataBindingSafeUnboxPersonUid = 0;
        java.lang.String hintText = mHintText;

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



                // read androidx.databinding.ViewDataBinding.safeUnbox(personUid)
                androidxDatabindingViewDataBindingSafeUnboxPersonUid = androidx.databinding.ViewDataBinding.safeUnbox(personUid);
        }
        if ((dirtyFlags & 0x10L) != 0) {

                // read PersonDetailFragment.FOREIGNKEYADAPTER_PERSON
                personDetailFragmentFOREIGNKEYADAPTERPERSON = com.ustadmobile.port.android.view.PersonDetailFragment.getFOREIGNKEYADAPTER_PERSON();
        }
        if ((dirtyFlags & 0x18L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x18L) != 0) {
            // api target 1

            this.itemCommentNewCommentEt.setHint(hintText);
        }
        if ((dirtyFlags & 0x10L) != 0) {
            // api target 1

            this.itemCommentNewCommentEt.setOnClickListener(mCallback152);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKeyAdapter(this.itemCommentNewPersonIcon, personDetailFragmentFOREIGNKEYADAPTERPERSON);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.imageForeignKeyPlaceholder(this.itemCommentNewPersonIcon, androidx.appcompat.content.res.AppCompatResources.getDrawable(itemCommentNewPersonIcon.getContext(), R.drawable.ic_person_black_24dp));
        }
        if ((dirtyFlags & 0x12L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKey(this.itemCommentNewPersonIcon, androidxDatabindingViewDataBindingSafeUnboxPersonUid, (java.lang.String)null);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // openSheet != null
        boolean openSheetJavaLangObjectNull = false;
        // publicComment
        boolean publicComment = mPublicComment;
        // openSheet
        com.ustadmobile.port.android.view.OpenSheetListener openSheet = mOpenSheet;



        openSheetJavaLangObjectNull = (openSheet) != (null);
        if (openSheetJavaLangObjectNull) {



            openSheet.open(publicComment);
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): publicComment
        flag 1 (0x2L): personUid
        flag 2 (0x3L): openSheet
        flag 3 (0x4L): hintText
        flag 4 (0x5L): null
    flag mapping end*/
    //end
}