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 FragmentErrorReportBindingImpl extends FragmentErrorReportBinding 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 = null;
        sViewsWithIds = new android.util.SparseIntArray();
        sViewsWithIds.put(R.id.error_image, 7);
        sViewsWithIds.put(R.id.errorExplainText, 8);
        sViewsWithIds.put(R.id.divider1, 9);
        sViewsWithIds.put(R.id.incident_id_label, 10);
        sViewsWithIds.put(R.id.divider2, 11);
    }
    // views
    @NonNull
    private final androidx.core.widget.NestedScrollView mboundView0;
    @NonNull
    private final android.widget.TextView mboundView6;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback35;
    @Nullable
    private final android.view.View.OnClickListener mCallback36;
    @Nullable
    private final android.view.View.OnClickListener mCallback34;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public FragmentErrorReportBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 12, sIncludes, sViewsWithIds));
    }
    private FragmentErrorReportBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (com.google.android.material.button.MaterialButton) bindings[3]
            , (android.view.View) bindings[9]
            , (android.view.View) bindings[11]
            , (android.widget.TextView) bindings[5]
            , (android.widget.TextView) bindings[8]
            , (android.widget.ImageView) bindings[7]
            , (android.widget.TextView) bindings[10]
            , (android.widget.TextView) bindings[2]
            , (com.google.android.material.button.MaterialButton) bindings[4]
            , (com.google.android.material.button.MaterialButton) bindings[1]
            );
        this.copyIncidentIdButton.setTag(null);
        this.errorCodeText.setTag(null);
        this.incidentIdText.setTag(null);
        this.mboundView0 = (androidx.core.widget.NestedScrollView) bindings[0];
        this.mboundView0.setTag(null);
        this.mboundView6 = (android.widget.TextView) bindings[6];
        this.mboundView6.setTag(null);
        this.shareIncidentButton.setTag(null);
        this.takeMeHomeButton.setTag(null);
        setRootTag(root);
        // listeners
        mCallback35 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback36 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 3);
        mCallback34 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x8L;
        }
        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.errorReport == variableId) {
            setErrorReport((com.ustadmobile.lib.db.entities.ErrorReport) variable);
        }
        else if (BR.eventHandler == variableId) {
            setEventHandler((com.ustadmobile.port.android.view.ErrorReportFragmentEventHandler) variable);
        }
        else if (BR.mPresenter == variableId) {
            setMPresenter((com.ustadmobile.core.controller.ErrorReportPresenter) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setErrorReport(@Nullable com.ustadmobile.lib.db.entities.ErrorReport ErrorReport) {
        this.mErrorReport = ErrorReport;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.errorReport);
        super.requestRebind();
    }
    public void setEventHandler(@Nullable com.ustadmobile.port.android.view.ErrorReportFragmentEventHandler EventHandler) {
        this.mEventHandler = EventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.eventHandler);
        super.requestRebind();
    }
    public void setMPresenter(@Nullable com.ustadmobile.core.controller.ErrorReportPresenter MPresenter) {
        this.mMPresenter = MPresenter;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.mPresenter);
        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;
        }
        com.ustadmobile.lib.db.entities.ErrorReport errorReport = mErrorReport;
        com.ustadmobile.port.android.view.ErrorReportFragmentEventHandler eventHandler = mEventHandler;
        java.lang.String errorCodeTextAndroidStringErrorCodeErrorReportErrorCode = null;
        int errorReportErrorCode = 0;
        com.ustadmobile.core.controller.ErrorReportPresenter mPresenter = mMPresenter;
        java.lang.String errorReportMessage = null;
        java.lang.String stringValueOfErrorReportErrUid = null;
        long errorReportErrUid = 0;

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



                if (errorReport != null) {
                    // read errorReport.errorCode
                    errorReportErrorCode = errorReport.getErrorCode();
                    // read errorReport.message
                    errorReportMessage = errorReport.getMessage();
                    // read errorReport.errUid
                    errorReportErrUid = errorReport.getErrUid();
                }


                // read @android:string/error_code
                errorCodeTextAndroidStringErrorCodeErrorReportErrorCode = errorCodeText.getResources().getString(R.string.error_code, errorReportErrorCode);
                // read String.valueOf(errorReport.errUid)
                stringValueOfErrorReportErrUid = java.lang.String.valueOf(errorReportErrUid);
        }
        // batch finished
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            this.copyIncidentIdButton.setOnClickListener(mCallback35);
            this.shareIncidentButton.setOnClickListener(mCallback36);
            this.takeMeHomeButton.setOnClickListener(mCallback34);
        }
        if ((dirtyFlags & 0x9L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.errorCodeText, errorCodeTextAndroidStringErrorCodeErrorReportErrorCode);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.incidentIdText, stringValueOfErrorReportErrUid);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView6, errorReportMessage);
        }
    }
    // 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
                // errorReport.errUid
                long errorReportErrUid = 0;
                // eventHandler
                com.ustadmobile.port.android.view.ErrorReportFragmentEventHandler eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;
                // errorReport
                com.ustadmobile.lib.db.entities.ErrorReport errorReport = mErrorReport;
                // errorReport != null
                boolean errorReportJavaLangObjectNull = false;



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



                    errorReportJavaLangObjectNull = (errorReport) != (null);
                    if (errorReportJavaLangObjectNull) {


                        errorReportErrUid = errorReport.getErrUid();

                        eventHandler.onClickCopyIncidentId(errorReportErrUid);
                    }
                }
                break;
            }
            case 3: {
                // localize variables for thread safety
                // errorReport.errUid
                long errorReportErrUid = 0;
                // eventHandler
                com.ustadmobile.port.android.view.ErrorReportFragmentEventHandler eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;
                // errorReport
                com.ustadmobile.lib.db.entities.ErrorReport errorReport = mErrorReport;
                // errorReport != null
                boolean errorReportJavaLangObjectNull = false;



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



                    errorReportJavaLangObjectNull = (errorReport) != (null);
                    if (errorReportJavaLangObjectNull) {


                        errorReportErrUid = errorReport.getErrUid();

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



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


                    mPresenter.handleClickTakeMeHome();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): errorReport
        flag 1 (0x2L): eventHandler
        flag 2 (0x3L): mPresenter
        flag 3 (0x4L): null
    flag mapping end*/
    //end
}