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:
2948f10
)
Fix bug: When you browses up, the folder and files dissapears
author
masensio
<masensio@solidgear.es>
Wed, 4 Sep 2013 08:25:27 +0000
(10:25 +0200)
committer
masensio
<masensio@solidgear.es>
Wed, 4 Sep 2013 08:25:27 +0000
(10:25 +0200)
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
patch
|
blob
|
blame
|
history
diff --git
a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
index
3c1a64f
..
b08b2be
100644
(file)
--- a/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
+++ b/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
@@
-64,6
+64,11
@@
public class SynchronizeFolderOperation extends RemoteOperation {
/** Id of the folder to synchronize in the local database */
private long mParentId;
/** Id of the folder to synchronize in the local database */
private long mParentId;
+ public long getParentId() {
+ return mParentId;
+ }
+
+
/** Access to the local database */
private DataStorageManager mStorageManager;
/** Access to the local database */
private DataStorageManager mStorageManager;
diff --git
a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
index
ebccaba
..
c6c8ecf
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
@@
-948,7
+948,7
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
cleanSecondFragment();
// Sync Folder
cleanSecondFragment();
// Sync Folder
- syncFolderOperation(directory.getRemotePath(), directory.getFileId());
+ s
tartS
yncFolderOperation(directory.getRemotePath(), directory.getFileId());
// Update folder size on DB
getStorageManager().calculateFolderSize(directory.getParentId());
// Update folder size on DB
getStorageManager().calculateFolderSize(directory.getParentId());
@@
-1174,9
+1174,12
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
* @param result Result of the synchronization.
*/
private void onSynchronizeFolderOperationFinish(SynchronizeFolderOperation operation, RemoteOperationResult result) {
* @param result Result of the synchronization.
*/
private void onSynchronizeFolderOperationFinish(SynchronizeFolderOperation operation, RemoteOperationResult result) {
+ setSupportProgressBarIndeterminateVisibility(false);
if (result.isSuccess()) {
if (result.isSuccess()) {
- refeshListOfFilesFragment();
-
+ DataStorageManager storageManager = getStorageManager();
+ OCFile parentDir = storageManager.getFileById(operation.getParentId());
+
+ refreshListOfFilesFragment(parentDir);
} else {
try {
Toast msg = Toast.makeText(FileDisplayActivity.this, R.string.sync_file_fail_msg, Toast.LENGTH_LONG);
} else {
try {
Toast msg = Toast.makeText(FileDisplayActivity.this, R.string.sync_file_fail_msg, Toast.LENGTH_LONG);
@@
-1189,6
+1192,14
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
}
}
+ private void refreshListOfFilesFragment(OCFile parentDir) {
+ OCFileListFragment fileListFragment = getListOfFilesFragment();
+ if (fileListFragment != null) {
+ fileListFragment.listDirectory(parentDir);
+ }
+ }
+
+
/**
* Updates the view associated to the activity after the finish of an operation trying to remove a
* file.
/**
* Updates the view associated to the activity after the finish of an operation trying to remove a
* file.
@@
-1374,9
+1385,10
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
return null;
}
return null;
}
- public void syncFolderOperation(String remotePath, long parentId) {
- long currentSyncTime = System.currentTimeMillis();
- // perform folder synchronization
+ public void startSyncFolderOperation(String remotePath, long parentId) {
+ long currentSyncTime = System.currentTimeMillis();
+ setSupportProgressBarIndeterminateVisibility(true);
+ // perform folder synchronization
RemoteOperation synchFolderOp = new SynchronizeFolderOperation( remotePath,
currentSyncTime,
parentId,
RemoteOperation synchFolderOp = new SynchronizeFolderOperation( remotePath,
currentSyncTime,
parentId,
diff --git
a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java
b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java
index
64161ed
..
b6d30ed
100644
(file)
--- a/
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
+++ b/
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
@@
-129,18
+129,24
@@
public class OCFileListFragment extends ExtendedListFragment implements EditName
if(mFile != null){
DataStorageManager storageManager = mContainerActivity.getStorageManager();
if(mFile != null){
DataStorageManager storageManager = mContainerActivity.getStorageManager();
- parentDir = storageManager.getFileById(mFile.getParentId());
+ if (mFile.getParentId() == 0) {
+ parentDir = storageManager.getFileById(1);
+ }
+ else {
+ parentDir = storageManager.getFileById(mFile.getParentId());
+ }
// Update folder size on DB
storageManager.calculateFolderSize(mFile.getFileId());
// Update folder size on DB
storageManager.calculateFolderSize(mFile.getFileId());
- mFile = parentDir;
-
+ mFile = parentDir;
}
}
- listDirectory(parentDir);
-
+
+ if (mFile != null) {
+ listDirectory(mFile);
- mContainerActivity.syncFolderOperation(mFile.getRemotePath(), mFile.getParentId());
+ mContainerActivity.startSyncFolderOperation(mFile.getRemotePath(), mFile.getParentId());
+ }
}
}
@@
-406,7
+412,7
@@
public class OCFileListFragment extends ExtendedListFragment implements EditName
public void startImagePreview(OCFile file);
public void startImagePreview(OCFile file);
- public void syncFolderOperation(String remotePath, long parentId);
+ public void s
tartS
yncFolderOperation(String remotePath, long parentId);
/**
* Getter for the current DataStorageManager in the container activity
/**
* Getter for the current DataStorageManager in the container activity