package com.mastercoding.quadraticequationsolver.databinding;
import com.mastercoding.quadraticequationsolver.R;
import com.mastercoding.quadraticequationsolver.BR;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
@SuppressWarnings("unchecked")
public class ActivityMainBindingImpl extends ActivityMainBinding  {

    @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.textView, 5);
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    // values
    // listeners
    private OnClickListenerImpl mMyequationSolveEquationAndroidViewViewOnClickListener;
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener edit1androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of myequation.a
            //         is myequation.setA((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(edit1);
            // localize variables for thread safety
            // myequation != null
            boolean myequationJavaLangObjectNull = false;
            // myequation.a
            java.lang.String myequationA = null;
            // myequation
            com.mastercoding.quadraticequationsolver.MyEquation myequation = mMyequation;



            myequationJavaLangObjectNull = (myequation) != (null);
            if (myequationJavaLangObjectNull) {




                myequation.setA(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener edit2androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of myequation.b
            //         is myequation.setB((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(edit2);
            // localize variables for thread safety
            // myequation != null
            boolean myequationJavaLangObjectNull = false;
            // myequation.b
            java.lang.String myequationB = null;
            // myequation
            com.mastercoding.quadraticequationsolver.MyEquation myequation = mMyequation;



            myequationJavaLangObjectNull = (myequation) != (null);
            if (myequationJavaLangObjectNull) {




                myequation.setB(((java.lang.String) (callbackArg_0)));
            }
        }
    };
    private androidx.databinding.InverseBindingListener edit3androidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of myequation.c
            //         is myequation.setC((java.lang.String) callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(edit3);
            // localize variables for thread safety
            // myequation != null
            boolean myequationJavaLangObjectNull = false;
            // myequation.c
            java.lang.String myequationC = null;
            // myequation
            com.mastercoding.quadraticequationsolver.MyEquation myequation = mMyequation;



            myequationJavaLangObjectNull = (myequation) != (null);
            if (myequationJavaLangObjectNull) {




                myequation.setC(((java.lang.String) (callbackArg_0)));
            }
        }
    };

    public ActivityMainBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 6, sIncludes, sViewsWithIds));
    }
    private ActivityMainBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 1
            , (android.widget.Button) bindings[4]
            , (android.widget.EditText) bindings[1]
            , (android.widget.EditText) bindings[2]
            , (android.widget.EditText) bindings[3]
            , (android.widget.TextView) bindings[5]
            );
        this.button.setTag(null);
        this.edit1.setTag(null);
        this.edit2.setTag(null);
        this.edit3.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x10L;
        }
        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.myequation == variableId) {
            setMyequation((com.mastercoding.quadraticequationsolver.MyEquation) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setMyequation(@Nullable com.mastercoding.quadraticequationsolver.MyEquation Myequation) {
        updateRegistration(0, Myequation);
        this.mMyequation = Myequation;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.myequation);
        super.requestRebind();
    }

    @Override
    protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
        switch (localFieldId) {
            case 0 :
                return onChangeMyequation((com.mastercoding.quadraticequationsolver.MyEquation) object, fieldId);
        }
        return false;
    }
    private boolean onChangeMyequation(com.mastercoding.quadraticequationsolver.MyEquation Myequation, int fieldId) {
        if (fieldId == BR._all) {
            synchronized(this) {
                    mDirtyFlags |= 0x1L;
            }
            return true;
        }
        else if (fieldId == BR.a) {
            synchronized(this) {
                    mDirtyFlags |= 0x2L;
            }
            return true;
        }
        else if (fieldId == BR.b) {
            synchronized(this) {
                    mDirtyFlags |= 0x4L;
            }
            return true;
        }
        else if (fieldId == BR.c) {
            synchronized(this) {
                    mDirtyFlags |= 0x8L;
            }
            return true;
        }
        return false;
    }

    @Override
    protected void executeBindings() {
        long dirtyFlags = 0;
        synchronized(this) {
            dirtyFlags = mDirtyFlags;
            mDirtyFlags = 0;
        }
        android.view.View.OnClickListener myequationSolveEquationAndroidViewViewOnClickListener = null;
        java.lang.String myequationA = null;
        java.lang.String myequationB = null;
        java.lang.String myequationC = null;
        com.mastercoding.quadraticequationsolver.MyEquation myequation = mMyequation;

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


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

                    if (myequation != null) {
                        // read myequation::solveEquation
                        myequationSolveEquationAndroidViewViewOnClickListener = (((mMyequationSolveEquationAndroidViewViewOnClickListener == null) ? (mMyequationSolveEquationAndroidViewViewOnClickListener = new OnClickListenerImpl()) : mMyequationSolveEquationAndroidViewViewOnClickListener).setValue(myequation));
                    }
            }
            if ((dirtyFlags & 0x13L) != 0) {

                    if (myequation != null) {
                        // read myequation.a
                        myequationA = myequation.getA();
                    }
            }
            if ((dirtyFlags & 0x15L) != 0) {

                    if (myequation != null) {
                        // read myequation.b
                        myequationB = myequation.getB();
                    }
            }
            if ((dirtyFlags & 0x19L) != 0) {

                    if (myequation != null) {
                        // read myequation.c
                        myequationC = myequation.getC();
                    }
            }
        }
        // batch finished
        if ((dirtyFlags & 0x11L) != 0) {
            // api target 1

            this.button.setOnClickListener(myequationSolveEquationAndroidViewViewOnClickListener);
        }
        if ((dirtyFlags & 0x13L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.edit1, myequationA);
        }
        if ((dirtyFlags & 0x10L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.edit1, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, edit1androidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.edit2, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, edit2androidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.edit3, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, edit3androidTextAttrChanged);
        }
        if ((dirtyFlags & 0x15L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.edit2, myequationB);
        }
        if ((dirtyFlags & 0x19L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.edit3, myequationC);
        }
    }
    // Listener Stub Implementations
    public static class OnClickListenerImpl implements android.view.View.OnClickListener{
        private com.mastercoding.quadraticequationsolver.MyEquation value;
        public OnClickListenerImpl setValue(com.mastercoding.quadraticequationsolver.MyEquation value) {
            this.value = value;
            return value == null ? null : this;
        }
        @Override
        public void onClick(android.view.View arg0) {
            this.value.solveEquation(arg0); 
        }
    }
    // callback impls
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): myequation
        flag 1 (0x2L): myequation.a
        flag 2 (0x3L): myequation.b
        flag 3 (0x4L): myequation.c
        flag 4 (0x5L): null
    flag mapping end*/
    //end
}