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 FragmentParentalConsentManagementBindingImpl extends FragmentParentalConsentManagementBinding 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.fragment_parent_account_landing_edit_clx, 8);
        sViewsWithIds.put(R.id.parentaccount_top_barrier, 9);
        sViewsWithIds.put(R.id.terms_and_policies_header, 10);
        sViewsWithIds.put(R.id.parentaccount_bottom_barrier, 11);
    }
    // views
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback128;
    @Nullable
    private final android.view.View.OnClickListener mCallback129;
    @Nullable
    private final android.view.View.OnClickListener mCallback127;
    // values
    // listeners
    // Inverse Binding Event Handlers
    private androidx.databinding.InverseBindingListener relationshipValueselectedMessageIdOptionAttrChanged = new androidx.databinding.InverseBindingListener() {
        @Override
        public void onChange() {
            // Inverse of personParentJoin.ppjRelationship
            //         is personParentJoin.setPpjRelationship((int) callbackArg_0)
            int callbackArg_0 = com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.getSelectedMessageIdOption(relationshipValue);
            // localize variables for thread safety
            // personParentJoin != null
            boolean personParentJoinJavaLangObjectNull = false;
            // personParentJoin
            com.ustadmobile.lib.db.entities.PersonParentJoinWithMinorPerson personParentJoin = mPersonParentJoin;
            // personParentJoin.ppjRelationship
            int personParentJoinPpjRelationship = 0;



            personParentJoinJavaLangObjectNull = (personParentJoin) != (null);
            if (personParentJoinJavaLangObjectNull) {




                personParentJoin.setPpjRelationship(((int) (callbackArg_0)));
            }
        }
    };

    public FragmentParentalConsentManagementBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 12, sIncludes, sViewsWithIds));
    }
    private FragmentParentalConsentManagementBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (com.google.android.material.button.MaterialButton) bindings[7]
            , (com.google.android.material.button.MaterialButton) bindings[5]
            , (com.google.android.material.button.MaterialButton) bindings[6]
            , (androidx.constraintlayout.widget.ConstraintLayout) bindings[8]
            , (androidx.core.widget.NestedScrollView) bindings[0]
            , (android.widget.TextView) bindings[1]
            , (androidx.constraintlayout.widget.Barrier) bindings[11]
            , (androidx.constraintlayout.widget.Barrier) bindings[9]
            , (com.google.android.material.textfield.TextInputLayout) bindings[2]
            , (com.ustadmobile.port.android.view.IdOptionAutoCompleteTextView) bindings[3]
            , (android.widget.TextView) bindings[10]
            , (android.webkit.WebView) bindings[4]
            );
        this.changeConsentButton.setTag(null);
        this.consentButton.setTag(null);
        this.dontConsentButton.setTag(null);
        this.fragmentParentAccountLandingEditScroll.setTag(null);
        this.infoTextView.setTag(null);
        this.relationshipTextinputlayout.setTag(null);
        this.relationshipValue.setTag(null);
        this.termsWebview.setTag(null);
        setRootTag(root);
        // listeners
        mCallback128 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        mCallback129 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 3);
        mCallback127 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 1);
        invalidateAll();
    }

    @Override
    public void invalidateAll() {
        synchronized(this) {
                mDirtyFlags = 0x100L;
        }
        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.loading == variableId) {
            setLoading((boolean) variable);
        }
        else if (BR.fieldsEnabled == variableId) {
            setFieldsEnabled((boolean) variable);
        }
        else if (BR.personParentJoin == variableId) {
            setPersonParentJoin((com.ustadmobile.lib.db.entities.PersonParentJoinWithMinorPerson) variable);
        }
        else if (BR.siteTerms == variableId) {
            setSiteTerms((com.ustadmobile.lib.db.entities.SiteTerms) variable);
        }
        else if (BR.eventHandler == variableId) {
            setEventHandler((com.ustadmobile.port.android.view.ParentAccountLandingFragmentEventHandler) variable);
        }
        else if (BR.infoText == variableId) {
            setInfoText((java.lang.String) variable);
        }
        else if (BR.relationshipFieldOptions == variableId) {
            setRelationshipFieldOptions((java.util.List<com.ustadmobile.core.util.IdOption>) variable);
        }
        else if (BR.relationshipFieldError == variableId) {
            setRelationshipFieldError((java.lang.String) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setLoading(boolean Loading) {
        this.mLoading = Loading;
    }
    public void setFieldsEnabled(boolean FieldsEnabled) {
        this.mFieldsEnabled = FieldsEnabled;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.fieldsEnabled);
        super.requestRebind();
    }
    public void setPersonParentJoin(@Nullable com.ustadmobile.lib.db.entities.PersonParentJoinWithMinorPerson PersonParentJoin) {
        this.mPersonParentJoin = PersonParentJoin;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.personParentJoin);
        super.requestRebind();
    }
    public void setSiteTerms(@Nullable com.ustadmobile.lib.db.entities.SiteTerms SiteTerms) {
        this.mSiteTerms = SiteTerms;
        synchronized(this) {
            mDirtyFlags |= 0x8L;
        }
        notifyPropertyChanged(BR.siteTerms);
        super.requestRebind();
    }
    public void setEventHandler(@Nullable com.ustadmobile.port.android.view.ParentAccountLandingFragmentEventHandler EventHandler) {
        this.mEventHandler = EventHandler;
        synchronized(this) {
            mDirtyFlags |= 0x10L;
        }
        notifyPropertyChanged(BR.eventHandler);
        super.requestRebind();
    }
    public void setInfoText(@Nullable java.lang.String InfoText) {
        this.mInfoText = InfoText;
        synchronized(this) {
            mDirtyFlags |= 0x20L;
        }
        notifyPropertyChanged(BR.infoText);
        super.requestRebind();
    }
    public void setRelationshipFieldOptions(@Nullable java.util.List<com.ustadmobile.core.util.IdOption> RelationshipFieldOptions) {
        this.mRelationshipFieldOptions = RelationshipFieldOptions;
        synchronized(this) {
            mDirtyFlags |= 0x40L;
        }
        notifyPropertyChanged(BR.relationshipFieldOptions);
        super.requestRebind();
    }
    public void setRelationshipFieldError(@Nullable java.lang.String RelationshipFieldError) {
        this.mRelationshipFieldError = RelationshipFieldError;
        synchronized(this) {
            mDirtyFlags |= 0x80L;
        }
        notifyPropertyChanged(BR.relationshipFieldError);
        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;
        }
        long personParentJoinPpjParentPersonUid = 0;
        boolean personParentJoinPpjStatusPersonParentJoinSTATUSAPPROVED = false;
        boolean fieldsEnabled = mFieldsEnabled;
        int personParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE = 0;
        boolean personParentJoinPpjParentPersonUidInt0 = false;
        int personParentJoinPpjStatus = 0;
        java.lang.String siteTermsTermsHtml = null;
        int PersonParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE1 = 0;
        java.lang.String personParentJoinPpjStatusPersonParentJoinSTATUSAPPROVEDChangeConsentButtonAndroidStringRevokeConsentChangeConsentButtonAndroidStringRestoreConsent = null;
        com.ustadmobile.lib.db.entities.PersonParentJoinWithMinorPerson personParentJoin = mPersonParentJoin;
        com.ustadmobile.lib.db.entities.SiteTerms siteTerms = mSiteTerms;
        boolean relationshipFieldErrorJavaLangObjectNull = false;
        com.ustadmobile.port.android.view.ParentAccountLandingFragmentEventHandler eventHandler = mEventHandler;
        int personParentJoinPpjRelationship = 0;
        java.lang.String infoText = mInfoText;
        java.util.List<com.ustadmobile.core.util.IdOption> relationshipFieldOptions = mRelationshipFieldOptions;
        boolean PersonParentJoinPpjParentPersonUidInt01 = false;
        java.lang.String relationshipFieldError = mRelationshipFieldError;

        if ((dirtyFlags & 0x102L) != 0) {
        }
        if ((dirtyFlags & 0x144L) != 0) {


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

                    if (personParentJoin != null) {
                        // read personParentJoin.ppjParentPersonUid
                        personParentJoinPpjParentPersonUid = personParentJoin.getPpjParentPersonUid();
                        // read personParentJoin.ppjStatus
                        personParentJoinPpjStatus = personParentJoin.getPpjStatus();
                    }


                    // read personParentJoin.ppjParentPersonUid != 0
                    personParentJoinPpjParentPersonUidInt0 = (personParentJoinPpjParentPersonUid) != (0);
                    // read personParentJoin.ppjParentPersonUid == 0
                    PersonParentJoinPpjParentPersonUidInt01 = (personParentJoinPpjParentPersonUid) == (0);
                    // read personParentJoin.ppjStatus == PersonParentJoin.STATUS_APPROVED
                    personParentJoinPpjStatusPersonParentJoinSTATUSAPPROVED = (personParentJoinPpjStatus) == (com.ustadmobile.lib.db.entities.PersonParentJoin.STATUS_APPROVED);
                if((dirtyFlags & 0x104L) != 0) {
                    if(personParentJoinPpjParentPersonUidInt0) {
                            dirtyFlags |= 0x400L;
                    }
                    else {
                            dirtyFlags |= 0x200L;
                    }
                }
                if((dirtyFlags & 0x104L) != 0) {
                    if(PersonParentJoinPpjParentPersonUidInt01) {
                            dirtyFlags |= 0x1000L;
                    }
                    else {
                            dirtyFlags |= 0x800L;
                    }
                }
                if((dirtyFlags & 0x104L) != 0) {
                    if(personParentJoinPpjStatusPersonParentJoinSTATUSAPPROVED) {
                            dirtyFlags |= 0x4000L;
                    }
                    else {
                            dirtyFlags |= 0x2000L;
                    }
                }


                    // read personParentJoin.ppjParentPersonUid != 0 ? View.VISIBLE : View.GONE
                    personParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE = ((personParentJoinPpjParentPersonUidInt0) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
                    // read personParentJoin.ppjParentPersonUid == 0 ? View.VISIBLE : View.GONE
                    PersonParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE1 = ((PersonParentJoinPpjParentPersonUidInt01) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
                    // read personParentJoin.ppjStatus == PersonParentJoin.STATUS_APPROVED ? @android:string/revoke_consent : @android:string/restore_consent
                    personParentJoinPpjStatusPersonParentJoinSTATUSAPPROVEDChangeConsentButtonAndroidStringRevokeConsentChangeConsentButtonAndroidStringRestoreConsent = ((personParentJoinPpjStatusPersonParentJoinSTATUSAPPROVED) ? (changeConsentButton.getResources().getString(R.string.revoke_consent)) : (changeConsentButton.getResources().getString(R.string.restore_consent)));
            }

                if (personParentJoin != null) {
                    // read personParentJoin.ppjRelationship
                    personParentJoinPpjRelationship = personParentJoin.getPpjRelationship();
                }
        }
        if ((dirtyFlags & 0x108L) != 0) {



                if (siteTerms != null) {
                    // read siteTerms.termsHtml
                    siteTermsTermsHtml = siteTerms.getTermsHtml();
                }
        }
        if ((dirtyFlags & 0x120L) != 0) {
        }
        if ((dirtyFlags & 0x180L) != 0) {



                // read relationshipFieldError != null
                relationshipFieldErrorJavaLangObjectNull = (relationshipFieldError) != (null);
        }
        // batch finished
        if ((dirtyFlags & 0x104L) != 0) {
            // api target 1

            this.changeConsentButton.setVisibility(personParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.changeConsentButton, personParentJoinPpjStatusPersonParentJoinSTATUSAPPROVEDChangeConsentButtonAndroidStringRevokeConsentChangeConsentButtonAndroidStringRestoreConsent);
            this.consentButton.setVisibility(PersonParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE1);
            this.dontConsentButton.setVisibility(PersonParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE1);
            this.relationshipTextinputlayout.setVisibility(PersonParentJoinPpjParentPersonUidInt0ViewVISIBLEViewGONE1);
        }
        if ((dirtyFlags & 0x100L) != 0) {
            // api target 1

            this.changeConsentButton.setOnClickListener(mCallback129);
            this.consentButton.setOnClickListener(mCallback127);
            this.dontConsentButton.setOnClickListener(mCallback128);
            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setSelectedMessageIdListener(this.relationshipValue, relationshipValueselectedMessageIdOptionAttrChanged);
        }
        if ((dirtyFlags & 0x102L) != 0) {
            // api target 1

            this.changeConsentButton.setEnabled(fieldsEnabled);
            this.consentButton.setEnabled(fieldsEnabled);
            this.dontConsentButton.setEnabled(fieldsEnabled);
            this.relationshipTextinputlayout.setEnabled(fieldsEnabled);
            this.relationshipValue.setEnabled(fieldsEnabled);
        }
        if ((dirtyFlags & 0x120L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.infoTextView, infoText);
        }
        if ((dirtyFlags & 0x180L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextInputLayoutBindingsKt.setErrorText(this.relationshipTextinputlayout, relationshipFieldError);
            this.relationshipTextinputlayout.setErrorEnabled(relationshipFieldErrorJavaLangObjectNull);
        }
        if ((dirtyFlags & 0x144L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.MessageIdAutoCompleteTextViewBindingsKt.setMessageIdOptions(this.relationshipValue, relationshipFieldOptions, personParentJoinPpjRelationship);
        }
        if ((dirtyFlags & 0x108L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.WebViewBindingKt.loadHtmlData(this.termsWebview, siteTermsTermsHtml);
        }
    }
    // 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
                // eventHandler
                com.ustadmobile.port.android.view.ParentAccountLandingFragmentEventHandler eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;



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


                    eventHandler.onClickDoNotConsent();
                }
                break;
            }
            case 3: {
                // localize variables for thread safety
                // eventHandler
                com.ustadmobile.port.android.view.ParentAccountLandingFragmentEventHandler eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;



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


                    eventHandler.onClickChangeConsent();
                }
                break;
            }
            case 1: {
                // localize variables for thread safety
                // eventHandler
                com.ustadmobile.port.android.view.ParentAccountLandingFragmentEventHandler eventHandler = mEventHandler;
                // eventHandler != null
                boolean eventHandlerJavaLangObjectNull = false;



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


                    eventHandler.onClickConsent();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): loading
        flag 1 (0x2L): fieldsEnabled
        flag 2 (0x3L): personParentJoin
        flag 3 (0x4L): siteTerms
        flag 4 (0x5L): eventHandler
        flag 5 (0x6L): infoText
        flag 6 (0x7L): relationshipFieldOptions
        flag 7 (0x8L): relationshipFieldError
        flag 8 (0x9L): null
        flag 9 (0xaL): personParentJoin.ppjParentPersonUid != 0 ? View.VISIBLE : View.GONE
        flag 10 (0xbL): personParentJoin.ppjParentPersonUid != 0 ? View.VISIBLE : View.GONE
        flag 11 (0xcL): personParentJoin.ppjParentPersonUid == 0 ? View.VISIBLE : View.GONE
        flag 12 (0xdL): personParentJoin.ppjParentPersonUid == 0 ? View.VISIBLE : View.GONE
        flag 13 (0xeL): personParentJoin.ppjStatus == PersonParentJoin.STATUS_APPROVED ? @android:string/revoke_consent : @android:string/restore_consent
        flag 14 (0xfL): personParentJoin.ppjStatus == PersonParentJoin.STATUS_APPROVED ? @android:string/revoke_consent : @android:string/restore_consent
    flag mapping end*/
    //end
}