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 FragmentHolidaycalendarEditBindingImpl extends FragmentHolidaycalendarEditBinding 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(6);
        sIncludes.setIncludes(1, 
            new String[] {"item_createnew"},
            new int[] {4},
            new int[] {com.toughra.ustadmobile.R.layout.item_createnew});
        sViewsWithIds = new android.util.SparseIntArray();
        sViewsWithIds.put(R.id.activity_holidaycalendar_holiday_recyclerview, 5);
    }
    // views
    @Nullable
    private final com.toughra.ustadmobile.databinding.ItemCreatenewBinding mboundView1;
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView3;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback123;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener mboundView3androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of holidaycalendar.umCalendarName
            //         is holidaycalendar.setUmCalendarName((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView3);
            // localize variables for thread safety
            // holidaycalendar.umCalendarName
            java.lang.String holidaycalendarUmCalendarName = null;
            // holidaycalendar
            com.ustadmobile.lib.db.entities.HolidayCalendar holidaycalendar = mHolidaycalendar;
            // holidaycalendar != null
            boolean holidaycalendarJavaLangObjectNull = false;



            holidaycalendarJavaLangObjectNull = (holidaycalendar) != (null);
            if (holidaycalendarJavaLangObjectNull) {




                holidaycalendar.setUmCalendarName(((java.lang.String) (callbackArg_0)));
            }
        }
    };

    public FragmentHolidaycalendarEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 6, sIncludes, sViewsWithIds));
    }
    private FragmentHolidaycalendarEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[1]
            , (com.google.android.material.textfield.TextInputLayout) bindings[2]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            , (androidx.recyclerview.widget.RecyclerView) bindings[5]
            );
        this.activityClazzEditEditClx.setTag(null);
        this.activityHolidayCalendarNameText.setTag(null);
        this.activityHolidaycalendarEditScroll.setTag(null);
        this.mboundView1 = (com.toughra.ustadmobile.databinding.ItemCreatenewBinding) bindings[4];
        setContainedBinding(this.mboundView1);
        this.mboundView3 = (com.google.android.material.textfield.TextInputEditText) bindings[3];
        this.mboundView3.setTag(null);
        setRootTag(root);
        // listeners
        mCallback123 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

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

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

    @Override
    public boolean setVariable(int variableId, @Nullable Object variable)  {
        boolean variableSet = true;
        if (BR.loading == variableId) {
            setLoading((boolean) variable);
        }
        else if (BR.holidaycalendar == variableId) {
            setHolidaycalendar((com.ustadmobile.lib.db.entities.HolidayCalendar) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.HolidayCalendarEditPresenter) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLoading(boolean Loading) {
        this.mLoading = Loading;
    }
    public void setHolidaycalendar(@Nullable com.ustadmobile.lib.db.entities.HolidayCalendar Holidaycalendar) {
        this.mHolidaycalendar = Holidaycalendar;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.holidaycalendar);
        super.requestRebind();
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.fieldsEnabled);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.HolidayCalendarEditPresenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }

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

    @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;
        }
        com.ustadmobile.lib.db.entities.HolidayCalendar holidaycalendar = mHolidaycalendar;
        boolean fieldsEnabled = mFieldsEnabled;
        java.lang.String holidaycalendarUmCalendarName = null;
        com.ustadmobile.core.controller.HolidayCalendarEditPresenter presenter = mPresenter;

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



                if (holidaycalendar != null) {
                    // read holidaycalendar.umCalendarName
                    holidaycalendarUmCalendarName = holidaycalendar.getUmCalendarName();
                }
        }
        if ((dirtyFlags & 0x14L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x14L) != 0) {
            // api target 1

            this.activityHolidayCalendarNameText.setEnabled(fieldsEnabled);
            this.mboundView3.setEnabled(fieldsEnabled);
        }
        if ((dirtyFlags & 0x10L) != 0) {
            // api target 1

            this.mboundView1.setCreateNewText(getRoot().getResources().getString(R.string.add_a_holiday));
            this.mboundView1.setOnClickNew(mCallback123);
            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);
        }
        if ((dirtyFlags & 0x12L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView3, holidaycalendarUmCalendarName);
        }
        executeBindingsOn(mboundView1);
    }
    // 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.HolidayCalendarEditPresenter presenter = mPresenter;
        // presenter.holidayToManyJoinListener != null
        boolean presenterHolidayToManyJoinListenerJavaLangObjectNull = false;
        // presenter.holidayToManyJoinListener
        com.ustadmobile.core.util.NavigateForResultOneToManyJoinEditListener<com.ustadmobile.lib.db.entities.Holiday> presenterHolidayToManyJoinListener = null;



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


            presenterHolidayToManyJoinListener = presenter.getHolidayToManyJoinListener();

            presenterHolidayToManyJoinListenerJavaLangObjectNull = (presenterHolidayToManyJoinListener) != (null);
            if (presenterHolidayToManyJoinListenerJavaLangObjectNull) {


                presenterHolidayToManyJoinListener.onClickNew();
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): loading
        flag 1 (0x2L): holidaycalendar
        flag 2 (0x3L): fieldsEnabled
        flag 3 (0x4L): presenter
        flag 4 (0x5L): null
    flag mapping end*/
    //end
}