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:
293d636
)
Disable On Device option in Navigation Drawer
author
masensio
<masensio@solidgear.es>
Mon, 25 May 2015 22:01:39 +0000
(
00:01
+0200)
committer
masensio
<masensio@solidgear.es>
Mon, 25 May 2015 22:01:39 +0000
(
00:01
+0200)
14 files changed:
res/values/strings.xml
patch
|
blob
|
blame
|
history
src/com/owncloud/android/MainApp.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/datamodel/FileDataStorageManager.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/operations/RefreshFolderOperation.java
patch
|
blob
|
blame
|
history
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/activity/FolderPickerActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/UploadPathActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/Uploader.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/preview/PreviewImagePagerAdapter.java
patch
|
blob
|
blame
|
history
diff --git
a/res/values/strings.xml
b/res/values/strings.xml
index
b9aeea4
..
d17fdb5
100644
(file)
--- a/
res/values/strings.xml
+++ b/
res/values/strings.xml
@@
-23,7
+23,7
@@
<string-array name="drawer_items">
<item>Accounts</item>
<item>All Files</item>
<string-array name="drawer_items">
<item>Accounts</item>
<item>All Files</item>
- <
item>On device</item
>
+ <
!--<item>On device</item>--
>
<item>Settings</item>
</string-array>
<string name="drawer_open">ownCloud</string>
<item>Settings</item>
</string-array>
<string name="drawer_open">ownCloud</string>
diff --git
a/src/com/owncloud/android/MainApp.java
b/src/com/owncloud/android/MainApp.java
index
0d725e5
..
c805f9f
100644
(file)
--- a/
src/com/owncloud/android/MainApp.java
+++ b/
src/com/owncloud/android/MainApp.java
@@
-53,9
+53,10
@@
public class MainApp extends Application {
private static final String POLICY_ALWAYS_NEW_CLIENT = "always new client";
private static Context mContext;
private static final String POLICY_ALWAYS_NEW_CLIENT = "always new client";
private static Context mContext;
-
+
+ // TODO Enable when "On Device" is recovered?
// TODO better place
// TODO better place
- private static boolean mOnlyOnDevice = false;
+
//
private static boolean mOnlyOnDevice = false;
public void onCreate(){
public void onCreate(){
@@
-174,14
+175,15
@@
public class MainApp extends Application {
public static String getLogName() {
return getAppContext().getResources().getString(R.string.log_name);
}
public static String getLogName() {
return getAppContext().getResources().getString(R.string.log_name);
}
-
- public static void showOnlyFilesOnDevice(boolean state){
- mOnlyOnDevice = state;
- }
-
- public static boolean getOnlyOnDevice(){
- return mOnlyOnDevice;
- }
+
+ // TODO Enable when "On Device" is recovered ?
+// public static void showOnlyFilesOnDevice(boolean state){
+// mOnlyOnDevice = state;
+// }
+//
+// public static boolean getOnlyOnDevice(){
+// return mOnlyOnDevice;
+// }
// user agent
public static String getUserAgent() {
// user agent
public static String getUserAgent() {
diff --git
a/src/com/owncloud/android/datamodel/FileDataStorageManager.java
b/src/com/owncloud/android/datamodel/FileDataStorageManager.java
index
42f2c78
..
7db0a63
100644
(file)
--- a/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
+++ b/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
@@
-142,9
+142,10
@@
public class FileDataStorageManager {
}
}
- public Vector<OCFile> getFolderContent(OCFile f
, boolean onlyOnDevice
) {
+ public Vector<OCFile> getFolderContent(OCFile f
/*, boolean onlyOnDevice*/
) {
if (f != null && f.isFolder() && f.getFileId() != -1) {
if (f != null && f.isFolder() && f.getFileId() != -1) {
- return getFolderContent(f.getFileId(), onlyOnDevice);
+ // TODO Enable when "On Device" is recovered ?
+ return getFolderContent(f.getFileId()/*, onlyOnDevice*/);
} else {
return new Vector<OCFile>();
} else {
return new Vector<OCFile>();
@@
-152,11
+153,12
@@
public class FileDataStorageManager {
}
}
- public Vector<OCFile> getFolderImages(OCFile folder
, boolean onlyOnDevice
) {
+ public Vector<OCFile> getFolderImages(OCFile folder
/*, boolean onlyOnDevice*/
) {
Vector<OCFile> ret = new Vector<OCFile>();
if (folder != null) {
Vector<OCFile> ret = new Vector<OCFile>();
if (folder != null) {
- // TODO better implementation, filtering in the access to database instead of here
- Vector<OCFile> tmp = getFolderContent(folder, onlyOnDevice);
+ // TODO better implementation, filtering in the access to database instead of here
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> tmp = getFolderContent(folder/*, onlyOnDevice*/);
OCFile current = null;
for (int i=0; i<tmp.size(); i++) {
current = tmp.get(i);
OCFile current = null;
for (int i=0; i<tmp.size(); i++) {
current = tmp.get(i);
@@
-547,7
+549,8
@@
public class FileDataStorageManager {
File localFolder = new File(localFolderPath);
if (localFolder.exists()) {
// stage 1: remove the local files already registered in the files database
File localFolder = new File(localFolderPath);
if (localFolder.exists()) {
// stage 1: remove the local files already registered in the files database
- Vector<OCFile> files = getFolderContent(folder.getFileId(), false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = getFolderContent(folder.getFileId()/*, false*/);
if (files != null) {
for (OCFile file : files) {
if (file.isFolder()) {
if (files != null) {
for (OCFile file : files) {
if (file.isFolder()) {
@@
-731,7
+734,7
@@
public class FileDataStorageManager {
}
}
- private Vector<OCFile> getFolderContent(long parentId
, boolean onlyOnDevice
) {
+ private Vector<OCFile> getFolderContent(long parentId
/*, boolean onlyOnDevice*/
) {
Vector<OCFile> ret = new Vector<OCFile>();
Vector<OCFile> ret = new Vector<OCFile>();
@@
-758,9
+761,10
@@
public class FileDataStorageManager {
if (c.moveToFirst()) {
do {
OCFile child = createFileInstance(c);
if (c.moveToFirst()) {
do {
OCFile child = createFileInstance(c);
- if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){
+ // TODO Enable when "On Device" is recovered ?
+ // if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){
ret.add(child);
ret.add(child);
- }
+
//
}
} while (c.moveToNext());
}
} while (c.moveToNext());
}
@@
-1442,8
+1446,9
@@
public class FileDataStorageManager {
String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND "
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
String [] whereArgs = new String[]{ "", mAccount.name };
String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND "
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
String [] whereArgs = new String[]{ "", mAccount.name };
-
- Vector<OCFile> files = getFolderContent(folder, false);
+
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = getFolderContent(folder /*, false*/);
for (OCFile file : files) {
whereArgs[0] = file.getRemotePath();
for (OCFile file : files) {
whereArgs[0] = file.getRemotePath();
diff --git
a/src/com/owncloud/android/operations/RefreshFolderOperation.java
b/src/com/owncloud/android/operations/RefreshFolderOperation.java
index
5a1cf85
..
2e3c469
100644
(file)
--- a/
src/com/owncloud/android/operations/RefreshFolderOperation.java
+++ b/
src/com/owncloud/android/operations/RefreshFolderOperation.java
@@
-201,7
+201,8
@@
public class RefreshFolderOperation extends RemoteOperation {
if (mRemoteFolderChanged) {
result = fetchAndSyncRemoteFolder(client);
} else {
if (mRemoteFolderChanged) {
result = fetchAndSyncRemoteFolder(client);
} else {
- mChildren = mStorageManager.getFolderContent(mLocalFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ mChildren = mStorageManager.getFolderContent(mLocalFolder/*, false*/);
}
}
}
}
@@
-341,7
+342,8
@@
public class RefreshFolderOperation extends RemoteOperation {
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// get current data about local contents of the folder to synchronize
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// get current data about local contents of the folder to synchronize
- List<OCFile> localFiles = mStorageManager.getFolderContent(mLocalFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ List<OCFile> localFiles = mStorageManager.getFolderContent(mLocalFolder/*, false*/);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
diff --git
a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
index
d4423d1
..
6bf1ef8
100644
(file)
--- a/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
+++ b/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
@@
-21,51
+21,33
@@
package com.owncloud.android.operations;
import java.io.File;
package com.owncloud.android.operations;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
-import org.apache.http.HttpStatus;
-
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
-import com.owncloud.android.MainApp;
+
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.OperationCancelledException;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.OperationCancelledException;
-import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
import com.owncloud.android.lib.resources.files.RemoteFile;
import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
import com.owncloud.android.lib.resources.files.RemoteFile;
-import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
-import com.owncloud.android.lib.resources.shares.OCShare;
-import com.owncloud.android.syncadapter.FileSyncAdapter;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.services.OperationsService;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.services.OperationsService;
import com.owncloud.android.utils.FileStorageUtils;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
import java.util.concurrent.atomic.AtomicBoolean;
//import android.support.v4.content.LocalBroadcastManager;
import java.util.concurrent.atomic.AtomicBoolean;
//import android.support.v4.content.LocalBroadcastManager;
@@
-316,7
+298,8
@@
public class SynchronizeFolderOperation extends SyncOperation {
}
// get current data about local contents of the folder to synchronize
}
// get current data about local contents of the folder to synchronize
- List<OCFile> localFiles = storageManager.getFolderContent(mLocalFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ List<OCFile> localFiles = storageManager.getFolderContent(mLocalFolder/*, false*/);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
@@
-411,8
+394,8
@@
public class SynchronizeFolderOperation extends SyncOperation {
private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
- // TODO
TOBI ist das richtig
?
- List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder
, false
);
+ // TODO
Enable when "On Device" is recovered
?
+ List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder
/*, false*/
);
for (OCFile child : children) {
/// classify file to sync/download contents later
if (child.isFolder()) {
for (OCFile child : children) {
/// classify file to sync/download contents later
if (child.isFolder()) {
diff --git
a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
index
b820e13
..
a15f9c1
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
@@
-255,14
+255,16
@@
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
adapter.notifyDataSetChanged();
break;
case 1:
adapter.notifyDataSetChanged();
break;
case 1:
- MainApp.showOnlyFilesOnDevice(false);
+ // TODO Enable when "On Device" is recovered ?
+ //MainApp.showOnlyFilesOnDevice(false);
mDrawerLayout.closeDrawers();
break;
mDrawerLayout.closeDrawers();
break;
+ // TODO Enable when "On Device" is recovered ?
+// case 2:
+// MainApp.showOnlyFilesOnDevice(true);
+// mDrawerLayout.closeDrawers();
+// break;
case 2:
case 2:
- MainApp.showOnlyFilesOnDevice(true);
- mDrawerLayout.closeDrawers();
- break;
- case 3:
Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class);
startActivity(settingsIntent);
break;
Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class);
startActivity(settingsIntent);
break;
@@
-408,7
+410,9
@@
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
/// First fragment
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
/// First fragment
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
- listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory(getCurrentDir());
+ // TODO Enable when "On Device" is recovered
+ // listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
} else {
Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
}
} else {
Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
}
@@
-527,8
+531,10
@@
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
protected void refreshListOfFilesFragment() {
OCFileListFragment fileListFragment = getListOfFilesFragment();
protected void refreshListOfFilesFragment() {
OCFileListFragment fileListFragment = getListOfFilesFragment();
- if (fileListFragment != null) {
- fileListFragment.listDirectory(MainApp.getOnlyOnDevice());
+ if (fileListFragment != null) {
+ fileListFragment.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(MainApp.getOnlyOnDevice());
}
}
}
}
@@
-1046,7
+1052,9
@@
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
if (synchFolderRemotePath != null && currentDir.getRemotePath().equals(synchFolderRemotePath)) {
OCFileListFragment fileListFragment = getListOfFilesFragment();
if (fileListFragment != null) {
if (synchFolderRemotePath != null && currentDir.getRemotePath().equals(synchFolderRemotePath)) {
OCFileListFragment fileListFragment = getListOfFilesFragment();
if (fileListFragment != null) {
- fileListFragment.listDirectory(currentDir, MainApp.getOnlyOnDevice());
+ fileListFragment.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(currentDir, MainApp.getOnlyOnDevice());
}
}
setFile(currentFile);
}
}
setFile(currentFile);
@@
-1275,7
+1283,9
@@
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
popDirname();
}
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
popDirname();
}
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
- listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory(root);
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root, false);
}
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root, false);
}
@@
-1290,7
+1300,9
@@
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
setNavigationListWithFolder(folder);
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
setNavigationListWithFolder(folder);
- listOfFiles.listDirectory(folder, MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory(folder);
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(folder, MainApp.getOnlyOnDevice());
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(folder, false);
} else {
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(folder, false);
} else {
@@
-1402,7
+1414,9
@@
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
// a new chance to get the mDownloadBinder through getFileDownloadBinder() - THIS IS A MESS
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
// a new chance to get the mDownloadBinder through getFileDownloadBinder() - THIS IS A MESS
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
- listOfFiles.listDirectory(MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(MainApp.getOnlyOnDevice());
}
FileFragment secondFragment = getSecondFragment();
if (secondFragment != null && secondFragment instanceof FileDetailFragment) {
}
FileFragment secondFragment = getSecondFragment();
if (secondFragment != null && secondFragment instanceof FileDetailFragment) {
diff --git
a/src/com/owncloud/android/ui/activity/FolderPickerActivity.java
b/src/com/owncloud/android/ui/activity/FolderPickerActivity.java
index
6dec67d
..
eec8ab3
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FolderPickerActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FolderPickerActivity.java
@@
-142,7
+142,7
@@
public class FolderPickerActivity extends FileActivity implements FileFragment.C
if (!stateWasRecovered) {
OCFileListFragment listOfFolders = getListOfFilesFragment();
if (!stateWasRecovered) {
OCFileListFragment listOfFolders = getListOfFilesFragment();
- listOfFolders.listDirectory(folder
, false);
+ listOfFolders.listDirectory(folder
/*, false*/);
startSyncFolderOperation(folder, false);
}
startSyncFolderOperation(folder, false);
}
@@
-310,8
+310,10
@@
public class FolderPickerActivity extends FileActivity implements FileFragment.C
protected void refreshListOfFilesFragment() {
OCFileListFragment fileListFragment = getListOfFilesFragment();
protected void refreshListOfFilesFragment() {
OCFileListFragment fileListFragment = getListOfFilesFragment();
- if (fileListFragment != null) {
- fileListFragment.listDirectory(false);
+ if (fileListFragment != null) {
+ fileListFragment.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(false);
}
}
}
}
@@
-319,7
+321,9
@@
public class FolderPickerActivity extends FileActivity implements FileFragment.C
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) { // should never be null, indeed
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) { // should never be null, indeed
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
- listOfFiles.listDirectory(root, false);
+ listOfFiles.listDirectory(root);
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(root, false);
setFile(listOfFiles.getCurrentFile());
updateNavigationElementsInActionBar();
startSyncFolderOperation(root, false);
setFile(listOfFiles.getCurrentFile());
updateNavigationElementsInActionBar();
startSyncFolderOperation(root, false);
@@
-471,7
+475,9
@@
public class FolderPickerActivity extends FileActivity implements FileFragment.C
equals(synchFolderRemotePath)) {
OCFileListFragment fileListFragment = getListOfFilesFragment();
if (fileListFragment != null) {
equals(synchFolderRemotePath)) {
OCFileListFragment fileListFragment = getListOfFilesFragment();
if (fileListFragment != null) {
- fileListFragment.listDirectory(currentDir, false);
+ fileListFragment.listDirectory(currentDir);
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(currentDir, false);
}
}
setFile(currentFile);
}
}
setFile(currentFile);
diff --git
a/src/com/owncloud/android/ui/activity/UploadPathActivity.java
b/src/com/owncloud/android/ui/activity/UploadPathActivity.java
index
a4e9cb7
..
db704d1
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/UploadPathActivity.java
+++ b/
src/com/owncloud/android/ui/activity/UploadPathActivity.java
@@
-67,7
+67,8
@@
public class UploadPathActivity extends FolderPickerActivity implements FileFrag
if (!stateWasRecovered) {
OCFileListFragment listOfFolders = getListOfFilesFragment();
if (!stateWasRecovered) {
OCFileListFragment listOfFolders = getListOfFilesFragment();
- listOfFolders.listDirectory(folder, false);
+ // TODO Enable when "On Device" is recovered ?
+ listOfFolders.listDirectory(folder/*, false*/);
startSyncFolderOperation(folder, false);
}
startSyncFolderOperation(folder, false);
}
diff --git
a/src/com/owncloud/android/ui/activity/Uploader.java
b/src/com/owncloud/android/ui/activity/Uploader.java
index
7336af9
..
6723616
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/Uploader.java
+++ b/
src/com/owncloud/android/ui/activity/Uploader.java
@@
-332,7
+332,8
@@
public class Uploader extends FileActivity
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// click on folder in the list
Log_OC.d(TAG, "on item click");
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// click on folder in the list
Log_OC.d(TAG, "on item click");
- Vector<OCFile> tmpfiles = getStorageManager().getFolderContent(mFile, false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> tmpfiles = getStorageManager().getFolderContent(mFile /*, false*/);
if (tmpfiles.size() <= 0) return;
// filter on dirtype
Vector<OCFile> files = new Vector<OCFile>();
if (tmpfiles.size() <= 0) return;
// filter on dirtype
Vector<OCFile> files = new Vector<OCFile>();
@@
-417,7
+418,8
@@
public class Uploader extends FileActivity
mFile = getStorageManager().getFileByPath(full_path);
if (mFile != null) {
mFile = getStorageManager().getFileByPath(full_path);
if (mFile != null) {
- Vector<OCFile> files = getStorageManager().getFolderContent(mFile, false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = getStorageManager().getFolderContent(mFile/*, false*/);
List<HashMap<String, Object>> data = new LinkedList<HashMap<String,Object>>();
for (OCFile f : files) {
HashMap<String, Object> h = new HashMap<String, Object>();
List<HashMap<String, Object>> data = new LinkedList<HashMap<String,Object>>();
for (OCFile f : files) {
HashMap<String, Object> h = new HashMap<String, Object>();
diff --git
a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java
b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java
index
43c3083
..
c6ea034
100644
(file)
--- a/
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
+++ b/
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
@@
-407,14
+407,16
@@
public class FileListListAdapter extends BaseAdapter implements ListAdapter {
* @param updatedStorageManager Optional updated storage manager; used to replace
\r
* mStorageManager if is different (and not NULL)
\r
*/
\r
* @param updatedStorageManager Optional updated storage manager; used to replace
\r
* mStorageManager if is different (and not NULL)
\r
*/
\r
- public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager, boolean onlyOnDevice) {
\r
+ public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager
\r
+ /*, boolean onlyOnDevice*/) {
\r
mFile = directory;
\r
if (updatedStorageManager != null && updatedStorageManager != mStorageManager) {
\r
mStorageManager = updatedStorageManager;
\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
\r
}
\r
if (mStorageManager != null) {
\r
mFile = directory;
\r
if (updatedStorageManager != null && updatedStorageManager != mStorageManager) {
\r
mStorageManager = updatedStorageManager;
\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
\r
}
\r
if (mStorageManager != null) {
\r
- mFiles = mStorageManager.getFolderContent(mFile, onlyOnDevice);
\r
+ // TODO Enable when "On Device" is recovered ?
\r
+ mFiles = mStorageManager.getFolderContent(mFile/*, onlyOnDevice*/);
\r
mFilesOrig.clear();
\r
mFilesOrig.addAll(mFiles);
\r
\r
mFilesOrig.clear();
\r
mFilesOrig.addAll(mFiles);
\r
\r
diff --git
a/src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java
b/src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java
index
179ab96
..
f00b19f
100644
(file)
--- a/
src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java
+++ b/
src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java
@@
-112,7
+112,8
@@
implements ConfirmationDialogFragmentListener {
boolean containsKeepInSync = false;
if (mTargetFile.isFolder()) {
boolean containsKeepInSync = false;
if (mTargetFile.isFolder()) {
- Vector<OCFile> files = storageManager.getFolderContent(mTargetFile, false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = storageManager.getFolderContent(mTargetFile/*, false*/);
for(OCFile file: files) {
containsKeepInSync = file.keepInSync() || containsKeepInSync;
for(OCFile file: files) {
containsKeepInSync = file.keepInSync() || containsKeepInSync;
diff --git
a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java
b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java
index
9430f11
..
4bf68ad
100644
(file)
--- a/
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
+++ b/
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
@@
-29,15
+29,12
@@
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.ContextMenu;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.ContextMenu;
-import android.view.LayoutInflater;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.TextView;
-import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
@@
-186,8
+183,9
@@
public class OCFileListFragment extends ExtendedListFragment {
moveCount++;
} // exit is granted because storageManager.getFileByPath("/") never returns null
mFile = parentDir;
moveCount++;
} // exit is granted because storageManager.getFileByPath("/") never returns null
mFile = parentDir;
-
- listDirectory(mFile, MainApp.getOnlyOnDevice());
+
+ // TODO Enable when "On Device" is recovered ?
+ listDirectory(mFile /*, MainApp.getOnlyOnDevice()*/);
onRefresh(false);
onRefresh(false);
@@
-205,7
+203,8
@@
public class OCFileListFragment extends ExtendedListFragment {
if (file != null) {
if (file.isFolder()) {
// update state and view of this fragment
if (file != null) {
if (file.isFolder()) {
// update state and view of this fragment
- listDirectory(file, MainApp.getOnlyOnDevice());
+ // TODO Enable when "On Device" is recovered ?
+ listDirectory(file/*, MainApp.getOnlyOnDevice()*/);
// then, notify parent activity to let it update its state and view
mContainerActivity.onBrowsedDownTo(file);
// save index and top position
// then, notify parent activity to let it update its state and view
mContainerActivity.onBrowsedDownTo(file);
// save index and top position
@@
-359,12
+358,15
@@
public class OCFileListFragment extends ExtendedListFragment {
/**
* Calls {@link OCFileListFragment#listDirectory(OCFile)} with a null parameter
*/
/**
* Calls {@link OCFileListFragment#listDirectory(OCFile)} with a null parameter
*/
- public void listDirectory(boolean onlyOnDevice){
- listDirectory(null, onlyOnDevice);
+ public void listDirectory(/*boolean onlyOnDevice*/){
+ listDirectory(null);
+ // TODO Enable when "On Device" is recovered ?
+ // listDirectory(null, onlyOnDevice);
}
public void refreshDirectory(){
}
public void refreshDirectory(){
- listDirectory(getCurrentFile(), MainApp.getOnlyOnDevice());
+ // TODO Enable when "On Device" is recovered ?
+ listDirectory(getCurrentFile()/*, MainApp.getOnlyOnDevice()*/);
}
/**
}
/**
@@
-374,7
+376,7
@@
public class OCFileListFragment extends ExtendedListFragment {
*
* @param directory File to be listed
*/
*
* @param directory File to be listed
*/
- public void listDirectory(OCFile directory
, boolean onlyOnDevice
) {
+ public void listDirectory(OCFile directory
/*, boolean onlyOnDevice*/
) {
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
if (storageManager != null) {
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
if (storageManager != null) {
@@
-395,7
+397,8
@@
public class OCFileListFragment extends ExtendedListFragment {
directory = storageManager.getFileById(directory.getParentId());
}
directory = storageManager.getFileById(directory.getParentId());
}
- mAdapter.swapDirectory(directory, storageManager, onlyOnDevice);
+ // TODO Enable when "On Device" is recovered ?
+ mAdapter.swapDirectory(directory, storageManager/*, onlyOnDevice*/);
if (mFile == null || !mFile.equals(directory)) {
mCurrentListView.setSelection(0);
}
if (mFile == null || !mFile.equals(directory)) {
mCurrentListView.setSelection(0);
}
diff --git
a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java
b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java
index
3af7992
..
6ff3cb8
100644
(file)
--- a/
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
+++ b/
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
@@
-38,7
+38,6
@@
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
import com.ortiz.touch.ExtendedViewPager;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
import com.ortiz.touch.ExtendedViewPager;
-import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.FileDataStorageManager;
@@
-140,7
+139,9
@@
ViewPager.OnPageChangeListener, OnRemoteOperationListener {
// should not be necessary
parentFolder = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
}
// should not be necessary
parentFolder = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
}
- mPreviewImagePagerAdapter = new PreviewImagePagerAdapter(getSupportFragmentManager(), parentFolder, getAccount(), getStorageManager(), MainApp.getOnlyOnDevice());
+ // TODO Enable when "On Device" is recovered ?
+ mPreviewImagePagerAdapter = new PreviewImagePagerAdapter(getSupportFragmentManager(),
+ parentFolder, getAccount(), getStorageManager()/*, MainApp.getOnlyOnDevice()*/);
mViewPager = (ExtendedViewPager) findViewById(R.id.fragmentPager);
int position = mHasSavedPosition ? mSavedPosition : mPreviewImagePagerAdapter.getFilePosition(getFile());
position = (position >= 0) ? position : 0;
mViewPager = (ExtendedViewPager) findViewById(R.id.fragmentPager);
int position = mHasSavedPosition ? mSavedPosition : mPreviewImagePagerAdapter.getFilePosition(getFile());
position = (position >= 0) ? position : 0;
diff --git
a/src/com/owncloud/android/ui/preview/PreviewImagePagerAdapter.java
b/src/com/owncloud/android/ui/preview/PreviewImagePagerAdapter.java
index
fc99d28
..
dda7dda
100644
(file)
--- a/
src/com/owncloud/android/ui/preview/PreviewImagePagerAdapter.java
+++ b/
src/com/owncloud/android/ui/preview/PreviewImagePagerAdapter.java
@@
-19,8
+19,6
@@
*/
package com.owncloud.android.ui.preview;
*/
package com.owncloud.android.ui.preview;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@
-36,7
+34,6
@@
import android.view.ViewGroup;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.ui.adapter.FileListListAdapter;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.utils.FileStorageUtils;
@@
-58,11
+55,14
@@
public class PreviewImagePagerAdapter extends FragmentStatePagerAdapter {
/**
* Constructor.
*
/**
* Constructor.
*
- * @param fragmentManager {@link FragmentManager} instance that will handle the {@link Fragment}s provided by the adapter.
+ * @param fragmentManager {@link FragmentManager} instance that will handle
+ * the {@link Fragment}s provided by the adapter.
* @param parentFolder Folder where images will be searched for.
* @param storageManager Bridge to database.
*/
* @param parentFolder Folder where images will be searched for.
* @param storageManager Bridge to database.
*/
- public PreviewImagePagerAdapter(FragmentManager fragmentManager, OCFile parentFolder, Account account, FileDataStorageManager storageManager, boolean onlyOnDevice) {
+ public PreviewImagePagerAdapter(FragmentManager fragmentManager, OCFile parentFolder,
+ Account account, FileDataStorageManager storageManager /*,
+ boolean onlyOnDevice*/) {
super(fragmentManager);
if (fragmentManager == null) {
super(fragmentManager);
if (fragmentManager == null) {
@@
-77,7
+77,8
@@
public class PreviewImagePagerAdapter extends FragmentStatePagerAdapter {
mAccount = account;
mStorageManager = storageManager;
mAccount = account;
mStorageManager = storageManager;
- mImageFiles = mStorageManager.getFolderImages(parentFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ mImageFiles = mStorageManager.getFolderImages(parentFolder/*, false*/);
mImageFiles = FileStorageUtils.sortFolder(mImageFiles);
mImageFiles = FileStorageUtils.sortFolder(mImageFiles);
@@
-102,7
+103,8
@@
public class PreviewImagePagerAdapter extends FragmentStatePagerAdapter {
OCFile file = mImageFiles.get(i);
Fragment fragment = null;
if (file.isDown()) {
OCFile file = mImageFiles.get(i);
Fragment fragment = null;
if (file.isDown()) {
- fragment = PreviewImageFragment.newInstance(file, mObsoletePositions.contains(Integer.valueOf(i)));
+ fragment = PreviewImageFragment.newInstance(file,
+ mObsoletePositions.contains(Integer.valueOf(i)));
} else if (mDownloadErrors.contains(Integer.valueOf(i))) {
fragment = FileDownloadFragment.newInstance(file, mAccount, true);
} else if (mDownloadErrors.contains(Integer.valueOf(i))) {
fragment = FileDownloadFragment.newInstance(file, mAccount, true);