Added Android code
[wl-app.git] / Android / app / src / main / java / com / moiseum / wolnelektury / components / recycler / ViewHolder.java
1 package com.moiseum.wolnelektury.components.recycler;
2
3 import android.content.Context;
4 import android.support.v7.widget.RecyclerView;
5 import android.view.View;
6
7 import butterknife.ButterKnife;
8
9 public abstract class ViewHolder<T> extends RecyclerView.ViewHolder {
10
11         public ViewHolder(View view) {
12                 super(view);
13                 ButterKnife.bind(this, view);
14         }
15
16         public View getView() {
17                 return itemView;
18         }
19
20         protected Context getContext() {
21                 return getView().getContext();
22         }
23
24         public abstract void bind(T item, boolean selected);
25 }