X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/d2883905c637467f46964abaf7dd199f47f6fba9..288c148b51b951017a3a9b333797a7e8eeede38a:/src/com/owncloud/android/ui/fragment/FileDetailFragment.java diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index dc607b51..6a19957b 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -1,6 +1,10 @@ -/* ownCloud Android client application +/** + * ownCloud Android client application + * + * @author Bartek Przybylski + * @author David A. Velasco * Copyright (C) 2011 Bartek Przybylski - * Copyright (C) 2012-2013 ownCloud Inc. + * Copyright (C) 2015 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -52,9 +56,6 @@ import com.owncloud.android.utils.DisplayUtils; /** * This Fragment is used to display the details about a file. - * - * @author Bartek Przybylski - * @author David A. Velasco */ public class FileDetailFragment extends FileFragment implements OnClickListener { @@ -346,8 +347,12 @@ public class FileDetailFragment extends FileFragment implements OnClickListener cb.setChecked(file.keepInSync()); // configure UI for depending upon local state of the file + FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder(); FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder(); - if (transferring || file.isDownloading() || uploaderBinder.isUploading(mAccount, file)) { + if (transferring || + (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, file)) || + (uploaderBinder != null && uploaderBinder.isUploading(mAccount, file)) + ) { setButtonsForTransferring(); } else if (file.isDown()) { @@ -446,8 +451,10 @@ public class FileDetailFragment extends FileFragment implements OnClickListener getView().findViewById(R.id.fdProgressBlock).setVisibility(View.VISIBLE); TextView progressText = (TextView)getView().findViewById(R.id.fdProgressText); progressText.setVisibility(View.VISIBLE); + FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder(); FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder(); - if (getFile().isDownloading()) { + //if (getFile().isDownloading()) { + if (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, getFile())) { progressText.setText(R.string.downloader_download_in_progress_ticker); } else if (uploaderBinder != null && uploaderBinder.isUploading(mAccount, getFile())) { progressText.setText(R.string.uploader_upload_in_progress_ticker); @@ -530,9 +537,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener /** - * Helper class responsible for updating the progress bar shown for file uploading or downloading - * - * @author David A. Velasco + * Helper class responsible for updating the progress bar shown for file uploading or downloading */ private class ProgressListener implements OnDatatransferProgressListener { int mLastPercent = 0;