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 FragmentReportEditBindingImpl extends FragmentReportEditBinding 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(12);
        sIncludes.setIncludes(1, 
            new String[] {"item_createnew"},
            new int[] {7},
            new int[] {com.toughra.ustadmobile.R.layout.item_createnew});
        sViewsWithIds = new android.util.SparseIntArray();
        sViewsWithIds.put(R.id.fragment_report_edit_description_layout, 8);
        sViewsWithIds.put(R.id.fragment_edit_report_dialog_xaxis_textinputlayout, 9);
        sViewsWithIds.put(R.id.fragment_edit_report_dialog_daterange_textinputlayout, 10);
        sViewsWithIds.put(R.id.activity_report_edit_series_list, 11);
    }
    // views
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback9;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener fragmentEditReportDialogDaterangeTextselectedMessageIdOptionAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of report.reportDateRangeSelection
            //         is report.setReportDateRangeSelection((int) callbackArg_0)
            int callbackArg_0 = com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.getSelectedMessageIdOption(fragmentEditReportDialogDaterangeText);
            // localize variables for thread safety
            // report != null
            boolean reportJavaLangObjectNull = false;
            // report.reportDateRangeSelection
            int reportReportDateRangeSelection = 0;
            // report
            com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters report = mReport;



            reportJavaLangObjectNull = (report) != (null);
            if (reportJavaLangObjectNull) {




                report.setReportDateRangeSelection(((int) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener fragmentEditReportDialogXaxisTextselectedMessageIdOptionAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of report.XAxis
            //         is report.setXAxis((int) callbackArg_0)
            int callbackArg_0 = com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.getSelectedMessageIdOption(fragmentEditReportDialogXaxisText);
            // localize variables for thread safety
            // report != null
            boolean reportJavaLangObjectNull = false;
            // report
            com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters report = mReport;
            // report.XAxis
            int reportXAxis = 0;



            reportJavaLangObjectNull = (report) != (null);
            if (reportJavaLangObjectNull) {




                report.setXAxis(((int) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener fragmentReportEditDescriptionTextandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of report.reportDescription
            //         is report.setReportDescription((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(fragmentReportEditDescriptionText);
            // localize variables for thread safety
            // report != null
            boolean reportJavaLangObjectNull = false;
            // report
            com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters report = mReport;
            // report.reportDescription
            java.lang.String reportReportDescription = null;



            reportJavaLangObjectNull = (report) != (null);
            if (reportJavaLangObjectNull) {




                report.setReportDescription(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener fragmentReportEditTitleandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of report.reportTitle
            //         is report.setReportTitle((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(fragmentReportEditTitle);
            // localize variables for thread safety
            // report != null
            boolean reportJavaLangObjectNull = false;
            // report
            com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters report = mReport;
            // report.reportTitle
            java.lang.String reportReportTitle = null;



            reportJavaLangObjectNull = (report) != (null);
            if (reportJavaLangObjectNull) {




                report.setReportTitle(((java.lang.String) (callbackArg_0)));
            }
        }
    };

    public FragmentReportEditBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 12, sIncludes, sViewsWithIds));
    }
    private FragmentReportEditBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 1
            , (com.toughra.ustadmobile.databinding.ItemCreatenewBinding) bindings[7]
            , (androidx.recyclerview.widget.RecyclerView) bindings[11]
            , (com.ustadmobile.port.android.view.IdOptionAutoCompleteTextView) bindings[6]
            , (com.google.android.material.textfield.TextInputLayout) bindings[10]
            , (com.ustadmobile.port.android.view.IdOptionAutoCompleteTextView) bindings[5]
            , (com.google.android.material.textfield.TextInputLayout) bindings[9]
            , (com.google.android.material.textfield.TextInputLayout) bindings[8]
            , (com.google.android.material.textfield.TextInputEditText) bindings[4]
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[1]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            , (com.google.android.material.textfield.TextInputEditText) bindings[3]
            , (com.google.android.material.textfield.TextInputLayout) bindings[2]
            );
        setContainedBinding(this.activityEditReportSeriesAddLayout);
        this.fragmentEditReportDialogDaterangeText.setTag(null);
        this.fragmentEditReportDialogXaxisText.setTag(null);
        this.fragmentReportEditDescriptionText.setTag(null);
        this.fragmentReportEditEditClx.setTag(null);
        this.fragmentReportEditEditScroll.setTag(null);
        this.fragmentReportEditTitle.setTag(null);
        this.fragmentReportEditTitleLayout.setTag(null);
        setRootTag(root);
        // listeners
        mCallback9 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

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

    @Override
    public boolean hasPendingBindings() {
        synchronized(this) {
            if (mDirtyFlags != 0) {
                return true;
            }
        }
        if (activityEditReportSeriesAddLayout.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.dateRangeOptions == variableId) {
            setDateRangeOptions((java.util.List<com.ustadmobile.core.util.IdOption>) variable);
        }
        else if (BR.eventHandler == variableId) {
            setEventHandler((com.ustadmobile.port.android.view.ReportEditFragmentEventHandler) variable);
        }
        else if (BR.mPresenter == variableId) {
            setMPresenter((com.ustadmobile.core.controller.ReportDetailPresenter) variable);
        }
        else if (BR.report == variableId) {
            setReport((com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.xAxisOptions == variableId) {
            setXAxisOptions((java.util.List<com.ustadmobile.core.util.IdOption>) variable);
        }
        else if (BR.xAxisSelectionListener == variableId) {
            setXAxisSelectionListener((com.ustadmobile.port.android.view.DropDownListAutoCompleteTextView.OnDropDownListItemSelectedListener<com.ustadmobile.core.util.IdOption>) variable);
        }
        else if (BR.titleErrorText == variableId) {
            setTitleErrorText((java.lang.String) variable);
        }
        else if (BR.dateRangeMomentSelected == variableId) {
            setDateRangeMomentSelected((com.ustadmobile.lib.db.entities.DateRangeMoment) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLoading(boolean Loading) {
        this.mLoading = Loading;
    }
    public void setDateRangeOptions(@Nullable java.util.List<com.ustadmobile.core.util.IdOption> DateRangeOptions) {
        this.mDateRangeOptions = DateRangeOptions;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.dateRangeOptions);
        super.requestRebind();
    }
    public void setEventHandler(@Nullable com.ustadmobile.port.android.view.ReportEditFragmentEventHandler EventHandler) {
        this.mEventHandler = EventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.eventHandler);
        super.requestRebind();
    }
    public void setMPresenter(@Nullable com.ustadmobile.core.controller.ReportDetailPresenter MPresenter) {
        this.mMPresenter = MPresenter;
    }
    public void setReport(@Nullable com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters Report) {
        this.mReport = Report;
        synchronized(this) {
            mDirtyFlags |= 0x20L;
        }
        notifyPropertyChanged(BR.report);
        super.requestRebind();
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
    }
    public void setXAxisOptions(@Nullable java.util.List<com.ustadmobile.core.util.IdOption> XAxisOptions) {
        this.mXAxisOptions = XAxisOptions;
        synchronized(this) {
            mDirtyFlags |= 0x80L;
        }
        notifyPropertyChanged(BR.xAxisOptions);
        super.requestRebind();
    }
    public void setXAxisSelectionListener(@Nullable com.ustadmobile.port.android.view.DropDownListAutoCompleteTextView.OnDropDownListItemSelectedListener<com.ustadmobile.core.util.IdOption> XAxisSelectionListener) {
        this.mXAxisSelectionListener = XAxisSelectionListener;
        synchronized(this) {
            mDirtyFlags |= 0x100L;
        }
        notifyPropertyChanged(BR.xAxisSelectionListener);
        super.requestRebind();
    }
    public void setTitleErrorText(@Nullable java.lang.String TitleErrorText) {
        this.mTitleErrorText = TitleErrorText;
        synchronized(this) {
            mDirtyFlags |= 0x200L;
        }
        notifyPropertyChanged(BR.titleErrorText);
        super.requestRebind();
    }
    public void setDateRangeMomentSelected(@Nullable com.ustadmobile.lib.db.entities.DateRangeMoment DateRangeMomentSelected) {
        this.mDateRangeMomentSelected = DateRangeMomentSelected;
        synchronized(this) {
            mDirtyFlags |= 0x400L;
        }
        notifyPropertyChanged(BR.dateRangeMomentSelected);
        super.requestRebind();
    }

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

    @Override
    protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
        switch (localFieldId) {
            case 0 :
                return onChangeActivityEditReportSeriesAddLayout((com.toughra.ustadmobile.databinding.ItemCreatenewBinding) object, fieldId);
        }
        return false;
    }
    private boolean onChangeActivityEditReportSeriesAddLayout(com.toughra.ustadmobile.databinding.ItemCreatenewBinding ActivityEditReportSeriesAddLayout, 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;
        }
        int reportReportDateRangeSelection = 0;
        java.lang.String reportReportDescription = null;
        java.lang.String reportReportTitle = null;
        java.util.List<com.ustadmobile.core.util.IdOption> dateRangeOptions = mDateRangeOptions;
        com.ustadmobile.port.android.view.ReportEditFragmentEventHandler eventHandler = mEventHandler;
        int reportXAxis = 0;
        com.ustadmobile.lib.db.entities.ReportWithSeriesWithFilters report = mReport;
        java.util.List<com.ustadmobile.core.util.IdOption> xAxisOptions = mXAxisOptions;
        com.ustadmobile.port.android.view.DropDownListAutoCompleteTextView.OnDropDownListItemSelectedListener<com.ustadmobile.core.util.IdOption> xAxisSelectionListener = mXAxisSelectionListener;
        java.lang.String titleErrorText = mTitleErrorText;
        com.ustadmobile.lib.db.entities.DateRangeMoment dateRangeMomentSelected = mDateRangeMomentSelected;

        if ((dirtyFlags & 0x824L) != 0) {
        }
        if ((dirtyFlags & 0xca4L) != 0) {


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

                    if (report != null) {
                        // read report.reportDateRangeSelection
                        reportReportDateRangeSelection = report.getReportDateRangeSelection();
                    }
            }
            if ((dirtyFlags & 0x820L) != 0) {

                    if (report != null) {
                        // read report.reportDescription
                        reportReportDescription = report.getReportDescription();
                        // read report.reportTitle
                        reportReportTitle = report.getReportTitle();
                    }
            }
            if ((dirtyFlags & 0x8a0L) != 0) {

                    if (report != null) {
                        // read report.XAxis
                        reportXAxis = report.getXAxis();
                    }
            }
        }
        if ((dirtyFlags & 0x8a0L) != 0) {
        }
        if ((dirtyFlags & 0x900L) != 0) {
        }
        if ((dirtyFlags & 0xa00L) != 0) {
        }
        if ((dirtyFlags & 0xc20L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x800L) != 0) {
            // api target 1

            this.activityEditReportSeriesAddLayout.setCreateNewText(getRoot().getResources().getString(R.string.xapi_options_series));
            this.activityEditReportSeriesAddLayout.setOnClickNew(mCallback9);
            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setSelectedMessageIdListener(this.fragmentEditReportDialogDaterangeText, fragmentEditReportDialogDaterangeTextselectedMessageIdOptionAttrChanged);
            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setSelectedMessageIdListener(this.fragmentEditReportDialogXaxisText, fragmentEditReportDialogXaxisTextselectedMessageIdOptionAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.fragmentReportEditDescriptionText, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, fragmentReportEditDescriptionTextandroidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.fragmentReportEditTitle, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, fragmentReportEditTitleandroidTextAttrChanged);
        }
        if ((dirtyFlags & 0x900L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setOnMessageIdOptionSelected(this.fragmentEditReportDialogDaterangeText, xAxisSelectionListener);
            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setOnMessageIdOptionSelected(this.fragmentEditReportDialogXaxisText, xAxisSelectionListener);
        }
        if ((dirtyFlags & 0x824L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setMessageIdOptions(this.fragmentEditReportDialogDaterangeText, dateRangeOptions, reportReportDateRangeSelection);
        }
        if ((dirtyFlags & 0xc20L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setDateRangeMoment(this.fragmentEditReportDialogDaterangeText, dateRangeMomentSelected, report);
        }
        if ((dirtyFlags & 0x8a0L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setMessageIdOptions(this.fragmentEditReportDialogXaxisText, xAxisOptions, reportXAxis);
        }
        if ((dirtyFlags & 0x820L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fragmentReportEditDescriptionText, reportReportDescription);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.fragmentReportEditTitle, reportReportTitle);
        }
        if ((dirtyFlags & 0xa00L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.fragmentReportEditTitleLayout, titleErrorText);
        }
        executeBindingsOn(activityEditReportSeriesAddLayout);
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // eventHandler
        com.ustadmobile.port.android.view.ReportEditFragmentEventHandler eventHandler = mEventHandler;
        // eventHandler != null
        boolean eventHandlerJavaLangObjectNull = false;



        eventHandlerJavaLangObjectNull = (eventHandler) != (null);
        if (eventHandlerJavaLangObjectNull) {


            eventHandler.onClickNewSeries();
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): activityEditReportSeriesAddLayout
        flag 1 (0x2L): loading
        flag 2 (0x3L): dateRangeOptions
        flag 3 (0x4L): eventHandler
        flag 4 (0x5L): mPresenter
        flag 5 (0x6L): report
        flag 6 (0x7L): fieldsEnabled
        flag 7 (0x8L): xAxisOptions
        flag 8 (0x9L): xAxisSelectionListener
        flag 9 (0xaL): titleErrorText
        flag 10 (0xbL): dateRangeMomentSelected
        flag 11 (0xcL): null
    flag mapping end*/
    //end
}