use of com.owncloud.android.ui.preview.PreviewVideoFragment in project android by owncloud.
the class FileDisplayActivity method onRemoveFileOperationFinish.
/**
* Updates the view associated to the activity after the finish of an operation trying to
* remove a file.
*
* @param operation Removal operation performed.
* @param result Result of the removal.
*/
private void onRemoveFileOperationFinish(RemoveFileOperation operation, RemoteOperationResult result) {
showSnackMessage(ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()));
if (result.isSuccess()) {
OCFile removedFile = operation.getFile();
FileFragment second = getSecondFragment();
if (second != null && removedFile.equals(second.getFile())) {
if (second instanceof PreviewAudioFragment) {
((PreviewAudioFragment) second).stopPreview();
} else if (second instanceof PreviewVideoFragment) {
((PreviewVideoFragment) second).stopPreview();
}
setFile(getStorageManager().getFileById(removedFile.getParentId()));
cleanSecondFragment();
}
if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
refreshListOfFilesFragment(true);
}
invalidateOptionsMenu();
} else {
if (result.isSslRecoverableException()) {
mLastSslUntrustedServerResult = result;
showUntrustedCertDialog(mLastSslUntrustedServerResult);
}
}
}
Aggregations