Simple Horizontal Divider Item Decoration for RecyclerView
mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
getApplicationContext()
));
NOTE: Add item decoration prior to setting the adapter
public class TweetAdapter extends BaseAdapter { | |
// ... | |
public View getView(int position, View convertView, ViewGroup parent) { | |
TweetViewHolder vh = TweetViewHolder.get(convertView, parent); | |
Tweet item = getItem(position); | |
vh.user.setText(item.user); | |
vh.tweet.setText(item.tweet); |