mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
WIP - commented pull-refreshes of list view as previous step to trust refresh to observer registered by Cursor
This commit is contained in:
parent
65c7d5d5ba
commit
6c33cefba0
4 changed files with 41 additions and 1 deletions
|
@ -611,6 +611,7 @@ public class FileDataStorageManager {
|
|||
|
||||
|
||||
public Cursor getContent(long parentId) {
|
||||
Log_OC.d(TAG, "getContent start");
|
||||
Uri req_uri = Uri.withAppendedPath(
|
||||
ProviderTableMeta.CONTENT_URI_DIR,
|
||||
String.valueOf(parentId));
|
||||
|
@ -629,8 +630,11 @@ public class FileDataStorageManager {
|
|||
c = getContentResolver().query(req_uri, null,
|
||||
ProviderTableMeta.FILE_PARENT + "=?" ,
|
||||
new String[] { String.valueOf(parentId)}, null);
|
||||
|
||||
//c.setNotificationUri(getContentResolver(), req_uri);
|
||||
}
|
||||
|
||||
Log_OC.d(TAG, "getContent end");
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,6 +99,8 @@ public class FileContentProvider extends ContentProvider {
|
|||
private static final int DIRECTORY = 2;
|
||||
private static final int ROOT_DIRECTORY = 3;
|
||||
private static final int SHARES = 4;
|
||||
|
||||
private static final String TAG = FileContentProvider.class.getSimpleName();
|
||||
|
||||
// Projection for ocshares table
|
||||
private static HashMap<String, String> mOCSharesProjectionMap;
|
||||
|
@ -414,6 +416,7 @@ public class FileContentProvider extends ContentProvider {
|
|||
// DB case_sensitive
|
||||
db.execSQL("PRAGMA case_sensitive_like = true");
|
||||
Cursor c = sqlQuery.query(db, projection, selection, selectionArgs, null, null, order);
|
||||
Log_OC.d(TAG, "setting notification URI: " + uri);
|
||||
c.setNotificationUri(getContext().getContentResolver(), uri);
|
||||
return c;
|
||||
}
|
||||
|
|
|
@ -215,7 +215,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
protected void onStart() {
|
||||
super.onStart();
|
||||
getSupportActionBar().setIcon(DisplayUtils.getSeasonalIconId());
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -416,12 +418,14 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
updateNavigationElementsInActionBar(null);
|
||||
}
|
||||
|
||||
/* TODO WIP COMMENT
|
||||
protected void refeshListOfFilesFragment() {
|
||||
OCFileListFragment fileListFragment = getListOfFilesFragment();
|
||||
if (fileListFragment != null) {
|
||||
fileListFragment.listDirectory();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
protected void refreshSecondFragment(String downloadEvent, String downloadedRemotePath, boolean success) {
|
||||
FileFragment secondFragment = getSecondFragment();
|
||||
|
@ -940,13 +944,15 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
cleanSecondFragment();
|
||||
currentFile = currentDir;
|
||||
}
|
||||
|
||||
|
||||
/* TODO WIP COMMENT
|
||||
if (synchFolderRemotePath != null && currentDir.getRemotePath().equals(synchFolderRemotePath)) {
|
||||
OCFileListFragment fileListFragment = getListOfFilesFragment();
|
||||
if (fileListFragment != null) {
|
||||
fileListFragment.listDirectory(currentDir);
|
||||
}
|
||||
}
|
||||
*/
|
||||
setFile(currentFile);
|
||||
}
|
||||
|
||||
|
@ -999,7 +1005,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
OCFile currentDir = getCurrentDir();
|
||||
boolean isDescendant = (currentDir != null) && (uploadedRemotePath != null) && (uploadedRemotePath.startsWith(currentDir.getRemotePath()));
|
||||
if (sameAccount && isDescendant) {
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1020,7 +1028,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
boolean isDescendant = isDescendant(downloadedRemotePath);
|
||||
|
||||
if (sameAccount && isDescendant) {
|
||||
/* TODO WIP COMMENT
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
refreshSecondFragment(intent.getAction(), downloadedRemotePath, intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false));
|
||||
}
|
||||
|
||||
|
@ -1069,7 +1079,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
if (getAccount() != null && account.name.equals(getAccount().name)
|
||||
&& getStorageManager() != null
|
||||
) {
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
}
|
||||
if ((getSharesResult != null) &&
|
||||
RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(getSharesResult.getCode())) {
|
||||
|
@ -1224,10 +1236,13 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onFileStateChanged() {
|
||||
/* TODO WIP COMMENT
|
||||
refeshListOfFilesFragment();
|
||||
updateNavigationElementsInActionBar(getSecondFragment().getFile());
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -1362,7 +1377,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) {
|
||||
if (result.isSuccess()) {
|
||||
refreshShowDetails();
|
||||
/* TODO WIP COMMENT
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1370,10 +1387,14 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) {
|
||||
if (result.isSuccess()) {
|
||||
refreshShowDetails();
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
} else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) {
|
||||
cleanSecondFragment();
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1413,7 +1434,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
cleanSecondFragment();
|
||||
}
|
||||
if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -1435,7 +1458,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
private void onCreateFolderOperationFinish(CreateFolderOperation operation, RemoteOperationResult result) {
|
||||
if (result.isSuccess()) {
|
||||
dismissLoadingDialog();
|
||||
/* TODO WIP COMMENT
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
|
||||
} else {
|
||||
dismissLoadingDialog();
|
||||
|
@ -1472,7 +1497,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
}
|
||||
}
|
||||
if (getStorageManager().getFileById(renamedFile.getParentId()).equals(getCurrentDir())) {
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -1509,7 +1536,9 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
|
|||
|
||||
} else {
|
||||
if (operation.transferWasRequested()) {
|
||||
/*
|
||||
refeshListOfFilesFragment();
|
||||
*/
|
||||
onTransferStateChanged(syncedFile, true, true);
|
||||
|
||||
} else {
|
||||
|
|
|
@ -854,7 +854,9 @@ public class FileDetailFragment extends FileFragment implements
|
|||
|
||||
if (result.isSuccess()) {
|
||||
updateFileDetails(((RenameFileOperation)operation).getFile(), mAccount);
|
||||
/* TODO WIP COMMENT
|
||||
mContainerActivity.onFileStateChanged();
|
||||
*/
|
||||
|
||||
} else {
|
||||
if (result.getCode().equals(ResultCode.INVALID_LOCAL_FILE_NAME)) {
|
||||
|
@ -896,8 +898,10 @@ public class FileDetailFragment extends FileFragment implements
|
|||
} else {
|
||||
if (operation.transferWasRequested()) {
|
||||
setButtonsForTransferring();
|
||||
/* TODO WIP COMMENT
|
||||
mContainerActivity.onFileStateChanged(); // this is not working; FileDownloader won't do NOTHING at all until this method finishes, so
|
||||
// checking the service to see if the file is downloading results in FALSE
|
||||
*/
|
||||
} else {
|
||||
Toast msg = Toast.makeText(getActivity(), R.string.sync_file_nothing_to_do_msg, Toast.LENGTH_LONG);
|
||||
msg.show();
|
||||
|
|
Loading…
Reference in a new issue