Search in sources :

Example 6 with FileFragment

use of com.owncloud.android.ui.fragment.FileFragment in project android by owncloud.

the class FileDisplayActivity method onRenameFileOperationFinish.

/**
     * Updates the view associated to the activity after the finish of an operation trying to rename
     * a file.
     *
     * @param operation Renaming operation performed.
     * @param result    Result of the renaming.
     */
private void onRenameFileOperationFinish(RenameFileOperation operation, RemoteOperationResult result) {
    OCFile renamedFile = operation.getFile();
    if (result.isSuccess()) {
        FileFragment details = getSecondFragment();
        if (details != null && renamedFile.equals(details.getFile())) {
            renamedFile = getStorageManager().getFileById(renamedFile.getFileId());
            setFile(renamedFile);
            details.onFileMetadataChanged(renamedFile);
            updateActionBarTitleAndHomeButton(renamedFile);
        }
        if (getStorageManager().getFileById(renamedFile.getParentId()).equals(getCurrentDir())) {
            refreshListOfFilesFragment(true);
        }
    } else {
        showSnackMessage(ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()));
        if (result.isSslRecoverableException()) {
            mLastSslUntrustedServerResult = result;
            showUntrustedCertDialog(mLastSslUntrustedServerResult);
        }
    }
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) FileFragment(com.owncloud.android.ui.fragment.FileFragment)

Example 7 with FileFragment

use of com.owncloud.android.ui.fragment.FileFragment in project android by owncloud.

the class PreviewImagePagerAdapter method updateWithDownloadError.

private void updateWithDownloadError(int position) {
    FileFragment fragmentToUpdate = mCachedFragments.get(position);
    if (fragmentToUpdate != null) {
        mObsoleteFragments.add(fragmentToUpdate);
    }
    mDownloadErrors.add(position);
}
Also used : FileFragment(com.owncloud.android.ui.fragment.FileFragment)

Aggregations

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