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 FragmentCourseDiscussionCourseBlockEditBindingImpl extends FragmentCourseDiscussionCourseBlockEditBinding 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 = new androidx.databinding.ViewDataBinding.IncludedLayouts(13);
        sIncludes.setIncludes(1, 
            new String[] {"item_createnew"},
            new int[] {8},
            new int[] {com.toughra.ustadmobile.R.layout.item_createnew});
        sViewsWithIds = new android.util.SparseIntArray();
        sViewsWithIds.put(R.id.fragment_course_discussion_course_block_edit_desc_til, 9);
        sViewsWithIds.put(R.id.fragment_course_discussion_course_block_edit_datetime_til, 10);
        sViewsWithIds.put(R.id.fragment_course_discussion_edit_topics_rv, 11);
        sViewsWithIds.put(R.id.fragment_course_discussion_course_block_edit_topic_list_rv, 12);
    }
    // views
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback11;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener fragmentCourseDiscussionCourseBlockEditDateTietdateTimeInMillisAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of startDate
            //         is com.toughra.ustadmobile.databinding.FragmentCourseDiscussionCourseBlockEditBindingImpl.this.setStartDate(callbackArg_0)
            long callbackArg_0 = com.ustadmobile.port.android.view.binding.DatePickerBindingAdapter2Kt.getDateTimeInMillis(fragmentCourseDiscussionCourseBlockEditDateTiet);
            // localize variables for thread safety
            // startDate
            long startDate = mStartDate;


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



                com.toughra.ustadmobile.databinding.FragmentCourseDiscussionCourseBlockEditBindingImpl.this.setStartDate(callbackArg_0);
            }
        }
    };
    private androidx.databinding.InverseBindingListener fragmentCourseDiscussionCourseBlockEditDescTietandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of block.courseDiscussion.courseDiscussionDesc
            //         is block.courseDiscussion.setCourseDiscussionDesc((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(fragmentCourseDiscussionCourseBlockEditDescTiet);
            // localize variables for thread safety
            // block.courseDiscussion
            com.ustadmobile.lib.db.entities.CourseDiscussion blockCourseDiscussion = null;
            // block
            com.ustadmobile.lib.db.entities.CourseBlockWithEntity block = mBlock;
            // block.courseDiscussion.courseDiscussionDesc
            java.lang.String blockCourseDiscussionCourseDiscussionDesc = null;
            // block != null
            boolean blockJavaLangObjectNull = false;
            // block.courseDiscussion != null
            boolean blockCourseDiscussionJavaLangObjectNull = false;



            blockJavaLangObjectNull = (block) != (null);
            if (blockJavaLangObjectNull) {


                blockCourseDiscussion = block.getCourseDiscussion();

                blockCourseDiscussionJavaLangObjectNull = (blockCourseDiscussion) != (null);
                if (blockCourseDiscussionJavaLangObjectNull) {




                    blockCourseDiscussion.setCourseDiscussionDesc(((java.lang.String) (callbackArg_0)));
                }
            }
        }
    };
    private androidx.databinding.InverseBindingListener fragmentCourseDiscussionCourseBlockEditTimeTiettimeValueAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of startTime
            //         is com.toughra.ustadmobile.databinding.FragmentCourseDiscussionCourseBlockEditBindingImpl.this.setStartTime(callbackArg_0)
            long callbackArg_0 = com.ustadmobile.port.android.view.binding.TimePickerBindingAdapterKt.getTimeValue(fragmentCourseDiscussionCourseBlockEditTimeTiet);
            // localize variables for thread safety
            // startTime
            long startTime = mStartTime;


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



                com.toughra.ustadmobile.databinding.FragmentCourseDiscussionCourseBlockEditBindingImpl.this.setStartTime(callbackArg_0);
            }
        }
    };
    private androidx.databinding.InverseBindingListener fragmentCourseDiscussionCourseBlockEditTitleTietandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of block.courseDiscussion.courseDiscussionTitle
            //         is block.courseDiscussion.setCourseDiscussionTitle((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(fragmentCourseDiscussionCourseBlockEditTitleTiet);
            // localize variables for thread safety
            // block.courseDiscussion
            com.ustadmobile.lib.db.entities.CourseDiscussion blockCourseDiscussion = null;
            // block
            com.ustadmobile.lib.db.entities.CourseBlockWithEntity block = mBlock;
            // block.courseDiscussion.courseDiscussionTitle
            java.lang.String blockCourseDiscussionCourseDiscussionTitle = null;
            // block != null
            boolean blockJavaLangObjectNull = false;
            // block.courseDiscussion != null
            boolean blockCourseDiscussionJavaLangObjectNull = false;



            blockJavaLangObjectNull = (block) != (null);
            if (blockJavaLangObjectNull) {


                blockCourseDiscussion = block.getCourseDiscussion();

                blockCourseDiscussionJavaLangObjectNull = (blockCourseDiscussion) != (null);
                if (blockCourseDiscussionJavaLangObjectNull) {




                    blockCourseDiscussion.setCourseDiscussionTitle(((java.lang.String) (callbackArg_0)));
                }
            }
        }
    };

    public FragmentCourseDiscussionCourseBlockEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 13, sIncludes, sViewsWithIds));
    }
    private FragmentCourseDiscussionCourseBlockEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 1
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[1]
            , (com.google.android.material.textfield.TextInputEditText) bindings[6]
            , (com.google.android.material.textfield.TextInputLayout) bindings[5]
            , (com.google.android.material.textfield.TextInputLayout) bindings[10]
            , (com.google.android.material.textfield.TextInputEditText) bindings[4]
            , (com.google.android.material.textfield.TextInputLayout) bindings[9]
            , (com.google.android.material.textfield.TextInputEditText) bindings[7]
            , (com.google.android.material.textfield.TextInputEditText) bindings[3]
            , (com.google.android.material.textfield.TextInputLayout) bindings[2]
            , (com.ernestoyaquello.dragdropswiperecyclerview.DragDropSwipeRecyclerView) bindings[12]
            , (com.toughra.ustadmobile.databinding.ItemCreatenewBinding) bindings[8]
            , (androidx.recyclerview.widget.RecyclerView) bindings[11]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            );
        this.fragmentCourseDiscussionCourseBlockEditCl.setTag(null);
        this.fragmentCourseDiscussionCourseBlockEditDateTiet.setTag(null);
        this.fragmentCourseDiscussionCourseBlockEditDateTil.setTag(null);
        this.fragmentCourseDiscussionCourseBlockEditDescTiet.setTag(null);
        this.fragmentCourseDiscussionCourseBlockEditTimeTiet.setTag(null);
        this.fragmentCourseDiscussionCourseBlockEditTitleTiet.setTag(null);
        this.fragmentCourseDiscussionCourseBlockEditTitleTil.setTag(null);
        setContainedBinding(this.fragmentCourseDiscussionEditAddNewTopicButton);
        this.fragmentLeavingReasonEditEditScroll.setTag(null);
        setRootTag(root);
        // listeners
        mCallback11 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x200L;
        }
        fragmentCourseDiscussionEditAddNewTopicButton.invalidateAll();
        requestRebind();
    }

    @Override
    public boolean hasPendingBindings() {
        synchronized(this) {
            if (mDirtyFlags != 0) {
                return true;
            }
        }
        if (fragmentCourseDiscussionEditAddNewTopicButton.hasPendingBindings()) {
            return true;
        }
        return false;
    }

    @Override
    public boolean setVariable(int variableId, @Nullable Object variable)  {
        boolean variableSet = true;
        if (BR.startDate == variableId) {
            setStartDate((long) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.CourseDiscussionEditPresenter) variable);
        }
        else if (BR.block == variableId) {
            setBlock((com.ustadmobile.lib.db.entities.CourseBlockWithEntity) variable);
        }
        else if (BR.scheduleOneToManyListener == variableId) {
            setScheduleOneToManyListener((com.ustadmobile.core.util.OneToManyJoinEditListener<com.ustadmobile.lib.db.entities.DiscussionTopic>) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.timeZone == variableId) {
            setTimeZone((java.lang.String) variable);
        }
        else if (BR.blockTitleError == variableId) {
            setBlockTitleError((java.lang.String) variable);
        }
        else if (BR.startTime == variableId) {
            setStartTime((long) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setStartDate(long StartDate) {
        this.mStartDate = StartDate;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.startDate);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.CourseDiscussionEditPresenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }
    public void setBlock(@Nullable com.ustadmobile.lib.db.entities.CourseBlockWithEntity Block) {
        this.mBlock = Block;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.block);
        super.requestRebind();
    }
    public void setScheduleOneToManyListener(@Nullable com.ustadmobile.core.util.OneToManyJoinEditListener<com.ustadmobile.lib.db.entities.DiscussionTopic> ScheduleOneToManyListener) {
        this.mScheduleOneToManyListener = ScheduleOneToManyListener;
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
    }
    public void setTimeZone(@Nullable java.lang.String TimeZone) {
        this.mTimeZone = TimeZone;
        synchronized(this) {
            mDirtyFlags |= 0x40L;
        }
        notifyPropertyChanged(BR.timeZone);
        super.requestRebind();
    }
    public void setBlockTitleError(@Nullable java.lang.String BlockTitleError) {
        this.mBlockTitleError = BlockTitleError;
        synchronized(this) {
            mDirtyFlags |= 0x80L;
        }
        notifyPropertyChanged(BR.blockTitleError);
        super.requestRebind();
    }
    public void setStartTime(long StartTime) {
        this.mStartTime = StartTime;
        synchronized(this) {
            mDirtyFlags |= 0x100L;
        }
        notifyPropertyChanged(BR.startTime);
        super.requestRebind();
    }

    @Override
    public void setLifecycleOwner(@Nullable androidx.lifecycle.LifecycleOwner lifecycleOwner) {
        super.setLifecycleOwner(lifecycleOwner);
        fragmentCourseDiscussionEditAddNewTopicButton.setLifecycleOwner(lifecycleOwner);
    }

    @Override
    protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
        switch (localFieldId) {
            case 0 :
                return onChangeFragmentCourseDiscussionEditAddNewTopicButton((com.toughra.ustadmobile.databinding.ItemCreatenewBinding) object, fieldId);
        }
        return false;
    }
    private boolean onChangeFragmentCourseDiscussionEditAddNewTopicButton(com.toughra.ustadmobile.databinding.ItemCreatenewBinding FragmentCourseDiscussionEditAddNewTopicButton, int fieldId) {
        if (fieldId == BR._all) {
            synchronized(this) {
                    mDirtyFlags |= 0x1L;
            }
            return true;
        }
        return false;
    }

    @Override
    protected void executeBindings() {
        long dirtyFlags = 0;
        synchronized(this) {
            dirtyFlags = mDirtyFlags;
            mDirtyFlags = 0;
        }
        long startDate = mStartDate;
        com.ustadmobile.core.controller.CourseDiscussionEditPresenter presenter = mPresenter;
        com.ustadmobile.lib.db.entities.CourseDiscussion blockCourseDiscussion = null;
        com.ustadmobile.lib.db.entities.CourseBlockWithEntity block = mBlock;
        java.lang.String blockCourseDiscussionCourseDiscussionTitle = null;
        java.lang.String blockCourseDiscussionCourseDiscussionDesc = null;
        java.lang.String timeZone = mTimeZone;
        java.lang.String blockTitleError = mBlockTitleError;
        long startTime = mStartTime;

        if ((dirtyFlags & 0x242L) != 0) {
        }
        if ((dirtyFlags & 0x208L) != 0) {



                if (block != null) {
                    // read block.courseDiscussion
                    blockCourseDiscussion = block.getCourseDiscussion();
                }


                if (blockCourseDiscussion != null) {
                    // read block.courseDiscussion.courseDiscussionTitle
                    blockCourseDiscussionCourseDiscussionTitle = blockCourseDiscussion.getCourseDiscussionTitle();
                    // read block.courseDiscussion.courseDiscussionDesc
                    blockCourseDiscussionCourseDiscussionDesc = blockCourseDiscussion.getCourseDiscussionDesc();
                }
        }
        if ((dirtyFlags & 0x280L) != 0) {
        }
        if ((dirtyFlags & 0x300L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x200L) != 0) {
            // api target 3
            if(getBuildSdkInt() >= 3) {

                this.fragmentCourseDiscussionCourseBlockEditDateTiet.setInputType(android.text.InputType.TYPE_NULL);
                this.fragmentCourseDiscussionCourseBlockEditTimeTiet.setInputType(android.text.InputType.TYPE_NULL);
            }
            // api target 1

            com.ustadmobile.port.android.view.binding.DatePickerBindingAdapter2Kt.setDateTimeInMillisChanged(this.fragmentCourseDiscussionCourseBlockEditDateTiet, fragmentCourseDiscussionCourseBlockEditDateTietdateTimeInMillisAttrChanged);
            com.ustadmobile.port.android.view.binding.EditTextBindingsKt.setRunOnClickWhenFocused(this.fragmentCourseDiscussionCourseBlockEditDateTiet, true);
            this.fragmentCourseDiscussionCourseBlockEditDateTil.setHint(com.ustadmobile.port.android.view.ext.StringExtKt.optional(getRoot().getContext(), fragmentCourseDiscussionCourseBlockEditDateTil.getResources().getString(R.string.dont_show_before)));
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.fragmentCourseDiscussionCourseBlockEditDescTiet, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, fragmentCourseDiscussionCourseBlockEditDescTietandroidTextAttrChanged);
            com.ustadmobile.port.android.view.binding.TimePickerBindingAdapterKt.getTime(this.fragmentCourseDiscussionCourseBlockEditTimeTiet, fragmentCourseDiscussionCourseBlockEditTimeTiettimeValueAttrChanged);
            com.ustadmobile.port.android.view.binding.EditTextBindingsKt.setRunOnClickWhenFocused(this.fragmentCourseDiscussionCourseBlockEditTimeTiet, true);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.fragmentCourseDiscussionCourseBlockEditTitleTiet, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, fragmentCourseDiscussionCourseBlockEditTitleTietandroidTextAttrChanged);
            this.fragmentCourseDiscussionEditAddNewTopicButton.setOnClickNew(mCallback11);
            this.fragmentCourseDiscussionEditAddNewTopicButton.setCreateNewText(getRoot().getResources().getString(R.string.add_topic));
        }
        if ((dirtyFlags & 0x242L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.DatePickerBindingAdapter2Kt.setDateTime2(this.fragmentCourseDiscussionCourseBlockEditDateTiet, startDate, timeZone, 0);
        }
        if ((dirtyFlags & 0x208L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fragmentCourseDiscussionCourseBlockEditDescTiet, blockCourseDiscussionCourseDiscussionDesc);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fragmentCourseDiscussionCourseBlockEditTitleTiet, blockCourseDiscussionCourseDiscussionTitle);
        }
        if ((dirtyFlags & 0x300L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TimePickerBindingAdapterKt.setTime(this.fragmentCourseDiscussionCourseBlockEditTimeTiet, startTime);
        }
        if ((dirtyFlags & 0x280L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.fragmentCourseDiscussionCourseBlockEditTitleTil, blockTitleError);
        }
        executeBindingsOn(fragmentCourseDiscussionEditAddNewTopicButton);
    }
    // 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.CourseDiscussionEditPresenter presenter = mPresenter;



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


            presenter.handleClickAddTopic();
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): fragmentCourseDiscussionEditAddNewTopicButton
        flag 1 (0x2L): startDate
        flag 2 (0x3L): presenter
        flag 3 (0x4L): block
        flag 4 (0x5L): scheduleOneToManyListener
        flag 5 (0x6L): fieldsEnabled
        flag 6 (0x7L): timeZone
        flag 7 (0x8L): blockTitleError
        flag 8 (0x9L): startTime
        flag 9 (0xaL): null
    flag mapping end*/
    //end
}