/** * Sets up various helpers for both the list and grid * * @param list The list or grid */ private void initAbsListView(final AbsListView list) { // Release any references to the recycled Views list.setRecyclerListener(new RecycleHolder()); // Listen for ContextMenus to be created list.setOnCreateContextMenuListener(this); // Show the albums and songs from the selected artist list.setOnItemClickListener(this); // To help make scrolling smooth list.setOnScrollListener(this); }
@Override public void setAbsListView(AbsListView listView) { super.setAbsListView(listView); mContextualUndoListViewTouchListener = new ContextualUndoListViewTouchListener(listView, this); mContextualUndoListViewTouchListener.setIsParentHorizontalScrollContainer( isParentHorizontalScrollContainer()); mContextualUndoListViewTouchListener.setTouchChild(getTouchChild()); listView.setOnTouchListener(mContextualUndoListViewTouchListener); listView.setOnScrollListener(mContextualUndoListViewTouchListener.makeScrollListener()); listView.setRecyclerListener(new RecycleViewListener()); }