package hanson.xyz.vpnhotspotmod.databinding;
import hanson.xyz.vpnhotspotmod.R;
import hanson.xyz.vpnhotspotmod.BR;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
@SuppressWarnings("unchecked")
public class ListitemRepeaterBindingImpl extends ListitemRepeaterBinding implements hanson.xyz.vpnhotspotmod.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 android.widget.LinearLayout mboundView0;
    @NonNull
    private final android.widget.LinearLayout mboundView1;
    @NonNull
    private final android.widget.TextView mboundView2;
    @NonNull
    private final com.google.android.material.materialswitch.MaterialSwitch mboundView4;
    @NonNull
    private final android.widget.LinearLayout mboundView5;
    // variables
    @Nullable
    private final android.view.View.OnClickListener mCallback1;
    @Nullable
    private final android.view.View.OnClickListener mCallback2;
    // values
    // listeners
    // Inverse Binding Event Handlers

    public ListitemRepeaterBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
        this(bindingComponent, root, mapBindings(bindingComponent, root, 6, sIncludes, sViewsWithIds));
    }
    private ListitemRepeaterBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
        super(bindingComponent, root, 1
            , (hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView) bindings[3]
            );
        this.addresses.setTag(null);
        this.mboundView0 = (android.widget.LinearLayout) bindings[0];
        this.mboundView0.setTag(null);
        this.mboundView1 = (android.widget.LinearLayout) bindings[1];
        this.mboundView1.setTag(null);
        this.mboundView2 = (android.widget.TextView) bindings[2];
        this.mboundView2.setTag(null);
        this.mboundView4 = (com.google.android.material.materialswitch.MaterialSwitch) bindings[4];
        this.mboundView4.setTag(null);
        this.mboundView5 = (android.widget.LinearLayout) bindings[5];
        this.mboundView5.setTag(null);
        setRootTag(root);
        // listeners
        mCallback1 = new hanson.xyz.vpnhotspotmod.generated.callback.OnClickListener(this, 1);
        mCallback2 = new hanson.xyz.vpnhotspotmod.generated.callback.OnClickListener(this, 2);
        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.data == variableId) {
            setData((hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data) variable);
        }
        else {
            variableSet = false;
        }
            return variableSet;
    }

    public void setData(@Nullable hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data Data) {
        updateRegistration(0, Data);
        this.mData = Data;
        synchronized(this) {
            mDirtyFlags |= 0x1L;
        }
        notifyPropertyChanged(BR.data);
        super.requestRebind();
    }

    @Override
    protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
        switch (localFieldId) {
            case 0 :
                return onChangeData((hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data) object, fieldId);
        }
        return false;
    }
    private boolean onChangeData(hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data Data, int fieldId) {
        if (fieldId == BR._all) {
            synchronized(this) {
                    mDirtyFlags |= 0x1L;
            }
            return true;
        }
        else if (fieldId == BR.title) {
            synchronized(this) {
                    mDirtyFlags |= 0x2L;
            }
            return true;
        }
        else if (fieldId == BR.addresses) {
            synchronized(this) {
                    mDirtyFlags |= 0x4L;
            }
            return true;
        }
        else if (fieldId == BR.serviceStarted) {
            synchronized(this) {
                    mDirtyFlags |= 0x8L;
            }
            return true;
        }
        else if (fieldId == BR.switchEnabled) {
            synchronized(this) {
                    mDirtyFlags |= 0x10L;
            }
            return true;
        }
        return false;
    }

    @Override
    protected void executeBindings() {
        long dirtyFlags = 0;
        synchronized(this) {
            dirtyFlags = mDirtyFlags;
            mDirtyFlags = 0;
        }
        java.lang.CharSequence dataTitle = null;
        boolean dataSwitchEnabled = false;
        boolean dataServiceStartedWifiP2pManagerHelperGetStartWpsJavaLangObjectNullBooleanFalse = false;
        boolean dataServiceStarted = false;
        hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data data = mData;
        java.lang.CharSequence dataAddresses = null;

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


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

                    if (data != null) {
                        // read data.title
                        dataTitle = data.getTitle();
                    }
            }
            if ((dirtyFlags & 0x31L) != 0) {

                    if (data != null) {
                        // read data.switchEnabled
                        dataSwitchEnabled = data.getSwitchEnabled();
                    }
            }
            if ((dirtyFlags & 0x29L) != 0) {

                    if (data != null) {
                        // read data.serviceStarted
                        dataServiceStarted = data.getServiceStarted();
                    }
                if((dirtyFlags & 0x29L) != 0) {
                    if(dataServiceStarted) {
                            dirtyFlags |= 0x80L;
                    }
                    else {
                            dirtyFlags |= 0x40L;
                    }
                }


                    // read data.serviceStarted ? WifiP2pManagerHelper.getStartWps() != null : false
                    dataServiceStartedWifiP2pManagerHelperGetStartWpsJavaLangObjectNullBooleanFalse = ((dataServiceStarted) ? ((hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.getStartWps()) != (null)) : (false));
            }
            if ((dirtyFlags & 0x25L) != 0) {

                    if (data != null) {
                        // read data.addresses
                        dataAddresses = data.getAddresses();
                    }
            }
        }
        // batch finished
        if ((dirtyFlags & 0x25L) != 0) {
            // api target 1

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

            this.mboundView1.setOnClickListener(mCallback1);
            this.mboundView5.setOnClickListener(mCallback2);
        }
        if ((dirtyFlags & 0x23L) != 0) {
            // api target 1

            androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView2, dataTitle);
        }
        if ((dirtyFlags & 0x29L) != 0) {
            // api target 1

            androidx.databinding.adapters.CompoundButtonBindingAdapter.setChecked(this.mboundView4, dataServiceStarted);
            hanson.xyz.vpnhotspotmod.util.UtilsKt.setVisibility(this.mboundView5, dataServiceStartedWifiP2pManagerHelperGetStartWpsJavaLangObjectNullBooleanFalse);
        }
        if ((dirtyFlags & 0x31L) != 0) {
            // api target 1

            this.mboundView4.setEnabled(dataSwitchEnabled);
        }
    }
    // Listener Stub Implementations
    // callback impls
    public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
        switch(sourceId) {
            case 1: {
                // localize variables for thread safety
                // data != null
                boolean dataJavaLangObjectNull = false;
                // data
                hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data data = mData;



                dataJavaLangObjectNull = (data) != (null);
                if (dataJavaLangObjectNull) {


                    data.toggle();
                }
                break;
            }
            case 2: {
                // localize variables for thread safety
                // data != null
                boolean dataJavaLangObjectNull = false;
                // data
                hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data data = mData;



                dataJavaLangObjectNull = (data) != (null);
                if (dataJavaLangObjectNull) {


                    data.wps();
                }
                break;
            }
        }
    }
    // dirty flag
    private  long mDirtyFlags = 0xffffffffffffffffL;
    /* flag mapping
        flag 0 (0x1L): data
        flag 1 (0x2L): data.title
        flag 2 (0x3L): data.addresses
        flag 3 (0x4L): data.serviceStarted
        flag 4 (0x5L): data.switchEnabled
        flag 5 (0x6L): null
        flag 6 (0x7L): data.serviceStarted ? WifiP2pManagerHelper.getStartWps() != null : false
        flag 7 (0x8L): data.serviceStarted ? WifiP2pManagerHelper.getStartWps() != null : false
    flag mapping end*/
    //end
}