|
|
@@ -1,59 +0,0 @@
|
|
|
-package kr.co.zumo.app.lifeplus.view.screen.event;
|
|
|
-
|
|
|
-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 java.util.List;
|
|
|
-
|
|
|
-import kr.co.zumo.app.R;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.api.EventBean;
|
|
|
-import kr.co.zumo.app.lifeplus.view.IEventListener;
|
|
|
-
|
|
|
-/**
|
|
|
- * EventListAdapter
|
|
|
- * <pre>
|
|
|
- * </pre>
|
|
|
- *
|
|
|
- * @author 하세미
|
|
|
- * @version 1.0
|
|
|
- * @history 하세미 [2019-01-03] [최초 작성]
|
|
|
- * @since 2019-01-03
|
|
|
- */
|
|
|
-public class EventListAdapter extends RecyclerView.Adapter<EventListViewHolder> {
|
|
|
-
|
|
|
- private LayoutInflater inflater;
|
|
|
- private IEventListener listener;
|
|
|
- private List<EventBean> eventBeans;
|
|
|
-
|
|
|
- public EventListAdapter(Context context, List<EventBean> eventBeans, IEventListener listener) {
|
|
|
- this.eventBeans = eventBeans;
|
|
|
- this.listener = listener;
|
|
|
- this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
- }
|
|
|
-
|
|
|
- @NonNull
|
|
|
- @Override
|
|
|
- public EventListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
|
- View view = inflater.inflate(R.layout.event_item_view, parent, false);
|
|
|
- return new EventListViewHolder(view);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onBindViewHolder(@NonNull EventListViewHolder holder, int position) {
|
|
|
-
|
|
|
- holder.init(eventBeans.get(holder.getAdapterPosition()), event -> {
|
|
|
- if (null != listener) {
|
|
|
- listener.onEvent(event);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public int getItemCount() {
|
|
|
- return eventBeans.size();
|
|
|
- }
|
|
|
-}
|