/** * Dismiss item * * @param position Position that you want open */ public void dismiss(int position) { int height = touchListener.dismiss(position); if (height > 0) { touchListener.handlerPendingDismisses(height); } else { int[] dismissPositions = new int[1]; dismissPositions[0] = position; onDismiss(dismissPositions); touchListener.resetPendingDismisses(); } }
/** Dismiss items selected */ public void dismissSelected() { List<Integer> list = touchListener.getPositionsSelected(); int[] dismissPositions = new int[list.size()]; int height = 0; for (int i = 0; i < list.size(); i++) { int position = list.get(i); dismissPositions[i] = position; int auxHeight = touchListener.dismiss(position); if (auxHeight > 0) { height = auxHeight; } } if (height > 0) { touchListener.handlerPendingDismisses(height); } else { onDismiss(dismissPositions); touchListener.resetPendingDismisses(); } touchListener.returnOldActions(); }