import com.owncloud.android.oc_framework.operations.RemoteOperation;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
import com.owncloud.android.oc_framework.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.operations.GetSharedFilesOperation;
import com.owncloud.android.operations.RemoveFileOperation;
import com.owncloud.android.operations.RenameFileOperation;
import com.owncloud.android.operations.SynchronizeFileOperation;
// PIN CODE request ; best location is to decide, let's try this first
if (getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_MAIN) && savedInstanceState == null) {
requestPinCode();
+ } else if (getIntent().getAction() == null && savedInstanceState == null) {
+ requestPinCode();
}
/// file observer
protected void onAccountSet(boolean stateWasRecovered) {
if (getAccount() != null) {
mStorageManager = new FileDataStorageManager(getAccount(), getContentResolver());
-
+
/// Check whether the 'main' OCFile handled by the Activity is contained in the current Account
OCFile file = getFile();
// get parent from path
}
setFile(file);
setNavigationListWithFolder(file);
+
+ /// get the shared files
+ if (isSharedSupported()) {
+ startGetSharedFiles();
+ }
+
if (!stateWasRecovered) {
Log_OC.e(TAG, "Initializing Fragments in onAccountChanged..");
initFragmentsWithFile();
} else if (operation instanceof CreateFolderOperation) {
onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
- }
+ } else if (operation instanceof GetSharedFilesOperation) {
+ onGetSharedFilesOperationFinish((GetSharedFilesOperation) operation, result);
+ }
}
+ /** Updates the data about shared files
+ *
+ * @param operation Get Shared Files
+ * @param result Result of the operation
+ */
+ private void onGetSharedFilesOperationFinish(GetSharedFilesOperation operation, RemoteOperationResult result) {
+ // TODO
+ // Refresh the filelist with the information
+ refeshListOfFilesFragment();
+
+ }
+
/**
* Updates the view associated to the activity after the finish of an operation trying to remove a
* file.
}
+ private void startGetSharedFiles() {
+ // Get shared files/folders
+ RemoteOperation getSharedFiles = new GetSharedFilesOperation();
+ getSharedFiles.execute(getAccount(), this, null, null, this);
+
+ }
+
// public void enableDisableViewGroup(ViewGroup viewGroup, boolean enabled) {
// int childCount = viewGroup.getChildCount();
// for (int i = 0; i < childCount; i++) {