CourseRecAdapter.java 1.2 KB
package com.hh.xuetubao.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hh.xuetubao.R;

import java.util.List;

public class CourseRecAdapter extends RecyclerView.Adapter<CourseRecAdapter.ViewHolder>{
    private List<String> mLists;
    private Context mContext;

    public CourseRecAdapter(List<String> list, Context context) {
        mLists = list;
        mContext = context;
    }

    @NonNull
    @Override
    public CourseRecAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.rv_home, null);
        ViewHolder holder = new ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(@NonNull CourseRecAdapter.ViewHolder viewHolder, int i) {

    }

    @Override
    public int getItemCount() {
        return mLists.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        public ViewHolder(@NonNull View itemView) {
            super(itemView);
        }
    }
}