package com.unis.sxzcl.widget.banner;

import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.unis.sxzcl.R;
import com.youth.banner.adapter.BannerAdapter;
import com.youth.banner.util.BannerUtils;

import java.util.List;


/**
 *
 * 包名: com.unis.sxzcl.widget.banner
 * 类名: TopLineAdapter
 * 作用描述: 纵向轮播适配器
 * 创建人: mQ
 * 创建时间: 2020/11/30 21:01
 * 更新人:
 * 更新时间: 2020/11/30 21:01
 * 更新说明:
 * 版本号: 1.0
 */
public class TopLineAdapter extends BannerAdapter<String, TopLineAdapter.TopLineHolder> {

    public TopLineAdapter(List<String> mDatas) {
        super(mDatas);
    }

    @Override
    public TopLineHolder onCreateHolder(ViewGroup parent, int viewType) {
        return new TopLineHolder(BannerUtils.getView(parent, R.layout.item_notice_banner));
    }

    @Override
    public void onBindView(TopLineHolder holder, String data, int position, int size) {
//        holder.message.setText(data.title);
//        if (data.viewType==1) {
//            holder.source.setText("1号店");
//        }else if (data.viewType==2) {
//            holder.source.setText("淘宝头条");
//        }else if (data.viewType==3) {
//            holder.source.setText("京东快报");
//        }
    }

    class TopLineHolder extends RecyclerView.ViewHolder {
//        public TextView message;
//////        public TextView source;

        public TopLineHolder(@NonNull View view) {
            super(view);
//            message=view.findViewById(R.id.message);
//            source=view.findViewById(R.id.source);
        }
    }
}
