package com.phlx.anchorcollect.ui.setting;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.phlx.anchorcollect.ble.BluetoothEntity;

import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class BLEItem extends ItemViewModel<SettingVM> {

    public ObservableField<BluetoothEntity> entity = new ObservableField<>();

    public BLEItem(@NonNull SettingVM viewModel, BluetoothEntity entity) {
        super(viewModel);
        this.entity.set(entity);
    }

    //条目的点击事件
    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            viewModel.itemOnClick(entity.get());
        }
    });
}
