mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
OC-299 fixed restart of finished downloads on orientation changes
This commit is contained in:
parent
93f79c7099
commit
64bbf07d97
1 changed files with 13 additions and 11 deletions
|
@ -379,19 +379,21 @@ public class FileDisplayActivity extends FileActivity implements
|
|||
detailsFragment.updateFileDetails(true, false);
|
||||
|
||||
} else if (downloadEvent.equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE)) {
|
||||
// update the right panel
|
||||
if (success && waitedPreview) {
|
||||
mWaitingToPreview = mStorageManager.getFileById(mWaitingToPreview.getFileId()); // update the file from database, for the local storage path
|
||||
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
|
||||
startMediaPreview(mWaitingToPreview, 0, true);
|
||||
|
||||
} else {
|
||||
detailsFragment.updateFileDetails(false, (success));
|
||||
openFile(mWaitingToPreview);
|
||||
// update the right panel
|
||||
boolean detailsFragmentChanged = false;
|
||||
if (waitedPreview) {
|
||||
if (success) {
|
||||
mWaitingToPreview = mStorageManager.getFileById(mWaitingToPreview.getFileId()); // update the file from database, for the local storage path
|
||||
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
|
||||
startMediaPreview(mWaitingToPreview, 0, true);
|
||||
detailsFragmentChanged = true;
|
||||
} else {
|
||||
openFile(mWaitingToPreview);
|
||||
}
|
||||
}
|
||||
mWaitingToPreview = null;
|
||||
|
||||
} else {
|
||||
}
|
||||
if (!detailsFragmentChanged) {
|
||||
detailsFragment.updateFileDetails(false, (success));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue