package com.phlx.anchorcollect.ui.fragment.list;

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

import com.phlx.anchorcollect.Configs;
import com.phlx.anchorcollect.entity.CardEntity;
import com.phlx.anchorcollect.ui.fragment.vm.CollectListVM;

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

public class CollectItem extends ItemViewModel<CollectListVM> {

    public ObservableField<String> content1 = new ObservableField<>("");
    public ObservableField<String> content2 = new ObservableField<>("");
    public ObservableField<String> content3 = new ObservableField<>("");
    public ObservableField<String> content4 = new ObservableField<>("");

    public CollectItem(@NonNull CollectListVM viewModel, String content1, String content2, String content3, String content4) {
        super(viewModel);

        this.content1.set(content1);
        this.content2.set(content2);
        this.content3.set(content3);
        this.content4.set(content4);
    }

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