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 ItemContentEntryDetailAttemptBindingImpl extends ItemContentEntryDetailAttemptBinding implements com.toughra.ustadmobile.generated.callback.OnSelectionStateChangedListener.Listener, 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 = null;
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    @Nullable
    private final com.ustadmobile.port.android.view.binding.OnSelectionStateChangedListener mCallback44;
    @Nullable
    private final android.view.View.OnClickListener mCallback45;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemContentEntryDetailAttemptBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 12, sIncludes, sViewsWithIds));
    }
    private ItemContentEntryDetailAttemptBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.TextView) bindings[11]
            , (android.widget.ImageView) bindings[10]
            , (android.widget.ProgressBar) bindings[7]
            , (android.widget.TextView) bindings[6]
            , (android.widget.ProgressBar) bindings[9]
            , (android.widget.TextView) bindings[8]
            , (android.widget.TextView) bindings[5]
            , (android.widget.TextView) bindings[3]
            , (android.widget.TextView) bindings[4]
            , (de.hdodenhof.circleimageview.CircleImageView) bindings[1]
            , (android.widget.TextView) bindings[2]
            );
        this.attemptPrivateComment.setTag(null);
        this.attemptPrivateCommentImage.setTag(null);
        this.attemptProgress.setTag(null);
        this.attemptProgressText.setTag(null);
        this.attemptScore.setTag(null);
        this.attemptScoreText.setTag(null);
        this.itemPersonDuration.setTag(null);
        this.itemPersonLine2Text.setTag(null);
        this.itemPersonLine3Text.setTag(null);
        this.itemPersonNewitemicon.setTag(null);
        this.itemPersonText.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        mCallback44 = new com.toughra.ustadmobile.generated.callback.OnSelectionStateChangedListener(this, 1);
        mCallback45 = new com.toughra.ustadmobile.generated.callback.OnClickListener(this, 2);
        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.listener == variableId) {
            setListener((com.ustadmobile.core.controller.AttemptListListener) variable);
        }
        else if (BR.selectablePagedListAdapter == variableId) {
            setSelectablePagedListAdapter((com.ustadmobile.port.android.view.ContentEntryDetailAttemptsListFragment.PersonWithStatementDisplayListRecyclerAdapter) variable);
        }
        else if (BR.person == variableId) {
            setPerson((com.ustadmobile.lib.db.entities.PersonWithAttemptsSummary) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setListener(@Nullable com.ustadmobile.core.controller.AttemptListListener Listener) {
        this.mListener = Listener;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.listener);
        super.requestRebind();
    }
    public void setSelectablePagedListAdapter(@Nullable com.ustadmobile.port.android.view.ContentEntryDetailAttemptsListFragment.PersonWithStatementDisplayListRecyclerAdapter SelectablePagedListAdapter) {
        this.mSelectablePagedListAdapter = SelectablePagedListAdapter;
        synchronized(this) {
            mDirtyFlags |= 0x2L;
        }
        notifyPropertyChanged(BR.selectablePagedListAdapter);
        super.requestRebind();
    }
    public void setPerson(@Nullable com.ustadmobile.lib.db.entities.PersonWithAttemptsSummary Person) {
        this.mPerson = Person;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.person);
        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;
        }
        int personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0ViewINVISIBLEViewVISIBLE = 0;
        java.lang.String attemptProgressTextAndroidStringPercentageCompletePersonScoreProgressProgress = null;
        int personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressResultMaxInt0ViewGONEViewVISIBLE = 0;
        int stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment = 0;
        int personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0ViewGONEViewVISIBLE = 0;
        com.ustadmobile.port.android.view.util.ForeignKeyAttachmentUriAdapter personDetailFragmentFOREIGNKEYADAPTERPERSON = null;
        int personDurationInt60000ViewGONEViewVISIBLE = 0;
        boolean personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressResultMaxInt0 = false;
        boolean personScoreProgressJavaLangObjectNull = false;
        com.ustadmobile.core.controller.AttemptListListener listener = mListener;
        long personEndDate = 0;
        long personPersonUid = 0;
        java.lang.String personLatestPrivateComment = null;
        java.lang.String personFirstNamesJavaLangStringPersonLastName = null;
        boolean personScoreProgressProgressInt0 = false;
        int personAttempts = 0;
        java.lang.String personFirstNamesJavaLangString = null;
        boolean personDurationInt60000 = false;
        boolean personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0 = false;
        boolean personScoreProgressResultMaxInt0 = false;
        com.ustadmobile.port.android.view.ContentEntryDetailAttemptsListFragment.PersonWithStatementDisplayListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        int personScoreProgressProgress = 0;
        java.lang.String itemPersonLine2TextAndroidPluralsNumberOfAttemptsPersonAttemptsPersonAttempts = null;
        long personStartDate = 0;
        java.lang.String personFirstNames = null;
        int personScoreProgressResultMax = 0;
        int contentEntryStatementScoreProgressExtKtCalculateScoreWithPenaltyPersonScoreProgress = 0;
        long personDuration = 0;
        com.ustadmobile.lib.db.entities.ContentEntryStatementScoreProgress personScoreProgress = null;
        java.lang.String attemptScoreTextAndroidStringPercentageScoreContentEntryStatementScoreProgressExtKtCalculateScoreWithPenaltyPersonScoreProgress = null;
        com.ustadmobile.lib.db.entities.PersonWithAttemptsSummary person = mPerson;
        java.lang.String personLastName = null;

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

                // read PersonDetailFragment.FOREIGNKEYADAPTER_PERSON
                personDetailFragmentFOREIGNKEYADAPTERPERSON = com.ustadmobile.port.android.view.PersonDetailFragment.getFOREIGNKEYADAPTER_PERSON();
        }
        if ((dirtyFlags & 0xaL) != 0) {
        }
        if ((dirtyFlags & 0xcL) != 0) {



                if (person != null) {
                    // read person.endDate
                    personEndDate = person.getEndDate();
                    // read person.personUid
                    personPersonUid = person.getPersonUid();
                    // read person.latestPrivateComment
                    personLatestPrivateComment = person.getLatestPrivateComment();
                    // read person.attempts
                    personAttempts = person.getAttempts();
                    // read person.startDate
                    personStartDate = person.getStartDate();
                    // read person.firstNames
                    personFirstNames = person.getFirstNames();
                    // read person.duration
                    personDuration = person.getDuration();
                    // read person.scoreProgress
                    personScoreProgress = person.getScoreProgress();
                    // read person.lastName
                    personLastName = person.getLastName();
                }


                // read StringExtKt.visibleIfNotNullOrEmpty(person.latestPrivateComment)
                stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment = com.ustadmobile.port.android.view.ext.StringExtKt.visibleIfNotNullOrEmpty(personLatestPrivateComment);
                // read @android:plurals/number_of_attempts
                itemPersonLine2TextAndroidPluralsNumberOfAttemptsPersonAttemptsPersonAttempts = itemPersonLine2Text.getResources().getQuantityString(R.plurals.number_of_attempts, personAttempts, personAttempts);
                // read @android:plurals/number_of_attempts
                itemPersonLine2TextAndroidPluralsNumberOfAttemptsPersonAttemptsPersonAttempts = itemPersonLine2Text.getResources().getQuantityString(R.plurals.number_of_attempts, personAttempts, personAttempts);
                // read (person.firstNames) + (" ")
                personFirstNamesJavaLangString = (personFirstNames) + (" ");
                // read person.duration < 60000
                personDurationInt60000 = (personDuration) < (60000);
                // read person.scoreProgress == null
                personScoreProgressJavaLangObjectNull = (personScoreProgress) == (null);
                // read ContentEntryStatementScoreProgressExtKt.calculateScoreWithPenalty(person.scoreProgress)
                contentEntryStatementScoreProgressExtKtCalculateScoreWithPenaltyPersonScoreProgress = com.ustadmobile.core.util.ext.ContentEntryStatementScoreProgressExtKt.calculateScoreWithPenalty(personScoreProgress);
            if((dirtyFlags & 0xcL) != 0) {
                if(personDurationInt60000) {
                        dirtyFlags |= 0x800L;
                }
                else {
                        dirtyFlags |= 0x400L;
                }
            }
            if((dirtyFlags & 0xcL) != 0) {
                if(personScoreProgressJavaLangObjectNull) {
                        dirtyFlags |= 0x2000L;
                        dirtyFlags |= 0x8000L;
                }
                else {
                        dirtyFlags |= 0x1000L;
                        dirtyFlags |= 0x4000L;
                }
            }
                if (personScoreProgress != null) {
                    // read person.scoreProgress.progress
                    personScoreProgressProgress = personScoreProgress.getProgress();
                }


                // read ((person.firstNames) + (" ")) + (person.lastName)
                personFirstNamesJavaLangStringPersonLastName = (personFirstNamesJavaLangString) + (personLastName);
                // read person.duration < 60000 ? View.GONE : View.VISIBLE
                personDurationInt60000ViewGONEViewVISIBLE = ((personDurationInt60000) ? (android.view.View.GONE) : (android.view.View.VISIBLE));
                // read @android:string/percentage_score
                attemptScoreTextAndroidStringPercentageScoreContentEntryStatementScoreProgressExtKtCalculateScoreWithPenaltyPersonScoreProgress = attemptScoreText.getResources().getString(R.string.percentage_score, contentEntryStatementScoreProgressExtKtCalculateScoreWithPenaltyPersonScoreProgress);
                // read @android:string/percentage_complete
                attemptProgressTextAndroidStringPercentageCompletePersonScoreProgressProgress = attemptProgressText.getResources().getString(R.string.percentage_complete, personScoreProgressProgress);
        }
        // batch finished

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

                // read person.scoreProgress.progress == 0
                personScoreProgressProgressInt0 = (personScoreProgressProgress) == (0);
        }
        if ((dirtyFlags & 0x1000L) != 0) {

                if (personScoreProgress != null) {
                    // read person.scoreProgress.resultMax
                    personScoreProgressResultMax = personScoreProgress.getResultMax();
                }


                // read person.scoreProgress.resultMax == 0
                personScoreProgressResultMaxInt0 = (personScoreProgressResultMax) == (0);
        }

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

                // read person.scoreProgress == null ? true : person.scoreProgress.resultMax == 0
                personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressResultMaxInt0 = ((personScoreProgressJavaLangObjectNull) ? (true) : (personScoreProgressResultMaxInt0));
                // read person.scoreProgress == null ? true : person.scoreProgress.progress == 0
                personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0 = ((personScoreProgressJavaLangObjectNull) ? (true) : (personScoreProgressProgressInt0));
            if((dirtyFlags & 0xcL) != 0) {
                if(personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressResultMaxInt0) {
                        dirtyFlags |= 0x80L;
                }
                else {
                        dirtyFlags |= 0x40L;
                }
            }
            if((dirtyFlags & 0xcL) != 0) {
                if(personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0) {
                        dirtyFlags |= 0x20L;
                        dirtyFlags |= 0x200L;
                }
                else {
                        dirtyFlags |= 0x10L;
                        dirtyFlags |= 0x100L;
                }
            }


                // read person.scoreProgress == null ? true : person.scoreProgress.resultMax == 0 ? View.GONE : View.VISIBLE
                personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressResultMaxInt0ViewGONEViewVISIBLE = ((personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressResultMaxInt0) ? (android.view.View.GONE) : (android.view.View.VISIBLE));
                // read person.scoreProgress == null ? true : person.scoreProgress.progress == 0 ? View.INVISIBLE : View.VISIBLE
                personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0ViewINVISIBLEViewVISIBLE = ((personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0) ? (android.view.View.INVISIBLE) : (android.view.View.VISIBLE));
                // read person.scoreProgress == null ? true : person.scoreProgress.progress == 0 ? View.GONE : View.VISIBLE
                personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0ViewGONEViewVISIBLE = ((personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0) ? (android.view.View.GONE) : (android.view.View.VISIBLE));
        }
        // batch finished
        if ((dirtyFlags & 0xcL) != 0) {
            // api target 1

            this.attemptPrivateComment.setVisibility(stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.attemptPrivateComment, personLatestPrivateComment);
            this.attemptPrivateCommentImage.setVisibility(stringExtKtVisibleIfNotNullOrEmptyPersonLatestPrivateComment);
            this.attemptProgress.setProgress(personScoreProgressProgress);
            this.attemptProgress.setVisibility(personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0ViewGONEViewVISIBLE);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.attemptProgressText, attemptProgressTextAndroidStringPercentageCompletePersonScoreProgressProgress);
            this.attemptProgressText.setVisibility(personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressProgressInt0ViewINVISIBLEViewVISIBLE);
            this.attemptScore.setVisibility(personScoreProgressJavaLangObjectNullBooleanTruePersonScoreProgressResultMaxInt0ViewGONEViewVISIBLE);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setScoreVisibility(this.attemptScore, personScoreProgress);
            com.ustadmobile.port.android.view.binding.ProgressBarBindingsKt.setScoreProgress(this.attemptScore, personScoreProgress);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.attemptScoreText, attemptScoreTextAndroidStringPercentageScoreContentEntryStatementScoreProgressExtKtCalculateScoreWithPenaltyPersonScoreProgress);
            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setScoreVisibility(this.attemptScoreText, personScoreProgress);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setDurationHoursAndMinutes(this.itemPersonDuration, personDuration);
            this.itemPersonDuration.setVisibility(personDurationInt60000ViewGONEViewVISIBLE);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonLine2Text, itemPersonLine2TextAndroidPluralsNumberOfAttemptsPersonAttemptsPersonAttempts);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setStatementDate(this.itemPersonLine3Text, personStartDate, personEndDate);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKey(this.itemPersonNewitemicon, personPersonUid, (java.lang.String)null);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonText, personFirstNamesJavaLangStringPersonLastName);
        }
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageForeignKeyAdapter(this.itemPersonNewitemicon, personDetailFragmentFOREIGNKEYADAPTERPERSON);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.imageForeignKeyPlaceholder(this.itemPersonNewitemicon, androidx.appcompat.content.res.AppCompatResources.getDrawable(itemPersonNewitemicon.getContext(), R.drawable.ic_account_circle_black_24dp));
        }
        if ((dirtyFlags & 0xaL) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setSelectableViewHelper(this.mboundView0, selectablePagedListAdapter, mCallback45, mCallback44);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnSelectionStateChanged(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // selectablePagedListAdapter != null
        boolean selectablePagedListAdapterJavaLangObjectNull = false;
        // selectablePagedListAdapter
        com.ustadmobile.port.android.view.ContentEntryDetailAttemptsListFragment.PersonWithStatementDisplayListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        // person
        com.ustadmobile.lib.db.entities.PersonWithAttemptsSummary person = mPerson;



        selectablePagedListAdapterJavaLangObjectNull = (selectablePagedListAdapter) != (null);
        if (selectablePagedListAdapterJavaLangObjectNull) {




            selectablePagedListAdapter.onItemSelectedChanged(callbackArg_0, person);
        }
    }
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        // localize variables for thread safety
        // person
        com.ustadmobile.lib.db.entities.PersonWithAttemptsSummary person = mPerson;
        // listener != null
        boolean listenerJavaLangObjectNull = false;
        // listener
        com.ustadmobile.core.controller.AttemptListListener listener = mListener;



        listenerJavaLangObjectNull = (listener) != (null);
        if (listenerJavaLangObjectNull) {



            listener.onClickPersonWithStatementDisplay(person);
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): listener
        flag 1 (0x2L): selectablePagedListAdapter
        flag 2 (0x3L): person
        flag 3 (0x4L): null
        flag 4 (0x5L): person.scoreProgress == null ? true : person.scoreProgress.progress == 0 ? View.INVISIBLE : View.VISIBLE
        flag 5 (0x6L): person.scoreProgress == null ? true : person.scoreProgress.progress == 0 ? View.INVISIBLE : View.VISIBLE
        flag 6 (0x7L): person.scoreProgress == null ? true : person.scoreProgress.resultMax == 0 ? View.GONE : View.VISIBLE
        flag 7 (0x8L): person.scoreProgress == null ? true : person.scoreProgress.resultMax == 0 ? View.GONE : View.VISIBLE
        flag 8 (0x9L): person.scoreProgress == null ? true : person.scoreProgress.progress == 0 ? View.GONE : View.VISIBLE
        flag 9 (0xaL): person.scoreProgress == null ? true : person.scoreProgress.progress == 0 ? View.GONE : View.VISIBLE
        flag 10 (0xbL): person.duration < 60000 ? View.GONE : View.VISIBLE
        flag 11 (0xcL): person.duration < 60000 ? View.GONE : View.VISIBLE
        flag 12 (0xdL): person.scoreProgress == null ? true : person.scoreProgress.resultMax == 0
        flag 13 (0xeL): person.scoreProgress == null ? true : person.scoreProgress.resultMax == 0
        flag 14 (0xfL): person.scoreProgress == null ? true : person.scoreProgress.progress == 0
        flag 15 (0x10L): person.scoreProgress == null ? true : person.scoreProgress.progress == 0
    flag mapping end*/
    //end
}