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 FragmentRegisterMinorWaitForParentBindingImpl extends FragmentRegisterMinorWaitForParentBinding 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.username_image_view, 6);
        sViewsWithIds.put(R.id.username_label, 7);
        sViewsWithIds.put(R.id.password_icon_image, 8);
        sViewsWithIds.put(R.id.password_label, 9);
    }
    // views
    @NonNull
    private final androidx.core.widget.NestedScrollView mboundView0;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback159;
    @Nullable
    private final android.view.View.OnClickListener mCallback158;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public FragmentRegisterMinorWaitForParentBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 10, sIncludes, sViewsWithIds));
    }
    private FragmentRegisterMinorWaitForParentBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.TextView) bindings[4]
            , (com.google.android.material.button.MaterialButton) bindings[5]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[8]
            , (android.widget.TextView) bindings[9]
            , (android.widget.TextView) bindings[2]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[3]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[6]
            , (android.widget.TextView) bindings[7]
            , (android.widget.TextView) bindings[1]
            );
        this.instructionsText.setTag(null);
        this.mboundView0 = (androidx.core.widget.NestedScrollView) bindings[0];
        this.mboundView0.setTag(null);
        this.okButton.setTag(null);
        this.passwordText.setTag(null);
        this.passwordToggle.setTag(null);
        this.usernameText.setTag(null);
        setRootTag(root);
        // listeners
        mCallback159 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback158 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x20L;
        }
        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.password == variableId) {
            setPassword((java.lang.String) variable);
        }
        else if (BR.username == variableId) {
            setUsername((java.lang.String) variable);
        }
        else if (BR.passwordVisible == variableId) {
            setPasswordVisible((boolean) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.RegisterMinorWaitForParentPresenter) variable);
        }
        else if (BR.parentContact == variableId) {
            setParentContact((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setPassword(@Nullable java.lang.String Password) {
        this.mPassword = Password;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.password);
        super.requestRebind();
    }
    public void setUsername(@Nullable java.lang.String Username) {
        this.mUsername = Username;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.username);
        super.requestRebind();
    }
    public void setPasswordVisible(boolean PasswordVisible) {
        this.mPasswordVisible = PasswordVisible;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.passwordVisible);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.RegisterMinorWaitForParentPresenter Presenter) {
        this.mPresenter = Presenter;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.presenter);
        super.requestRebind();
    }
    public void setParentContact(@Nullable java.lang.String ParentContact) {
        this.mParentContact = ParentContact;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.parentContact);
        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 password = mPassword;
        java.lang.String passwordVisiblePasswordJavaLangString = null;
        java.lang.String username = mUsername;
        boolean passwordVisible = mPasswordVisible;
        com.ustadmobile.core.controller.RegisterMinorWaitForParentPresenter presenter = mPresenter;
        java.lang.String instructionsTextAndroidStringWeSentAMessageToYourParentParentContact = null;
        java.lang.String parentContact = mParentContact;

        if ((dirtyFlags & 0x22L) != 0) {
        }
        if ((dirtyFlags & 0x25L) != 0) {

            if((dirtyFlags & 0x25L) != 0) {
                if(passwordVisible) {
                        dirtyFlags |= 0x80L;
                }
                else {
                        dirtyFlags |= 0x40L;
                }
            }
        }
        if ((dirtyFlags & 0x30L) != 0) {



                // read @android:string/we_sent_a_message_to_your_parent
                instructionsTextAndroidStringWeSentAMessageToYourParentParentContact = instructionsText.getResources().getString(R.string.we_sent_a_message_to_your_parent, parentContact);
        }
        // batch finished

        if ((dirtyFlags & 0x80L) != 0) {
        }

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

                // read passwordVisible ? password : "*****"
                passwordVisiblePasswordJavaLangString = ((passwordVisible) ? (password) : ("*****"));
        }
        // batch finished
        if ((dirtyFlags & 0x30L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.instructionsText, instructionsTextAndroidStringWeSentAMessageToYourParentParentContact);
        }
        if ((dirtyFlags & 0x20L) != 0) {
            // api target 1

            this.okButton.setOnClickListener(mCallback159);
            this.passwordToggle.setOnClickListener(mCallback158);
        }
        if ((dirtyFlags & 0x25L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.passwordText, passwordVisiblePasswordJavaLangString);
        }
        if ((dirtyFlags & 0x22L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.usernameText, username);
        }
    }
    // 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
                // presenter != null
                boolean presenterJavaLangObjectNull = false;
                // presenter
                com.ustadmobile.core.controller.RegisterMinorWaitForParentPresenter presenter = mPresenter;



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


                    presenter.handleClickOk();
                }
                break;
            }
            case 1: {
                // localize variables for thread safety
                // presenter != null
                boolean presenterJavaLangObjectNull = false;
                // presenter
                com.ustadmobile.core.controller.RegisterMinorWaitForParentPresenter presenter = mPresenter;



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


                    presenter.handleClickTogglePasswordVisibility();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): password
        flag 1 (0x2L): username
        flag 2 (0x3L): passwordVisible
        flag 3 (0x4L): presenter
        flag 4 (0x5L): parentContact
        flag 5 (0x6L): null
        flag 6 (0x7L): passwordVisible ? password : "*****"
        flag 7 (0x8L): passwordVisible ? password : "*****"
    flag mapping end*/
    //end
}