use of com.orgzly.android.ui.AgendaListViewAdapter in project orgzly-android by orgzly.
the class AgendaFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
if (BuildConfig.LOG_DEBUG)
LogUtils.d(TAG, view, savedInstanceState);
super.onViewCreated(view, savedInstanceState);
/* On long click */
getListView().setOnItemLongClickListener((parent, view1, position, id) -> {
if (mListAdapter != null && mListAdapter.getItemViewType(position) != AgendaListViewAdapter.DIVIDER_VIEW_TYPE) {
mListener.onNoteLongClick(AgendaFragment.this, view1, position, id, originalNoteIDs.get(id).getNoteId());
}
return true;
});
getListView().setOnItemMenuButtonClickListener((itemView, buttonId, noteId) -> onButtonClick(mListener, itemView, buttonId, originalNoteIDs.get(noteId).getNoteId()));
/* Create a selection. */
mSelection = new Selection();
mListAdapter = new AgendaListViewAdapter(getActivity(), mSelection, getListView().getItemMenus(), false);
setListAdapter(mListAdapter);
/*
* Restore selected items, now that adapter is set.
* Saved with {@link Selection#saveSelectedIds(android.os.Bundle, String)}.
*/
mSelection.restoreIds(savedInstanceState);
}
Aggregations