package com.wisewoods.eduandroid.ui.adapter;

import com.wisewoods.base.base.BaseAdapter;
import com.wisewoods.base.base.BaseVH;
import com.wisewoods.base.bean.RoomState;
import com.wisewoods.eduandroid.R;

import org.jetbrains.annotations.NotNull;

public class HostelAdapter extends BaseAdapter<RoomState.StateBean> {
    public HostelAdapter() {
        super(R.layout.item_recycler_hostel);
    }

    @Override
    protected void convert(@NotNull BaseVH baseVH, RoomState.StateBean stateBean) {
        baseVH.setText(R.id.tv_status, stateBean.getStateString())
                .setTextColorRes(R.id.tv_status, stateBean.getState() ?
                        R.color.blue : R.color.gary999)
                .setBackgroundResource(R.id.tv_status, stateBean.getState() ?
                        R.drawable.shape_check_btn : R.drawable.shape_hostel)
                .setText(R.id.tv_name, stateBean.room_number + "")
        ;

    }
}
