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 ItemDiscussionBoardCourseBlockBindingImpl extends ItemDiscussionBoardCourseBlockBinding 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
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback117;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemDiscussionBoardCourseBlockBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 4, sIncludes, sViewsWithIds));
    }
    private ItemDiscussionBoardCourseBlockBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.TextView) bindings[2]
            , (android.widget.TextView) bindings[3]
            , (com.google.android.material.imageview.ShapeableImageView) bindings[1]
            );
        this.itemBlockLine1Text.setTag(null);
        this.itemBlockLine2Desc.setTag(null);
        this.itemCourseBlockIcon.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        mCallback117 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x8L;
        }
        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.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.ClazzDetailOverviewPresenter) variable);
        }
        else if (BR.discussion == variableId) {
            setDiscussion((com.ustadmobile.lib.db.entities.CourseDiscussion) variable);
        }
        else if (BR.block == variableId) {
            setBlock((com.ustadmobile.lib.db.entities.CourseBlockWithCompleteEntity) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setPresenter(@Nullable com.ustadmobile.core.controller.ClazzDetailOverviewPresenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }
    public void setDiscussion(@Nullable com.ustadmobile.lib.db.entities.CourseDiscussion Discussion) {
        this.mDiscussion = Discussion;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.discussion);
        super.requestRebind();
    }
    public void setBlock(@Nullable com.ustadmobile.lib.db.entities.CourseBlockWithCompleteEntity Block) {
        this.mBlock = Block;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.block);
        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;
        }
        int blockCbIndentLevel = 0;
        boolean blockCbDescriptionJavaLangObjectNull = false;
        java.lang.String blockCbTitle = null;
        java.lang.String blockCbDescription = null;
        com.ustadmobile.core.controller.ClazzDetailOverviewPresenter presenter = mPresenter;
        com.ustadmobile.lib.db.entities.CourseDiscussion discussion = mDiscussion;
        com.ustadmobile.lib.db.entities.CourseBlockWithCompleteEntity block = mBlock;
        int blockCbDescriptionJavaLangObjectNullViewGONEViewVISIBLE = 0;
        int blockCbType = 0;

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



                if (block != null) {
                    // read block.cbIndentLevel
                    blockCbIndentLevel = block.getCbIndentLevel();
                    // read block.cbTitle
                    blockCbTitle = block.getCbTitle();
                    // read block.cbDescription
                    blockCbDescription = block.getCbDescription();
                    // read block.cbType
                    blockCbType = block.getCbType();
                }


                // read block.cbDescription == null
                blockCbDescriptionJavaLangObjectNull = (blockCbDescription) == (null);
            if((dirtyFlags & 0xcL) != 0) {
                if(blockCbDescriptionJavaLangObjectNull) {
                        dirtyFlags |= 0x20L;
                }
                else {
                        dirtyFlags |= 0x10L;
                }
            }


                // read block.cbDescription == null ? View.GONE : View.VISIBLE
                blockCbDescriptionJavaLangObjectNullViewGONEViewVISIBLE = ((blockCbDescriptionJavaLangObjectNull) ? (android.view.View.GONE) : (android.view.View.VISIBLE));
        }
        // batch finished
        if ((dirtyFlags & 0xcL) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemBlockLine1Text, blockCbTitle);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemBlockLine2Desc, blockCbDescription);
            this.itemBlockLine2Desc.setVisibility(blockCbDescriptionJavaLangObjectNullViewGONEViewVISIBLE);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupKey(this.itemCourseBlockIcon, blockCbType);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setIndentLevel(this.mboundView0, blockCbIndentLevel);
        }
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupMap(this.itemCourseBlockIcon, com.ustadmobile.port.android.view.ClazzEditFragment.BLOCK_ICON_MAP, (java.lang.Integer)null);
            this.mboundView0.setOnClickListener(mCallback117);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // presenter != null
        boolean presenterJavaLangObjectNull = false;
        // presenter
        com.ustadmobile.core.controller.ClazzDetailOverviewPresenter presenter = mPresenter;
        // discussion
        com.ustadmobile.lib.db.entities.CourseDiscussion discussion = mDiscussion;



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



            presenter.handleClickCourseDiscussion(discussion);
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): presenter
        flag 1 (0x2L): discussion
        flag 2 (0x3L): block
        flag 3 (0x4L): null
        flag 4 (0x5L): block.cbDescription == null ? View.GONE : View.VISIBLE
        flag 5 (0x6L): block.cbDescription == null ? View.GONE : View.VISIBLE
    flag mapping end*/
    //end
}