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 FragmentLogin2BindingImpl extends FragmentLogin2Binding 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.top_constraint, 10);
        sViewsWithIds.put(R.id.organisation_icon, 11);
        sViewsWithIds.put(R.id.login_error_text, 12);
        sViewsWithIds.put(R.id.bottom_barrier, 13);
    }
    // views
    @NonNull
    private final androidx.core.widget.NestedScrollView mboundView0;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback136;
    @Nullable
    private final android.view.View.OnClickListener mCallback134;
    @Nullable
    private final android.view.View.OnClickListener mCallback135;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener personPasswordandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of password
            //         is com.toughra.ustadmobile.databinding.FragmentLogin2BindingImpl.this.setPassword(callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(personPassword);
            // localize variables for thread safety
            // password
            java.lang.String password = mPassword;


            if ((com.toughra.ustadmobile.databinding.FragmentLogin2BindingImpl.this) != (null)) {



                com.toughra.ustadmobile.databinding.FragmentLogin2BindingImpl.this.setPassword(callbackArg_0);
            }
        }
    };
    private androidx.databinding.InverseBindingListener personUsernameandroidTextAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of username
            //         is com.toughra.ustadmobile.databinding.FragmentLogin2BindingImpl.this.setUsername(callbackArg_0)
            java.lang.String callbackArg_0 = androidx.databinding.adapters.TextViewBindingAdapter.getTextString(personUsername);
            // localize variables for thread safety
            // username
            java.lang.String username = mUsername;


            if ((com.toughra.ustadmobile.databinding.FragmentLogin2BindingImpl.this) != (null)) {



                com.toughra.ustadmobile.databinding.FragmentLogin2BindingImpl.this.setUsername(callbackArg_0);
            }
        }
    };

    public FragmentLogin2BindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 14, sIncludes, sViewsWithIds));
    }
    private FragmentLogin2BindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (androidx.constraintlayout.widget.Barrier) bindings[13]
            , (com.google.android.material.button.MaterialButton) bindings[8]
            , (com.google.android.material.button.MaterialButton) bindings[7]
            , (com.google.android.material.button.MaterialButton) bindings[6]
            , (android.widget.TextView) bindings[12]
            , (android.widget.TextView) bindings[1]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[11]
            , (com.google.android.material.textfield.TextInputLayout) bindings[4]
            , (com.google.android.material.textfield.TextInputEditText) bindings[5]
            , (com.google.android.material.textfield.TextInputEditText) bindings[3]
            , (androidx.constraintlayout.widget.Barrier) bindings[10]
            , (com.google.android.material.textfield.TextInputLayout) bindings[2]
            , (android.widget.TextView) bindings[9]
            );
        this.connectAsGuest.setTag(null);
        this.createAccount.setTag(null);
        this.loginButton.setTag(null);
        this.loginIntentMessage.setTag(null);
        this.mboundView0 = (androidx.core.widget.NestedScrollView) bindings[0];
        this.mboundView0.setTag(null);
        this.passwordView.setTag(null);
        this.personPassword.setTag(null);
        this.personUsername.setTag(null);
        this.usernameView.setTag(null);
        this.versionInfoText.setTag(null);
        setRootTag(root);
        // listeners
        mCallback136 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 3);
        mCallback134 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        mCallback135 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x80L;
        }
        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.intentMessage == variableId) {
            setIntentMessage((java.lang.String) variable);
        }
        else if (BR.versionInfo == variableId) {
            setVersionInfo((java.lang.String) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.Login2Presenter) variable);
        }
        else if (BR.password == variableId) {
            setPassword((java.lang.String) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.buttonEnabled == variableId) {
            setButtonEnabled((boolean) variable);
        }
        else if (BR.username == variableId) {
            setUsername((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setIntentMessage(@Nullable java.lang.String IntentMessage) {
        this.mIntentMessage = IntentMessage;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.intentMessage);
        super.requestRebind();
    }
    public void setVersionInfo(@Nullable java.lang.String VersionInfo) {
        this.mVersionInfo = VersionInfo;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.versionInfo);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.Login2Presenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }
    public void setPassword(@Nullable java.lang.String Password) {
        this.mPassword = Password;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.password);
        super.requestRebind();
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.fieldsEnabled);
        super.requestRebind();
    }
    public void setButtonEnabled(boolean ButtonEnabled) {
        this.mButtonEnabled = ButtonEnabled;
        synchronized(this) {
            mDirtyFlags |= 0x20L;
        }
        notifyPropertyChanged(BR.buttonEnabled);
        super.requestRebind();
    }
    public void setUsername(@Nullable java.lang.String Username) {
        this.mUsername = Username;
        synchronized(this) {
            mDirtyFlags |= 0x40L;
        }
        notifyPropertyChanged(BR.username);
        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;
        }
        java.lang.String intentMessage = mIntentMessage;
        java.lang.String versionInfo = mVersionInfo;
        com.ustadmobile.core.controller.Login2Presenter presenter = mPresenter;
        java.lang.String password = mPassword;
        boolean fieldsEnabled = mFieldsEnabled;
        boolean buttonEnabled = mButtonEnabled;
        java.lang.String username = mUsername;

        if ((dirtyFlags & 0x81L) != 0) {
        }
        if ((dirtyFlags & 0x82L) != 0) {
        }
        if ((dirtyFlags & 0x88L) != 0) {
        }
        if ((dirtyFlags & 0x90L) != 0) {
        }
        if ((dirtyFlags & 0xa0L) != 0) {
        }
        if ((dirtyFlags & 0xc0L) != 0) {
        }
        // batch finished
        if ((dirtyFlags & 0x80L) != 0) {
            // api target 1

            this.connectAsGuest.setOnClickListener(mCallback136);
            this.createAccount.setOnClickListener(mCallback135);
            this.loginButton.setOnClickListener(mCallback134);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.personPassword, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, personPasswordandroidTextAttrChanged);
            androidx.databinding.adapters.TextViewBindingAdapter.setTextWatcher(this.personUsername, (androidx.databinding.adapters.TextViewBindingAdapter.BeforeTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.OnTextChanged)null, (androidx.databinding.adapters.TextViewBindingAdapter.AfterTextChanged)null, personUsernameandroidTextAttrChanged);
        }
        if ((dirtyFlags & 0xa0L) != 0) {
            // api target 1

            this.connectAsGuest.setEnabled(buttonEnabled);
            this.createAccount.setEnabled(buttonEnabled);
            this.loginButton.setEnabled(buttonEnabled);
        }
        if ((dirtyFlags & 0x81L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.loginIntentMessage, intentMessage);
        }
        if ((dirtyFlags & 0x90L) != 0) {
            // api target 1

            this.passwordView.setEnabled(fieldsEnabled);
            this.usernameView.setEnabled(fieldsEnabled);
        }
        if ((dirtyFlags & 0x88L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.personPassword, password);
        }
        if ((dirtyFlags & 0xc0L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.personUsername, username);
        }
        if ((dirtyFlags & 0x82L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.versionInfoText, versionInfo);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        switch(sourceId) {
            case 3: {
                // localize variables for thread safety
                // presenter != null
                boolean presenterJavaLangObjectNull = false;
                // presenter
                com.ustadmobile.core.controller.Login2Presenter presenter = mPresenter;



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


                    presenter.handleConnectAsGuest();
                }
                break;
            }
            case 1: {
                // localize variables for thread safety
                // password
                java.lang.String password = mPassword;
                // presenter != null
                boolean presenterJavaLangObjectNull = false;
                // presenter
                com.ustadmobile.core.controller.Login2Presenter presenter = mPresenter;
                // username
                java.lang.String username = mUsername;



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




                    presenter.handleLogin(username, password);
                }
                break;
            }
            case 2: {
                // localize variables for thread safety
                // presenter != null
                boolean presenterJavaLangObjectNull = false;
                // presenter
                com.ustadmobile.core.controller.Login2Presenter presenter = mPresenter;



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


                    presenter.handleCreateAccount();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): intentMessage
        flag 1 (0x2L): versionInfo
        flag 2 (0x3L): presenter
        flag 3 (0x4L): password
        flag 4 (0x5L): fieldsEnabled
        flag 5 (0x6L): buttonEnabled
        flag 6 (0x7L): username
        flag 7 (0x8L): null
    flag mapping end*/
    //end
}