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);
|
detailsFragment.updateFileDetails(true, false);
|
||||||
|
|
||||||
} else if (downloadEvent.equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE)) {
|
} else if (downloadEvent.equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE)) {
|
||||||
// update the right panel
|
// update the right panel
|
||||||
if (success && waitedPreview) {
|
boolean detailsFragmentChanged = false;
|
||||||
mWaitingToPreview = mStorageManager.getFileById(mWaitingToPreview.getFileId()); // update the file from database, for the local storage path
|
if (waitedPreview) {
|
||||||
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
|
if (success) {
|
||||||
startMediaPreview(mWaitingToPreview, 0, true);
|
mWaitingToPreview = mStorageManager.getFileById(mWaitingToPreview.getFileId()); // update the file from database, for the local storage path
|
||||||
|
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
|
||||||
} else {
|
startMediaPreview(mWaitingToPreview, 0, true);
|
||||||
detailsFragment.updateFileDetails(false, (success));
|
detailsFragmentChanged = true;
|
||||||
openFile(mWaitingToPreview);
|
} else {
|
||||||
|
openFile(mWaitingToPreview);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mWaitingToPreview = null;
|
mWaitingToPreview = null;
|
||||||
|
}
|
||||||
} else {
|
if (!detailsFragmentChanged) {
|
||||||
detailsFragment.updateFileDetails(false, (success));
|
detailsFragment.updateFileDetails(false, (success));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue