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 FragmentTextCourseBlockEditBindingImpl extends FragmentTextCourseBlockEditBinding  {

    @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.fragment_course_block_edit_edit_clx, 6);
        sViewsWithIds.put(R.id.ca_start_datetime_textinput, 7);
        sViewsWithIds.put(R.id.editor, 8);
        sViewsWithIds.put(R.id.formatting_toolbar, 9);
    }
    // views
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView5;
    // variables
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener caStartDatedateTimeInMillisAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of startDate
            //         is com.toughra.ustadmobile.databinding.FragmentTextCourseBlockEditBindingImpl.this.setStartDate(callbackArg_0)
            long callbackArg_0 = com.ustadmobile.port.android.view.binding.DatePickerBindingAdapter2Kt.getDateTimeInMillis(caStartDate);
            // localize variables for thread safety
            // startDate
            long startDate = mStartDate;


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



                com.toughra.ustadmobile.databinding.FragmentTextCourseBlockEditBindingImpl.this.setStartDate(callbackArg_0);
            }
        }
    };
    private androidx.databinding.InverseBindingListener courseBlockEditTitleTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of block.cbTitle
            //         is block.setCbTitle((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(courseBlockEditTitleText);
            // localize variables for thread safety
            // block
            com.ustadmobile.lib.db.entities.CourseBlock block = mBlock;
            // block != null
            boolean blockJavaLangObjectNull = false;
            // block.cbTitle
            java.lang.String blockCbTitle = null;



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




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


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



                com.toughra.ustadmobile.databinding.FragmentTextCourseBlockEditBindingImpl.this.setStartTime(callbackArg_0);
            }
        }
    };

    public FragmentTextCourseBlockEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 10, sIncludes, sViewsWithIds));
    }
    private FragmentTextCourseBlockEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (com.google.android.material.textfield.TextInputEditText) bindings[4]
            , (com.google.android.material.textfield.TextInputLayout) bindings[3]
            , (com.google.android.material.textfield.TextInputLayout) bindings[7]
            , (com.google.android.material.textfield.TextInputEditText) bindings[2]
            , (com.google.android.material.textfield.TextInputLayout) bindings[1]
            , (org.wordpress.aztec.AztecText) bindings[8]
            , (org.wordpress.aztec.toolbar.AztecToolbar) bindings[9]
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[6]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            );
        this.caStartDate.setTag(null);
        this.caStartDateTextinput.setTag(null);
        this.courseBlockEditTitleText.setTag(null);
        this.courseBlockEditTitleTextinput.setTag(null);
        this.fragmentLeavingReasonEditEditScroll.setTag(null);
        this.mboundView5 = (com.google.android.material.textfield.TextInputEditText) bindings[5];
        this.mboundView5.setTag(null);
        setRootTag(root);
        // listeners
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x40L;
        }
        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.startDate == variableId) {
            setStartDate((long) variable);
        }
        else if (BR.block == variableId) {
            setBlock((com.ustadmobile.lib.db.entities.CourseBlock) 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 |= 0x1L;
        }
        notifyPropertyChanged(BR.startDate);
        super.requestRebind();
    }
    public void setBlock(@Nullable com.ustadmobile.lib.db.entities.CourseBlock Block) {
        this.mBlock = Block;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.block);
        super.requestRebind();
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
    }
    public void setTimeZone(@Nullable java.lang.String TimeZone) {
        this.mTimeZone = TimeZone;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.timeZone);
        super.requestRebind();
    }
    public void setBlockTitleError(@Nullable java.lang.String BlockTitleError) {
        this.mBlockTitleError = BlockTitleError;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.blockTitleError);
        super.requestRebind();
    }
    public void setStartTime(long StartTime) {
        this.mStartTime = StartTime;
        synchronized(this) {
            mDirtyFlags |= 0x20L;
        }
        notifyPropertyChanged(BR.startTime);
        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;
        }
        long startDate = mStartDate;
        com.ustadmobile.lib.db.entities.CourseBlock block = mBlock;
        java.lang.String timeZone = mTimeZone;
        java.lang.String blockCbTitle = null;
        java.lang.String blockTitleError = mBlockTitleError;
        long startTime = mStartTime;

        if ((dirtyFlags & 0x49L) != 0) {
        }
        if ((dirtyFlags & 0x42L) != 0) {



                if (block != null) {
                    // read block.cbTitle
                    blockCbTitle = block.getCbTitle();
                }
        }
        if ((dirtyFlags & 0x50L) != 0) {
        }
        if ((dirtyFlags & 0x60L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x40L) != 0) {
            // api target 3
            if(getBuildSdkInt() >= 3) {

                this.caStartDate.setInputType(android.text.InputType.TYPE_NULL);
                this.mboundView5.setInputType(android.text.InputType.TYPE_NULL);
            }
            // api target 1

            com.ustadmobile.port.android.view.binding.DatePickerBindingAdapter2Kt.setDateTimeInMillisChanged(this.caStartDate, caStartDatedateTimeInMillisAttrChanged);
            com.ustadmobile.port.android.view.binding.EditTextBindingsKt.setRunOnClickWhenFocused(this.caStartDate, true);
            this.caStartDateTextinput.setHint(com.ustadmobile.port.android.view.ext.StringExtKt.optional(getRoot().getContext(), caStartDateTextinput.getResources().getString(R.string.dont_show_before)));
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.courseBlockEditTitleText, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, courseBlockEditTitleTextandroidTextAttrChanged);
            com.ustadmobile.port.android.view.binding.TimePickerBindingAdapterKt.getTime(this.mboundView5, mboundView5timeValueAttrChanged);
            com.ustadmobile.port.android.view.binding.EditTextBindingsKt.setRunOnClickWhenFocused(this.mboundView5, true);
        }
        if ((dirtyFlags & 0x49L) != 0) {
            // api target 1

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

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.courseBlockEditTitleText, blockCbTitle);
        }
        if ((dirtyFlags & 0x50L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.courseBlockEditTitleTextinput, blockTitleError);
        }
        if ((dirtyFlags & 0x60L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TimePickerBindingAdapterKt.setTime(this.mboundView5, startTime);
        }
    }
    // Listener Stub Implementations
    // callback impls
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): startDate
        flag 1 (0x2L): block
        flag 2 (0x3L): fieldsEnabled
        flag 3 (0x4L): timeZone
        flag 4 (0x5L): blockTitleError
        flag 5 (0x6L): startTime
        flag 6 (0x7L): null
    flag mapping end*/
    //end
}