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 FragmentSchoolEditBindingImpl extends FragmentSchoolEditBinding 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(17);
        sIncludes.setIncludes(1, 
            new String[] {"item_scoped_grant_one_to_many_list"},
            new int[] {9},
            new int[] {com.toughra.ustadmobile.R.layout.item_scoped_grant_one_to_many_list});
        sViewsWithIds = new android.util.SparseIntArray();
        sViewsWithIds.put(R.id.fragment_school_edit_school_name_tip, 10);
        sViewsWithIds.put(R.id.fragment_school_edit_school_desc_tip, 11);
        sViewsWithIds.put(R.id.fragment_school_edit_timezone_tip, 12);
        sViewsWithIds.put(R.id.fragment_school_edit_holiday_calendar_selected, 13);
        sViewsWithIds.put(R.id.fragment_school_edit_school_address_tip, 14);
        sViewsWithIds.put(R.id.fragment_school_edit_school_phonenumber_tip, 15);
        sViewsWithIds.put(R.id.fragment_school_edit_school_email_tip, 16);
    }
    // views
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView2;
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView3;
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView4;
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView5;
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView6;
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView7;
    @NonNull
    private final com.google.android.material.textfield.TextInputEditText mboundView8;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback156;
    @Nullable
    private final android.view.View.OnClickListener mCallback155;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener mboundView2androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of school.schoolName
            //         is school.setSchoolName((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView2);
            // localize variables for thread safety
            // school
            com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar school = mSchool;
            // school.schoolName
            java.lang.String schoolSchoolName = null;
            // school != null
            boolean schoolJavaLangObjectNull = false;



            schoolJavaLangObjectNull = (school) != (null);
            if (schoolJavaLangObjectNull) {




                school.setSchoolName(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener mboundView3androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of school.schoolDesc
            //         is school.setSchoolDesc((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView3);
            // localize variables for thread safety
            // school.schoolDesc
            java.lang.String schoolSchoolDesc = null;
            // school
            com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar school = mSchool;
            // school != null
            boolean schoolJavaLangObjectNull = false;



            schoolJavaLangObjectNull = (school) != (null);
            if (schoolJavaLangObjectNull) {




                school.setSchoolDesc(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener mboundView6androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of school.schoolAddress
            //         is school.setSchoolAddress((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView6);
            // localize variables for thread safety
            // school.schoolAddress
            java.lang.String schoolSchoolAddress = null;
            // school
            com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar school = mSchool;
            // school != null
            boolean schoolJavaLangObjectNull = false;



            schoolJavaLangObjectNull = (school) != (null);
            if (schoolJavaLangObjectNull) {




                school.setSchoolAddress(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener mboundView7androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of school.schoolPhoneNumber
            //         is school.setSchoolPhoneNumber((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView7);
            // localize variables for thread safety
            // school
            com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar school = mSchool;
            // school.schoolPhoneNumber
            java.lang.String schoolSchoolPhoneNumber = null;
            // school != null
            boolean schoolJavaLangObjectNull = false;



            schoolJavaLangObjectNull = (school) != (null);
            if (schoolJavaLangObjectNull) {




                school.setSchoolPhoneNumber(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener mboundView8androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of school.schoolEmailAddress
            //         is school.setSchoolEmailAddress((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView8);
            // localize variables for thread safety
            // school.schoolEmailAddress
            java.lang.String schoolSchoolEmailAddress = null;
            // school
            com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar school = mSchool;
            // school != null
            boolean schoolJavaLangObjectNull = false;



            schoolJavaLangObjectNull = (school) != (null);
            if (schoolJavaLangObjectNull) {




                school.setSchoolEmailAddress(((java.lang.String) (callbackArg_0)));
            }
        }
    };

    public FragmentSchoolEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 17, sIncludes, sViewsWithIds));
    }
    private FragmentSchoolEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 1
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[1]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            , (com.google.android.material.textfield.TextInputLayout) bindings[13]
            , (com.google.android.material.textfield.TextInputLayout) bindings[14]
            , (com.google.android.material.textfield.TextInputLayout) bindings[11]
            , (com.google.android.material.textfield.TextInputLayout) bindings[16]
            , (com.google.android.material.textfield.TextInputLayout) bindings[10]
            , (com.google.android.material.textfield.TextInputLayout) bindings[15]
            , (com.google.android.material.textfield.TextInputLayout) bindings[12]
            , (com.toughra.ustadmobile.databinding.ItemScopedGrantOneToManyListBinding) bindings[9]
            );
        this.activitySchoolEditEditClx.setTag(null);
        this.activitySchoolEditScroll.setTag(null);
        this.mboundView2 = (com.google.android.material.textfield.TextInputEditText) bindings[2];
        this.mboundView2.setTag(null);
        this.mboundView3 = (com.google.android.material.textfield.TextInputEditText) bindings[3];
        this.mboundView3.setTag(null);
        this.mboundView4 = (com.google.android.material.textfield.TextInputEditText) bindings[4];
        this.mboundView4.setTag(null);
        this.mboundView5 = (com.google.android.material.textfield.TextInputEditText) bindings[5];
        this.mboundView5.setTag(null);
        this.mboundView6 = (com.google.android.material.textfield.TextInputEditText) bindings[6];
        this.mboundView6.setTag(null);
        this.mboundView7 = (com.google.android.material.textfield.TextInputEditText) bindings[7];
        this.mboundView7.setTag(null);
        this.mboundView8 = (com.google.android.material.textfield.TextInputEditText) bindings[8];
        this.mboundView8.setTag(null);
        setContainedBinding(this.schoolEditFragmentPermissionsInc);
        setRootTag(root);
        // listeners
        mCallback156 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback155 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

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

    @Override
    public boolean hasPendingBindings() {
        synchronized(this) {
            if (mDirtyFlags != 0) {
                return true;
            }
        }
        if (schoolEditFragmentPermissionsInc.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.mPresenter == variableId) {
            setMPresenter((com.ustadmobile.core.controller.SchoolEditPresenter) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.school == variableId) {
            setSchool((com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLoading(boolean Loading) {
        this.mLoading = Loading;
    }
    public void setMPresenter(@Nullable com.ustadmobile.core.controller.SchoolEditPresenter MPresenter) {
        this.mMPresenter = MPresenter;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.mPresenter);
        super.requestRebind();
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
    }
    public void setSchool(@Nullable com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar School) {
        this.mSchool = School;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.school);
        super.requestRebind();
    }

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

    @Override
    protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
        switch (localFieldId) {
            case 0 :
                return onChangeSchoolEditFragmentPermissionsInc((com.toughra.ustadmobile.databinding.ItemScopedGrantOneToManyListBinding) object, fieldId);
        }
        return false;
    }
    private boolean onChangeSchoolEditFragmentPermissionsInc(com.toughra.ustadmobile.databinding.ItemScopedGrantOneToManyListBinding SchoolEditFragmentPermissionsInc, 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;
        }
        java.lang.String schoolSchoolAddress = null;
        java.lang.String schoolSchoolDesc = null;
        com.ustadmobile.lib.db.entities.HolidayCalendar schoolHolidayCalendar = null;
        java.lang.String schoolHolidayCalendarUmCalendarName = null;
        com.ustadmobile.core.util.ScopedGrantOneToManyHelper mPresenterScopedGrantOneToManyHelper = null;
        java.lang.String schoolSchoolPhoneNumber = null;
        com.ustadmobile.core.controller.SchoolEditPresenter mPresenter = mMPresenter;
        java.lang.String schoolSchoolTimeZone = null;
        java.lang.String schoolSchoolEmailAddress = null;
        com.ustadmobile.lib.db.entities.SchoolWithHolidayCalendar school = mSchool;
        java.lang.String schoolSchoolName = null;

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



                if (mPresenter != null) {
                    // read mPresenter.scopedGrantOneToManyHelper
                    mPresenterScopedGrantOneToManyHelper = mPresenter.getScopedGrantOneToManyHelper();
                }
        }
        if ((dirtyFlags & 0x30L) != 0) {



                if (school != null) {
                    // read school.schoolAddress
                    schoolSchoolAddress = school.getSchoolAddress();
                    // read school.schoolDesc
                    schoolSchoolDesc = school.getSchoolDesc();
                    // read school.holidayCalendar
                    schoolHolidayCalendar = school.getHolidayCalendar();
                    // read school.schoolPhoneNumber
                    schoolSchoolPhoneNumber = school.getSchoolPhoneNumber();
                    // read school.schoolTimeZone
                    schoolSchoolTimeZone = school.getSchoolTimeZone();
                    // read school.schoolEmailAddress
                    schoolSchoolEmailAddress = school.getSchoolEmailAddress();
                    // read school.schoolName
                    schoolSchoolName = school.getSchoolName();
                }


                if (schoolHolidayCalendar != null) {
                    // read school.holidayCalendar.umCalendarName
                    schoolHolidayCalendarUmCalendarName = schoolHolidayCalendar.getUmCalendarName();
                }
        }
        // batch finished
        if ((dirtyFlags & 0x30L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView2, schoolSchoolName);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView3, schoolSchoolDesc);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView4, schoolSchoolTimeZone);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView5, schoolHolidayCalendarUmCalendarName);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView6, schoolSchoolAddress);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView7, schoolSchoolPhoneNumber);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView8, schoolSchoolEmailAddress);
        }
        if ((dirtyFlags & 0x20L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.mboundView2, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, mboundView2androidTextAttrChanged);
            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);
            this.mboundView4.setOnClickListener(mCallback155);
            this.mboundView5.setOnClickListener(mCallback156);
            com.ustadmobile.port.android.view.binding.EditTextBindingsKt.setRunOnClickWhenFocused(this.mboundView5, true);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.mboundView6, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, mboundView6androidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.mboundView7, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, mboundView7androidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.mboundView8, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, mboundView8androidTextAttrChanged);
            // api target 3
            if(getBuildSdkInt() >= 3) {

                this.mboundView5.setInputType(android.text.InputType.TYPE_NULL);
            }
        }
        if ((dirtyFlags & 0x24L) != 0) {
            // api target 1

            this.schoolEditFragmentPermissionsInc.setScopedGrantsOneToManyListener(mPresenterScopedGrantOneToManyHelper);
        }
        executeBindingsOn(schoolEditFragmentPermissionsInc);
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        switch(sourceId) {
            case 2: {
                // localize variables for thread safety
                // mPresenter != null
                boolean mPresenterJavaLangObjectNull = false;
                // mPresenter
                com.ustadmobile.core.controller.SchoolEditPresenter mPresenter = mMPresenter;



                mPresenterJavaLangObjectNull = (mPresenter) != (null);
                if (mPresenterJavaLangObjectNull) {


                    mPresenter.handleHolidayCalendarClicked();
                }
                break;
            }
            case 1: {
                // localize variables for thread safety
                // mPresenter != null
                boolean mPresenterJavaLangObjectNull = false;
                // mPresenter
                com.ustadmobile.core.controller.SchoolEditPresenter mPresenter = mMPresenter;



                mPresenterJavaLangObjectNull = (mPresenter) != (null);
                if (mPresenterJavaLangObjectNull) {


                    mPresenter.handleTimeZoneClicked();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): schoolEditFragmentPermissionsInc
        flag 1 (0x2L): loading
        flag 2 (0x3L): mPresenter
        flag 3 (0x4L): fieldsEnabled
        flag 4 (0x5L): school
        flag 5 (0x6L): null
    flag mapping end*/
    //end
}