/** * Swap choice state in item * * @param position position of list */ private void swapChoiceState(int position) { int lastCount = getCountSelected(); boolean lastChecked = checked.get(position); checked.set(position, !lastChecked); int count = lastChecked ? lastCount - 1 : lastCount + 1; if (lastCount == 0 && count == 1) { swipeRecyclerView.onChoiceStarted(); closeOpenedItems(); setActionsTo(SwipeRecyclerView.SWIPE_ACTION_CHOICE); } if (lastCount == 1 && count == 0) { swipeRecyclerView.onChoiceEnded(); returnOldActions(); } // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { // swipeListView.setItemChecked(position, !lastChecked); // } swipeRecyclerView.onChoiceChanged(position, !lastChecked); reloadChoiceStateInView(frontView, position); }