use of eu.davidea.flexibleadapter.helpers.ItemTouchHelperCallback in project FlexibleAdapter by davideas.
the class FlexibleAdapter method initializeItemTouchHelper.
/*---------------*/
/* TOUCH METHODS */
/*---------------*/
private void initializeItemTouchHelper() {
if (mItemTouchHelper == null) {
if (mRecyclerView == null) {
throw new IllegalStateException("RecyclerView cannot be null. Enabling LongPressDrag or Swipe must be done after the Adapter is added to the RecyclerView.");
}
if (mItemTouchHelperCallback == null) {
mItemTouchHelperCallback = new ItemTouchHelperCallback(this);
if (DEBUG)
Log.i(TAG, "Initialized default ItemTouchHelperCallback");
}
mItemTouchHelper = new ItemTouchHelper(mItemTouchHelperCallback);
mItemTouchHelper.attachToRecyclerView(mRecyclerView);
}
}
Aggregations