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?
|
||||
public void saveShares(ArrayList<OCShare> shares) {
|
||||
cleanShares(); // 190
|
||||
|
||||
ArrayList<OCShare> temp = new ArrayList<>();
|
||||
|
||||
for (int i = 188; i <= 189; i++) {
|
||||
temp.add(shares.get(i));
|
||||
}
|
||||
|
||||
ArrayList<ContentProviderOperation> operations = new ArrayList<>(temp.size());
|
||||
public void saveShares(List<OCShare> shares) {
|
||||
cleanShares();
|
||||
ArrayList<ContentProviderOperation> operations = new ArrayList<>(shares.size());
|
||||
|
||||
// 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);
|
||||
|
||||
if (shareExistsForRemoteId(share.getRemoteId())) {
|
||||
|
|
|
@ -403,8 +403,11 @@ public class FileContentProvider extends ContentProvider {
|
|||
case GROUP:
|
||||
case EMAIL:
|
||||
case FEDERATED:
|
||||
case FEDERATED_GROUP:
|
||||
case ROOM:
|
||||
case CIRCLE:
|
||||
case DECK:
|
||||
case GUEST:
|
||||
fileValues.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, 1);
|
||||
break;
|
||||
|
||||
|
|
|
@ -895,7 +895,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
}
|
||||
|
||||
private void parseShares(List<Object> objects) {
|
||||
ArrayList<OCShare> shares = new ArrayList<>();
|
||||
List<OCShare> shares = new ArrayList<>();
|
||||
|
||||
for (Object shareObject : objects) {
|
||||
// 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();
|
||||
}
|
||||
|
||||
if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null
|
||||
if (remoteOperationResult.isSuccess() && remoteOperationResult.getResultData() != null
|
||||
&& !isCancelled() && searchFragment) {
|
||||
if (remoteOperationResult.getData() == null || remoteOperationResult.getData().size() == 0) {
|
||||
if (remoteOperationResult.getResultData() == null || ((List) remoteOperationResult.getResultData()).isEmpty()) {
|
||||
setEmptyView(event);
|
||||
} else {
|
||||
mAdapter.setData(remoteOperationResult.getData(),
|
||||
mAdapter.setData(((RemoteOperationResult<List>) remoteOperationResult).getResultData(),
|
||||
currentSearchType,
|
||||
storageManager,
|
||||
mFile,
|
||||
|
@ -1570,13 +1570,10 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
|
||||
final ToolbarActivity fileDisplayActivity = (ToolbarActivity) getActivity();
|
||||
if (fileDisplayActivity != null) {
|
||||
fileDisplayActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fileDisplayActivity.runOnUiThread(() -> {
|
||||
if (fileDisplayActivity != null) {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue