mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
Add new ShareType: GUEST, FEDERATED_GROUP, DECK
Moved SearchRemoteOperation and GetSharesRemoteOperation to use typed response Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
4a6aa837c8
commit
2d9c4176a0
4 changed files with 14 additions and 21 deletions
|
@ -1373,19 +1373,12 @@ public class FileDataStorageManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO shares null?
|
// TODO shares null?
|
||||||
public void saveShares(ArrayList<OCShare> shares) {
|
public void saveShares(List<OCShare> shares) {
|
||||||
cleanShares(); // 190
|
cleanShares();
|
||||||
|
ArrayList<ContentProviderOperation> operations = new ArrayList<>(shares.size());
|
||||||
ArrayList<OCShare> temp = new ArrayList<>();
|
|
||||||
|
|
||||||
for (int i = 188; i <= 189; i++) {
|
|
||||||
temp.add(shares.get(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<ContentProviderOperation> operations = new ArrayList<>(temp.size());
|
|
||||||
|
|
||||||
// prepare operations to insert or update files to save in the given folder
|
// prepare operations to insert or update files to save in the given folder
|
||||||
for (OCShare share : temp) {
|
for (OCShare share : shares) {
|
||||||
ContentValues contentValues = createContentValueForShare(share);
|
ContentValues contentValues = createContentValueForShare(share);
|
||||||
|
|
||||||
if (shareExistsForRemoteId(share.getRemoteId())) {
|
if (shareExistsForRemoteId(share.getRemoteId())) {
|
||||||
|
|
|
@ -403,8 +403,11 @@ public class FileContentProvider extends ContentProvider {
|
||||||
case GROUP:
|
case GROUP:
|
||||||
case EMAIL:
|
case EMAIL:
|
||||||
case FEDERATED:
|
case FEDERATED:
|
||||||
|
case FEDERATED_GROUP:
|
||||||
case ROOM:
|
case ROOM:
|
||||||
case CIRCLE:
|
case CIRCLE:
|
||||||
|
case DECK:
|
||||||
|
case GUEST:
|
||||||
fileValues.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, 1);
|
fileValues.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -895,7 +895,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseShares(List<Object> objects) {
|
private void parseShares(List<Object> objects) {
|
||||||
ArrayList<OCShare> shares = new ArrayList<>();
|
List<OCShare> shares = new ArrayList<>();
|
||||||
|
|
||||||
for (Object shareObject : objects) {
|
for (Object shareObject : objects) {
|
||||||
// check type before cast as of long running data fetch it is possible that old result is filled
|
// check type before cast as of long running data fetch it is possible that old result is filled
|
||||||
|
|
|
@ -1555,12 +1555,12 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
||||||
storageManager = mContainerActivity.getStorageManager();
|
storageManager = mContainerActivity.getStorageManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null
|
if (remoteOperationResult.isSuccess() && remoteOperationResult.getResultData() != null
|
||||||
&& !isCancelled() && searchFragment) {
|
&& !isCancelled() && searchFragment) {
|
||||||
if (remoteOperationResult.getData() == null || remoteOperationResult.getData().size() == 0) {
|
if (remoteOperationResult.getResultData() == null || ((List) remoteOperationResult.getResultData()).isEmpty()) {
|
||||||
setEmptyView(event);
|
setEmptyView(event);
|
||||||
} else {
|
} else {
|
||||||
mAdapter.setData(remoteOperationResult.getData(),
|
mAdapter.setData(((RemoteOperationResult<List>) remoteOperationResult).getResultData(),
|
||||||
currentSearchType,
|
currentSearchType,
|
||||||
storageManager,
|
storageManager,
|
||||||
mFile,
|
mFile,
|
||||||
|
@ -1570,13 +1570,10 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
||||||
|
|
||||||
final ToolbarActivity fileDisplayActivity = (ToolbarActivity) getActivity();
|
final ToolbarActivity fileDisplayActivity = (ToolbarActivity) getActivity();
|
||||||
if (fileDisplayActivity != null) {
|
if (fileDisplayActivity != null) {
|
||||||
fileDisplayActivity.runOnUiThread(new Runnable() {
|
fileDisplayActivity.runOnUiThread(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (fileDisplayActivity != null) {
|
if (fileDisplayActivity != null) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue