Search in sources :

Example 1 with PreviewAudioFragment

use of com.owncloud.android.ui.preview.PreviewAudioFragment 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);
        }
    }
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) PreviewAudioFragment(com.owncloud.android.ui.preview.PreviewAudioFragment) FileFragment(com.owncloud.android.ui.fragment.FileFragment) PreviewVideoFragment(com.owncloud.android.ui.preview.PreviewVideoFragment)

Aggregations

OCFile (com.owncloud.android.datamodel.OCFile)1 FileFragment (com.owncloud.android.ui.fragment.FileFragment)1 PreviewAudioFragment (com.owncloud.android.ui.preview.PreviewAudioFragment)1 PreviewVideoFragment (com.owncloud.android.ui.preview.PreviewVideoFragment)1