@Override public void onLoadFinished( Loader<LoaderResult<PagingResult<Node>>> loader, LoaderResult<PagingResult<Node>> results) { if (loader instanceof NodeChildrenLoader) { parentFolder = ((NodeChildrenLoader) loader).getParentFolder(); importFolder = parentFolder; } if (adapter == null) { adapter = new NodeAdapter( getActivity(), alfSession, R.layout.sdk_list_row, new ArrayList<Node>(0), selectedItems); } if (results.hasException()) { onLoaderException(results.getException()); } else { displayPagingData(results.getData(), loaderId, callback); } ((NodeAdapter) adapter).setActivateThumbnail(true); getActivity().invalidateOptionsMenu(); displayPathShortcut(); }
// ////////////////////////////////////////////////////////////////////// // LOADERS // ////////////////////////////////////////////////////////////////////// @Override public void onLoadFinished( Loader<LoaderResult<PagingResult<Node>>> loader, LoaderResult<PagingResult<Node>> results) { if (getActivity() instanceof MainActivity && ((MainActivity) getActivity()).getCurrentNode() != null) { selectedItems.clear(); selectedItems.add(((MainActivity) getActivity()).getCurrentNode()); } if (loader instanceof NodeChildrenLoader) { parentFolder = ((NodeChildrenLoader) loader).getParentFolder(); importFolder = parentFolder; } if (mode == MODE_PICK && adapter == null) { selectedMapItems = fragmentPick.retrieveDocumentSelection(); adapter = new ProgressNodeAdapter( getActivity(), BaseCursorGridAdapterHelper.getDisplayItemLayout(getActivity(), gv, displayMode), parentFolder, new ArrayList<Node>(0), selectedMapItems); } else if (adapter == null) { adapter = new ProgressNodeAdapter( getActivity(), BaseCursorGridAdapterHelper.getDisplayItemLayout(getActivity(), gv, displayMode), parentFolder, new ArrayList<Node>(0), selectedItems, mode); } if (results.hasException()) { if (adapter.getCount() == 0) { ev.setVisibility(View.VISIBLE); } onLoaderException(results.getException()); } else { displayPagingData(results.getData(), loaderId, callback); } ((NodeAdapter) adapter).setActivateThumbnail(hasActivateThumbnail()); getActivity().invalidateOptionsMenu(); displayPathShortcut(); checkValidationButton(); }