use of com.lguipeng.notes.adpater.NotesAdapter in project Notes by lguipeng.
the class MainActivity method initRecyclerView.
@Override
public void initRecyclerView(List<SNote> notes) {
recyclerAdapter = new NotesAdapter(notes, this);
recyclerView.setHasFixedSize(true);
recyclerAdapter.setOnInViewClickListener(R.id.notes_item_root, new BaseRecyclerViewAdapter.onInternalClickListenerImpl<SNote>() {
@Override
public void OnClickListener(View parentV, View v, Integer position, SNote values) {
super.OnClickListener(parentV, v, position, values);
mainPresenter.onRecyclerViewItemClick(position, values);
}
});
recyclerAdapter.setOnInViewClickListener(R.id.note_more, new BaseRecyclerViewAdapter.onInternalClickListenerImpl<SNote>() {
@Override
public void OnClickListener(View parentV, View v, Integer position, SNote values) {
super.OnClickListener(parentV, v, position, values);
mainPresenter.showPopMenu(v, position, values);
}
});
recyclerAdapter.setFirstOnly(false);
recyclerAdapter.setDuration(300);
recyclerView.setAdapter(recyclerAdapter);
refreshLayout.setColorSchemeColors(getColorPrimary());
refreshLayout.setOnRefreshListener(mainPresenter);
}
Aggregations