mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 05:05:31 +03:00
Revert changes, only bug-fix
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
25f203c5d1
commit
d6f57ed97a
2 changed files with 36 additions and 0 deletions
|
@ -760,6 +760,10 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
|
|||
return this.sharedViaLink;
|
||||
}
|
||||
|
||||
public boolean isShared() {
|
||||
return isSharedViaLink() || isSharedWithSharee() || isSharedWithMe();
|
||||
}
|
||||
|
||||
public String getPermissions() {
|
||||
return this.permissions;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ import com.owncloud.android.lib.resources.shares.ShareeUser;
|
|||
import com.owncloud.android.operations.RefreshFolderOperation;
|
||||
import com.owncloud.android.operations.RemoteOperationFailedException;
|
||||
import com.owncloud.android.ui.activity.ComponentsGetter;
|
||||
import com.owncloud.android.ui.activity.DrawerActivity;
|
||||
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
||||
import com.owncloud.android.ui.fragment.SearchType;
|
||||
import com.owncloud.android.ui.interfaces.OCFileListFragmentInterface;
|
||||
|
@ -733,6 +734,30 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
return !TextUtils.isEmpty(currentDirectory.getRichWorkspace().trim());
|
||||
}
|
||||
|
||||
private List<OCFile> filterSharedFiles(Iterable<OCFile> files) {
|
||||
List<OCFile> ret = new ArrayList<>();
|
||||
|
||||
for (OCFile file : files) {
|
||||
if (file.isShared()) {
|
||||
ret.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private List<OCFile> filterFavoriteFiles(Iterable<OCFile> files) {
|
||||
List<OCFile> ret = new ArrayList<>();
|
||||
|
||||
for (OCFile file : files) {
|
||||
if (file.isFavorite()) {
|
||||
ret.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the adapted directory for a new one
|
||||
*
|
||||
|
@ -765,6 +790,13 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
if (OCFile.ROOT_PATH.equals(directory.getRemotePath()) && MainApp.isOnlyPersonFiles()) {
|
||||
mFiles = limitToPersonalFiles(mFiles);
|
||||
}
|
||||
if (DrawerActivity.menuItemId == R.id.nav_shared && currentDirectory.isRootDirectory()) {
|
||||
mFiles = filterSharedFiles(mFiles);
|
||||
}
|
||||
if (DrawerActivity.menuItemId == R.id.nav_favorites && currentDirectory.isRootDirectory()) {
|
||||
mFiles = filterFavoriteFiles(mFiles);
|
||||
}
|
||||
|
||||
sortOrder = preferences.getSortOrderByFolder(directory);
|
||||
mFiles = sortOrder.sortCloudFiles(mFiles);
|
||||
prepareListOfHiddenFiles();
|
||||
|
|
Loading…
Reference in a new issue