|
@@ -206,9 +206,9 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|
|
return position;
|
|
|
}
|
|
|
|
|
|
- public void setFavoriteAttributeForItemID(String fileId, boolean favorite, boolean removeFromList) {
|
|
|
+ public void setFavoriteAttributeForItemID(String remotePath, boolean favorite, boolean removeFromList) {
|
|
|
for (OCFile file : mFiles) {
|
|
|
- if (file.getRemoteId().equals(fileId)) {
|
|
|
+ if (file.getRemotePath().equals(remotePath)) {
|
|
|
file.setFavorite(favorite);
|
|
|
|
|
|
if (removeFromList) {
|
|
@@ -220,7 +220,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|
|
}
|
|
|
|
|
|
for (OCFile file : mFilesAll) {
|
|
|
- if (file.getRemoteId().equals(fileId)) {
|
|
|
+ if (file.getRemotePath().equals(remotePath)) {
|
|
|
file.setFavorite(favorite);
|
|
|
|
|
|
mStorageManager.saveFile(file);
|
|
@@ -234,7 +234,13 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|
|
}
|
|
|
|
|
|
FileSortOrder sortOrder = preferences.getSortOrderByFolder(currentDirectory);
|
|
|
- mFiles = sortOrder.sortCloudFiles(mFiles);
|
|
|
+ if (searchType == SearchType.SHARED_FILTER) {
|
|
|
+ Collections.sort(mFiles,
|
|
|
+ (o1, o2) -> Long.compare(o2.getFirstShareTimestamp(), o1.getFirstShareTimestamp())
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ mFiles = sortOrder.sortCloudFiles(mFiles);
|
|
|
+ }
|
|
|
|
|
|
new Handler(Looper.getMainLooper()).post(this::notifyDataSetChanged);
|
|
|
}
|