projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4984978
)
Revert changes for files uploading
author
David A. Velasco
<dvelasco@solidgear.es>
Tue, 20 Jan 2015 10:28:36 +0000
(11:28 +0100)
committer
David A. Velasco
<dvelasco@solidgear.es>
Tue, 20 Jan 2015 10:28:36 +0000
(11:28 +0100)
src/com/owncloud/android/datamodel/OCFile.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/FileMenuFilter.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/FileOperationsHelper.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileUploader.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
patch
|
blob
|
blame
|
history
diff --git
a/src/com/owncloud/android/datamodel/OCFile.java
b/src/com/owncloud/android/datamodel/OCFile.java
index
e543b44
..
2ba0415
100644
(file)
--- a/
src/com/owncloud/android/datamodel/OCFile.java
+++ b/
src/com/owncloud/android/datamodel/OCFile.java
@@
-572,8
+572,4
@@
public class OCFile implements Parcelable, Comparable<OCFile> {
return false;
}
return false;
}
- public boolean isUploading() {
- // TODO real implementation
- return false;
- }
}
}
diff --git
a/src/com/owncloud/android/files/FileMenuFilter.java
b/src/com/owncloud/android/files/FileMenuFilter.java
index
0d138c8
..
f2a0baf
100644
(file)
--- a/
src/com/owncloud/android/files/FileMenuFilter.java
+++ b/
src/com/owncloud/android/files/FileMenuFilter.java
@@
-43,6
+43,7
@@
import com.owncloud.android.ui.activity.ComponentsGetter;
public class FileMenuFilter {
private OCFile mFile;
public class FileMenuFilter {
private OCFile mFile;
+ private ComponentsGetter mComponentsGetter;
private Account mAccount;
private Context mContext;
private Account mAccount;
private Context mContext;
@@
-51,11
+52,14
@@
public class FileMenuFilter {
*
* @param targetFile {@link OCFile} target of the action to filter in the {@link Menu}.
* @param account ownCloud {@link Account} holding targetFile.
*
* @param targetFile {@link OCFile} target of the action to filter in the {@link Menu}.
* @param account ownCloud {@link Account} holding targetFile.
+ * @param cg Accessor to app components, needed to access the
+ * {@link FileUploader} and {@link FileDownloader} services
* @param context Android {@link Context}, needed to access build setup resources.
*/
* @param context Android {@link Context}, needed to access build setup resources.
*/
- public FileMenuFilter(OCFile targetFile, Account account, Context context) {
+ public FileMenuFilter(OCFile targetFile, Account account, Co
mponentsGetter cg, Co
ntext context) {
mFile = targetFile;
mAccount = account;
mFile = targetFile;
mAccount = account;
+ mComponentsGetter = cg;
mContext = context;
}
mContext = context;
}
@@
-135,9
+139,10
@@
public class FileMenuFilter {
private void filter(List<Integer> toShow, List <Integer> toHide) {
boolean downloading = false;
boolean uploading = false;
private void filter(List<Integer> toShow, List <Integer> toHide) {
boolean downloading = false;
boolean uploading = false;
- if (mFile != null && mAccount != null) {
+ if (m
ComponentsGetter != null && m
File != null && mAccount != null) {
downloading = mFile.isDownloading() || mFile.isSynchronizing();
downloading = mFile.isDownloading() || mFile.isSynchronizing();
- uploading = mFile.isUploading();
+ FileUploaderBinder uploaderBinder = mComponentsGetter.getFileUploaderBinder();
+ uploading = (uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile));
}
/// decision is taken for each possible action on a file in the menu
}
/// decision is taken for each possible action on a file in the menu
diff --git
a/src/com/owncloud/android/files/FileOperationsHelper.java
b/src/com/owncloud/android/files/FileOperationsHelper.java
index
48c45b9
..
c8cb275
100644
(file)
--- a/
src/com/owncloud/android/files/FileOperationsHelper.java
+++ b/
src/com/owncloud/android/files/FileOperationsHelper.java
@@
-297,7
+297,7
@@
public class FileOperationsHelper {
downloaderBinder.cancel(account, file);
downloaderBinder.cancel(account, file);
- } else if (uploaderBinder != null &&
file.isUploading(
)) {
+ } else if (uploaderBinder != null &&
uploaderBinder.isUploading(account, file
)) {
uploaderBinder.cancel(account, file);
}
} else {
uploaderBinder.cancel(account, file);
}
} else {
diff --git
a/src/com/owncloud/android/files/services/FileUploader.java
b/src/com/owncloud/android/files/services/FileUploader.java
index
acbc405
..
386f185
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileUploader.java
+++ b/
src/com/owncloud/android/files/services/FileUploader.java
@@
-372,10
+372,9
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
*
* If 'file' is a directory, returns 'true' if some of its descendant files is uploading or waiting to upload.
*
*
* If 'file' is a directory, returns 'true' if some of its descendant files is uploading or waiting to upload.
*
- * @param account
Ownc
loud account where the remote file will be stored.
- * @param file A file that could be in the queue of pending uploads
+ * @param account
ownC
loud account where the remote file will be stored.
+ * @param file
A file that could be in the queue of pending uploads
*/
*/
- /*
public boolean isUploading(Account account, OCFile file) {
if (account == null || file == null)
return false;
public boolean isUploading(Account account, OCFile file) {
if (account == null || file == null)
return false;
@@
-394,7
+393,6
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
}
}
}
}
}
}
- */
/**
/**
diff --git
a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java
b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java
index
4803e01
..
bfec11c
100644
(file)
--- a/
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
+++ b/
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
@@
-41,6
+41,8
@@
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.FileDataStorageManager;
\r
import com.owncloud.android.datamodel.OCFile;
\r
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
\r
import com.owncloud.android.datamodel.FileDataStorageManager;
\r
import com.owncloud.android.datamodel.OCFile;
\r
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
\r
+import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
\r
+import com.owncloud.android.ui.activity.ComponentsGetter;
\r
import com.owncloud.android.utils.DisplayUtils;
\r
import com.owncloud.android.utils.FileStorageUtils;
\r
\r
import com.owncloud.android.utils.DisplayUtils;
\r
import com.owncloud.android.utils.FileStorageUtils;
\r
\r
@@
-63,18
+65,22
@@
public class FileListListAdapter extends BaseAdapter implements ListAdapter {
\r
private FileDataStorageManager mStorageManager;
\r
private Account mAccount;
\r
\r
private FileDataStorageManager mStorageManager;
\r
private Account mAccount;
\r
+ private ComponentsGetter mTransferServiceGetter;
\r
\r
private SharedPreferences mAppPreferences;
\r
\r
public FileListListAdapter(
\r
boolean justFolders,
\r
\r
private SharedPreferences mAppPreferences;
\r
\r
public FileListListAdapter(
\r
boolean justFolders,
\r
- Context context
\r
+ Context context,
\r
+ ComponentsGetter transferServiceGetter
\r
) {
\r
\r
mJustFolders = justFolders;
\r
mContext = context;
\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
\r
\r
) {
\r
\r
mJustFolders = justFolders;
\r
mContext = context;
\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
\r
\r
+ mTransferServiceGetter = transferServiceGetter;
\r
+
\r
mAppPreferences = PreferenceManager
\r
.getDefaultSharedPreferences(mContext);
\r
\r
mAppPreferences = PreferenceManager
\r
.getDefaultSharedPreferences(mContext);
\r
\r
@@
-145,10
+151,11
@@
public class FileListListAdapter extends BaseAdapter implements ListAdapter {
\r
ImageView localStateView = (ImageView) view.findViewById(R.id.imageView2);
\r
localStateView.bringToFront();
\r
\r
ImageView localStateView = (ImageView) view.findViewById(R.id.imageView2);
\r
localStateView.bringToFront();
\r
+ FileUploaderBinder uploaderBinder = mTransferServiceGetter.getFileUploaderBinder();
\r
if (file.isSynchronizing() || file.isDownloading()) {
\r
localStateView.setImageResource(R.drawable.downloading_file_indicator);
\r
localStateView.setVisibility(View.VISIBLE);
\r
if (file.isSynchronizing() || file.isDownloading()) {
\r
localStateView.setImageResource(R.drawable.downloading_file_indicator);
\r
localStateView.setVisibility(View.VISIBLE);
\r
- } else if (
file.isUploading(
)) {
\r
+ } else if (
uploaderBinder != null && uploaderBinder.isUploading(mAccount, file
)) {
\r
localStateView.setImageResource(R.drawable.uploading_file_indicator);
\r
localStateView.setVisibility(View.VISIBLE);
\r
} else if (file.isDown()) {
\r
localStateView.setImageResource(R.drawable.uploading_file_indicator);
\r
localStateView.setVisibility(View.VISIBLE);
\r
} else if (file.isDown()) {
\r
diff --git
a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java
b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java
index
e1571ff
..
dc607b5
100644
(file)
--- a/
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
+++ b/
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
@@
-179,6
+179,7
@@
public class FileDetailFragment extends FileFragment implements OnClickListener
FileMenuFilter mf = new FileMenuFilter(
getFile(),
mContainerActivity.getStorageManager().getAccount(),
FileMenuFilter mf = new FileMenuFilter(
getFile(),
mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
getSherlockActivity()
);
mf.filter(menu);
getSherlockActivity()
);
mf.filter(menu);
@@
-345,9
+346,8
@@
public class FileDetailFragment extends FileFragment implements OnClickListener
cb.setChecked(file.keepInSync());
// configure UI for depending upon local state of the file
cb.setChecked(file.keepInSync());
// configure UI for depending upon local state of the file
- FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder();
FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder();
FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder();
- if (transferring || file.isDownloading() ||
file.isUploading(
)) {
+ if (transferring || file.isDownloading() ||
uploaderBinder.isUploading(mAccount, file
)) {
setButtonsForTransferring();
} else if (file.isDown()) {
setButtonsForTransferring();
} else if (file.isDown()) {
@@
-446,9
+446,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);
getView().findViewById(R.id.fdProgressBlock).setVisibility(View.VISIBLE);
TextView progressText = (TextView)getView().findViewById(R.id.fdProgressText);
progressText.setVisibility(View.VISIBLE);
+ FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder();
if (getFile().isDownloading()) {
progressText.setText(R.string.downloader_download_in_progress_ticker);
if (getFile().isDownloading()) {
progressText.setText(R.string.downloader_download_in_progress_ticker);
- } else if (
getFile().isUploading(
)) {
+ } else if (
uploaderBinder != null && uploaderBinder.isUploading(mAccount, getFile()
)) {
progressText.setText(R.string.uploader_upload_in_progress_ticker);
}
}
progressText.setText(R.string.uploader_upload_in_progress_ticker);
}
}
diff --git
a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java
b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java
index
5820119
..
b70262f
100644
(file)
--- a/
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
+++ b/
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
@@
-131,7
+131,8
@@
public class OCFileListFragment extends ExtendedListFragment {
boolean justFolders = (args == null) ? false : args.getBoolean(ARG_JUST_FOLDERS, false);
mAdapter = new FileListListAdapter(
justFolders,
boolean justFolders = (args == null) ? false : args.getBoolean(ARG_JUST_FOLDERS, false);
mAdapter = new FileListListAdapter(
justFolders,
- getSherlockActivity()
+ getSherlockActivity(),
+ mContainerActivity
);
setListAdapter(mAdapter);
);
setListAdapter(mAdapter);
@@
-252,6
+253,7
@@
public class OCFileListFragment extends ExtendedListFragment {
FileMenuFilter mf = new FileMenuFilter(
targetFile,
mContainerActivity.getStorageManager().getAccount(),
FileMenuFilter mf = new FileMenuFilter(
targetFile,
mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
getSherlockActivity()
);
mf.filter(menu);
getSherlockActivity()
);
mf.filter(menu);
diff --git
a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java
b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java
index
48a45be
..
0995793
100644
(file)
--- a/
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
+++ b/
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
@@
-232,6
+232,7
@@
public class PreviewImageFragment extends FileFragment {
FileMenuFilter mf = new FileMenuFilter(
getFile(),
mContainerActivity.getStorageManager().getAccount(),
FileMenuFilter mf = new FileMenuFilter(
getFile(),
mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
getSherlockActivity()
);
mf.filter(menu);
getSherlockActivity()
);
mf.filter(menu);
diff --git
a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
index
fe488d4
..
7d6489b
100644
(file)
--- a/
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
+++ b/
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
@@
-277,6
+277,7
@@
public class PreviewMediaFragment extends FileFragment implements
FileMenuFilter mf = new FileMenuFilter(
getFile(),
mContainerActivity.getStorageManager().getAccount(),
FileMenuFilter mf = new FileMenuFilter(
getFile(),
mContainerActivity.getStorageManager().getAccount(),
+ mContainerActivity,
getSherlockActivity()
);
mf.filter(menu);
getSherlockActivity()
);
mf.filter(menu);