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 ItemStatementSessionDetailListBindingImpl extends ItemStatementSessionDetailListBinding implements com.toughra.ustadmobile.generated.callback.OnSelectionStateChangedListener.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.item_person_start_date_image, 10);
    }
    // views
    @NonNull
    private final androidx.constraintlayout.widget.ConstraintLayout mboundView0;
    // variables
    @Nullable
    private final com.ustadmobile.port.android.view.binding.OnSelectionStateChangedListener mCallback28;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ItemStatementSessionDetailListBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 11, sIncludes, sViewsWithIds));
    }
    private ItemStatementSessionDetailListBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 0
            , (android.widget.TextView) bindings[6]
            , (android.widget.TextView) bindings[3]
            , (android.widget.TextView) bindings[4]
            , (android.widget.TextView) bindings[8]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[7]
            , (android.widget.TextView) bindings[9]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[10]
            , (android.widget.TextView) bindings[5]
            , (androidx.appcompat.widget.AppCompatImageView) bindings[1]
            , (android.widget.TextView) bindings[2]
            );
        this.itemPersonDuration.setTag(null);
        this.itemPersonObjectDescription.setTag(null);
        this.itemPersonObjectQuestionAnswer.setTag(null);
        this.itemPersonProgress.setTag(null);
        this.itemPersonProgressImage.setTag(null);
        this.itemPersonScoreResults.setTag(null);
        this.itemPersonStartDateTime.setTag(null);
        this.itemPersonVerbImage.setTag(null);
        this.itemPersonVerbTitle.setTag(null);
        this.mboundView0 = (androidx.constraintlayout.widget.ConstraintLayout) bindings[0];
        this.mboundView0.setTag(null);
        setRootTag(root);
        // listeners
        mCallback28 = new com.toughra.ustadmobile.generated.callback.OnSelectionStateChangedListener(this, 1);
        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.statement == variableId) {
            setStatement((com.ustadmobile.lib.db.entities.StatementWithSessionDetailDisplay) variable);
        }
        else if (BR.presenter == variableId) {
            setPresenter((com.ustadmobile.core.controller.StatementListPresenter) variable);
        }
        else if (BR.selectablePagedListAdapter == variableId) {
            setSelectablePagedListAdapter((com.ustadmobile.port.android.view.StatementListViewFragment.StatementWithSessionsDetailListRecyclerAdapter) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setStatement(@Nullable com.ustadmobile.lib.db.entities.StatementWithSessionDetailDisplay Statement) {
        this.mStatement = Statement;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.statement);
        super.requestRebind();
    }
    public void setPresenter(@Nullable com.ustadmobile.core.controller.StatementListPresenter Presenter) {
        this.mPresenter = Presenter;
    }
    public void setSelectablePagedListAdapter(@Nullable com.ustadmobile.port.android.view.StatementListViewFragment.StatementWithSessionsDetailListRecyclerAdapter SelectablePagedListAdapter) {
        this.mSelectablePagedListAdapter = SelectablePagedListAdapter;
        synchronized(this) {
            mDirtyFlags |= 0x4L;
        }
        notifyPropertyChanged(BR.selectablePagedListAdapter);
        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 statementResultScoreMaxInt0ViewVISIBLEViewGONE = 0;
        boolean statementResultScoreMaxInt0 = false;
        long statementTimestamp = 0;
        com.ustadmobile.lib.db.entities.StatementWithSessionDetailDisplay statement = mStatement;
        java.lang.String javaLangStringStatementResultScoreRawJavaLangString = null;
        java.lang.String statementVerbDisplayJavaLangObjectNullStringsKtCapitalizeStatementVerbDisplayStatementVerbDisplay = null;
        java.lang.String javaLangStringStatementResultScoreRawJavaLangStringStatementResultScoreMaxJavaLangString = null;
        long statementStatementVerbUid = 0;
        com.ustadmobile.port.android.view.StatementListViewFragment.StatementWithSessionsDetailListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        int statementObjectDisplayJavaLangObjectNullViewVISIBLEViewGONE = 0;
        float statementResultScoreScaledInt100 = 0f;
        long statementResultScoreRaw = 0;
        long statementResultScoreMax = 0;
        java.lang.String statementObjectDisplay = null;
        boolean statementResultDurationInt1000 = false;
        boolean statementVerbDisplayJavaLangObjectNull = false;
        long statementResultDuration = 0;
        boolean statementObjectDisplayJavaLangObjectNull = false;
        float statementResultScoreScaled = 0f;
        java.lang.String stringsKtCapitalizeStatementVerbDisplay = null;
        java.lang.String statementVerbDisplay = null;
        java.lang.String itemPersonProgressAndroidStringPercentageScoreIntStatementResultScoreScaledInt100 = null;
        int intStatementResultScoreScaledInt100 = 0;
        java.lang.String javaLangStringStatementResultScoreRawJavaLangStringStatementResultScoreMax = null;
        int statementResultDurationInt1000ViewGONEViewVISIBLE = 0;
        int intStatementStatementVerbUid = 0;
        java.lang.String javaLangStringStatementResultScoreRaw = null;

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



                if (statement != null) {
                    // read statement.timestamp
                    statementTimestamp = statement.getTimestamp();
                    // read statement.statementVerbUid
                    statementStatementVerbUid = statement.getStatementVerbUid();
                    // read statement.resultScoreRaw
                    statementResultScoreRaw = statement.getResultScoreRaw();
                    // read statement.resultScoreMax
                    statementResultScoreMax = statement.getResultScoreMax();
                    // read statement.objectDisplay
                    statementObjectDisplay = statement.getObjectDisplay();
                    // read statement.resultDuration
                    statementResultDuration = statement.getResultDuration();
                    // read statement.resultScoreScaled
                    statementResultScoreScaled = statement.getResultScoreScaled();
                    // read statement.verbDisplay
                    statementVerbDisplay = statement.getVerbDisplay();
                }


                // read (int) statement.statementVerbUid
                intStatementStatementVerbUid = ((int) (statementStatementVerbUid));
                // read ("(") + (statement.resultScoreRaw)
                javaLangStringStatementResultScoreRaw = ("(") + (statementResultScoreRaw);
                // read statement.resultScoreMax > 0
                statementResultScoreMaxInt0 = (statementResultScoreMax) > (0);
                // read statement.objectDisplay != null
                statementObjectDisplayJavaLangObjectNull = (statementObjectDisplay) != (null);
                // read statement.resultDuration < 1000
                statementResultDurationInt1000 = (statementResultDuration) < (1000);
                // read (statement.resultScoreScaled) * (100)
                statementResultScoreScaledInt100 = (statementResultScoreScaled) * (100);
                // read statement.verbDisplay != null
                statementVerbDisplayJavaLangObjectNull = (statementVerbDisplay) != (null);
            if((dirtyFlags & 0x9L) != 0) {
                if(statementResultScoreMaxInt0) {
                        dirtyFlags |= 0x20L;
                }
                else {
                        dirtyFlags |= 0x10L;
                }
            }
            if((dirtyFlags & 0x9L) != 0) {
                if(statementObjectDisplayJavaLangObjectNull) {
                        dirtyFlags |= 0x200L;
                }
                else {
                        dirtyFlags |= 0x100L;
                }
            }
            if((dirtyFlags & 0x9L) != 0) {
                if(statementResultDurationInt1000) {
                        dirtyFlags |= 0x800L;
                }
                else {
                        dirtyFlags |= 0x400L;
                }
            }
            if((dirtyFlags & 0x9L) != 0) {
                if(statementVerbDisplayJavaLangObjectNull) {
                        dirtyFlags |= 0x80L;
                }
                else {
                        dirtyFlags |= 0x40L;
                }
            }


                // read (("(") + (statement.resultScoreRaw)) + ("/")
                javaLangStringStatementResultScoreRawJavaLangString = (javaLangStringStatementResultScoreRaw) + ("/");
                // read statement.resultScoreMax > 0 ? View.VISIBLE : View.GONE
                statementResultScoreMaxInt0ViewVISIBLEViewGONE = ((statementResultScoreMaxInt0) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
                // read statement.objectDisplay != null ? View.VISIBLE : View.GONE
                statementObjectDisplayJavaLangObjectNullViewVISIBLEViewGONE = ((statementObjectDisplayJavaLangObjectNull) ? (android.view.View.VISIBLE) : (android.view.View.GONE));
                // read statement.resultDuration < 1000 ? View.GONE : View.VISIBLE
                statementResultDurationInt1000ViewGONEViewVISIBLE = ((statementResultDurationInt1000) ? (android.view.View.GONE) : (android.view.View.VISIBLE));
                // read (int) (statement.resultScoreScaled) * (100)
                intStatementResultScoreScaledInt100 = ((int) (statementResultScoreScaledInt100));


                // read ((("(") + (statement.resultScoreRaw)) + ("/")) + (statement.resultScoreMax)
                javaLangStringStatementResultScoreRawJavaLangStringStatementResultScoreMax = (javaLangStringStatementResultScoreRawJavaLangString) + (statementResultScoreMax);
                // read @android:string/percentage_score
                itemPersonProgressAndroidStringPercentageScoreIntStatementResultScoreScaledInt100 = itemPersonProgress.getResources().getString(R.string.percentage_score, intStatementResultScoreScaledInt100);


                // read (((("(") + (statement.resultScoreRaw)) + ("/")) + (statement.resultScoreMax)) + (")")
                javaLangStringStatementResultScoreRawJavaLangStringStatementResultScoreMaxJavaLangString = (javaLangStringStatementResultScoreRawJavaLangStringStatementResultScoreMax) + (")");
        }
        if ((dirtyFlags & 0xcL) != 0) {
        }
        // batch finished

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

                // read StringsKt.capitalize(statement.verbDisplay)
                stringsKtCapitalizeStatementVerbDisplay = kotlin.text.StringsKt.capitalize(statementVerbDisplay);
        }

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

                // read statement.verbDisplay != null ? StringsKt.capitalize(statement.verbDisplay) : statement.verbDisplay
                statementVerbDisplayJavaLangObjectNullStringsKtCapitalizeStatementVerbDisplayStatementVerbDisplay = ((statementVerbDisplayJavaLangObjectNull) ? (stringsKtCapitalizeStatementVerbDisplay) : (statementVerbDisplay));
        }
        // batch finished
        if ((dirtyFlags & 0x9L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setDurationMinutesAndSeconds(this.itemPersonDuration, statementResultDuration);
            this.itemPersonDuration.setVisibility(statementResultDurationInt1000ViewGONEViewVISIBLE);
            this.itemPersonObjectDescription.setVisibility(statementObjectDisplayJavaLangObjectNullViewVISIBLEViewGONE);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonObjectDescription, statementObjectDisplay);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setStatementQuestionAnswer(this.itemPersonObjectQuestionAnswer, statement);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonProgress, itemPersonProgressAndroidStringPercentageScoreIntStatementResultScoreScaledInt100);
            this.itemPersonProgress.setVisibility(statementResultScoreMaxInt0ViewVISIBLEViewGONE);
            this.itemPersonProgressImage.setVisibility(statementResultScoreMaxInt0ViewVISIBLEViewGONE);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonScoreResults, javaLangStringStatementResultScoreRawJavaLangStringStatementResultScoreMaxJavaLangString);
            this.itemPersonScoreResults.setVisibility(statementResultScoreMaxInt0ViewVISIBLEViewGONE);
            com.ustadmobile.port.android.view.binding.TextViewBindingsKt.setShortDateTime(this.itemPersonStartDateTime, statementTimestamp);
            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupKey(this.itemPersonVerbImage, intStatementStatementVerbUid);
            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.itemPersonVerbTitle, statementVerbDisplayJavaLangObjectNullStringsKtCapitalizeStatementVerbDisplayStatementVerbDisplay);
        }
        if ((dirtyFlags & 0x8L) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ImageViewBindingsKt.setImageLookupMap(this.itemPersonVerbImage, com.ustadmobile.port.android.view.StatementListViewFragment.VERB_ICON_MAP, (java.lang.Integer)null);
        }
        if ((dirtyFlags & 0xcL) != 0) {
            // api target 1

            com.ustadmobile.port.android.view.binding.ViewBindingsKt.setSelectableViewHelper(this.mboundView0, selectablePagedListAdapter, (android.view.View.OnClickListener)null, mCallback28);
        }
    }
    // 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.StatementListViewFragment.StatementWithSessionsDetailListRecyclerAdapter selectablePagedListAdapter = mSelectablePagedListAdapter;
        // statement
        com.ustadmobile.lib.db.entities.StatementWithSessionDetailDisplay statement = mStatement;



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




            selectablePagedListAdapter.onItemSelectedChanged(callbackArg_0, statement);
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): statement
        flag 1 (0x2L): presenter
        flag 2 (0x3L): selectablePagedListAdapter
        flag 3 (0x4L): null
        flag 4 (0x5L): statement.resultScoreMax > 0 ? View.VISIBLE : View.GONE
        flag 5 (0x6L): statement.resultScoreMax > 0 ? View.VISIBLE : View.GONE
        flag 6 (0x7L): statement.verbDisplay != null ? StringsKt.capitalize(statement.verbDisplay) : statement.verbDisplay
        flag 7 (0x8L): statement.verbDisplay != null ? StringsKt.capitalize(statement.verbDisplay) : statement.verbDisplay
        flag 8 (0x9L): statement.objectDisplay != null ? View.VISIBLE : View.GONE
        flag 9 (0xaL): statement.objectDisplay != null ? View.VISIBLE : View.GONE
        flag 10 (0xbL): statement.resultDuration < 1000 ? View.GONE : View.VISIBLE
        flag 11 (0xcL): statement.resultDuration < 1000 ? View.GONE : View.VISIBLE
    flag mapping end*/
    //end
}