@OnItemClick(android.R.id.list) public void onItemClick(View view, int position) { if (actionMode != null) { if (selectedScreen != null && selectedScreen.getId().equals(adapter.getItem(position).getId())) { actionMode.finish(); editScreen(); } view.setSelected(true); selectedScreen = adapter.getItem(position); return; } view.setSelected(true); selectedScreen = adapter.getItem(position); actionMode = getActivity().startActionMode(selectedScreenCallback); }
@Override public void onCompleted() { if (adapter.getCount() == 0) { setEmptyText(getString(R.string.empty_screens)); } else { setEmptyText(StringUtils.EMPTY); } }
@Override public void onNext(List<Screen> screens) { adapter.clear(); adapter.addAll(screens); }