diff --git a/build.gradle b/build.gradle index 89ff1a6e74..1c3db38b27 100644 --- a/build.gradle +++ b/build.gradle @@ -173,7 +173,7 @@ dependencies { compile name: 'touch-image-view' compile 'com.android.support:multidex:1.0.1' - compile 'com.github.nextcloud:android-library:master-SNAPSHOT' + compile 'com.github.nextcloud:android-library:notifications-SNAPSHOT' compile "com.android.support:support-v4:${supportLibraryVersion}" compile "com.android.support:design:${supportLibraryVersion}" compile 'com.jakewharton:disklrucache:2.0.2' diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 7b3a875062..f7ef387bf8 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -137,7 +137,9 @@ public class ExtendedListFragment extends Fragment RECENTLY_MODIFIED_SEARCH, RECENTLY_MODIFIED_SEARCH_FILTER, RECENTLY_ADDED_SEARCH, - RECENTLY_ADDED_SEARCH_FILTER + RECENTLY_ADDED_SEARCH_FILTER, + // not a real filter, but nevertheless + SHARED_FILTER } protected void setListAdapter(BaseAdapter listAdapter) { diff --git a/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index 3128d3c740..7784b240cf 100644 --- a/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -65,6 +65,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.files.SearchOperation; import com.owncloud.android.lib.resources.files.ToggleFavoriteOperation; +import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation; import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.ui.activity.FileActivity; import com.owncloud.android.ui.activity.FileDisplayActivity; @@ -1262,6 +1263,8 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi currentSearchType = SearchType.RECENTLY_ADDED_SEARCH; } else if (event.getSearchType().equals(SearchOperation.SearchType.RECENTLY_MODIFIED_SEARCH)) { currentSearchType = SearchType.RECENTLY_MODIFIED_SEARCH; + } else if (event.getSearchType().equals(SearchOperation.SearchType.SHARED_FILTER)) { + currentSearchType = SearchType.SHARED_FILTER; } Runnable switchViewsRunnable = new Runnable() { @@ -1285,11 +1288,18 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi OwnCloudClient mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, MainApp.getAppContext()); - SearchOperation operation = new SearchOperation(event.getSearchQuery(), event.getSearchType()); - RemoteOperationResult remoteOperationResult = operation.execute(mClient); - - if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null) { - mAdapter.setData(remoteOperationResult.getData(), currentSearchType); + if (!currentSearchType.equals(SearchType.SHARED_FILTER)) { + SearchOperation operation = new SearchOperation(event.getSearchQuery(), event.getSearchType()); + RemoteOperationResult remoteOperationResult = operation.execute(mClient); + if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null) { + mAdapter.setData(remoteOperationResult.getData(), currentSearchType); + } + } else { + GetRemoteSharesOperation operation = new GetRemoteSharesOperation(); + RemoteOperationResult remoteOperationResult = operation.execute(mClient); + if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null) { + mAdapter.setData(remoteOperationResult.getData(), currentSearchType); + } } if (event.getSearchType().equals(SearchOperation.SearchType.FILE_SEARCH)) {