Merge pull request #5823 from nextcloud/npeSearch

Search: only parse search if search event is there
This commit is contained in:
Andy Scherzinger 2020-04-07 14:40:08 +02:00 committed by GitHub
commit b413d942ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -523,26 +523,28 @@ public class FileDisplayActivity extends FileActivity
setIntent(intent);
SearchEvent searchEvent = Parcels.unwrap(intent.getParcelableExtra(OCFileListFragment.SEARCH_EVENT));
if (SearchRemoteOperation.SearchType.PHOTO_SEARCH.equals(searchEvent.searchType)) {
Log_OC.d(this, "Switch to photo search fragment");
if (searchEvent != null) {
if (SearchRemoteOperation.SearchType.PHOTO_SEARCH.equals(searchEvent.searchType)) {
Log_OC.d(this, "Switch to photo search fragment");
PhotoFragment photoFragment = new PhotoFragment(true);
Bundle bundle = new Bundle();
bundle.putParcelable(OCFileListFragment.SEARCH_EVENT, Parcels.wrap(searchEvent));
photoFragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.left_fragment_container, photoFragment, TAG_LIST_OF_FILES);
transaction.commit();
} else {
Log_OC.d(this, "Switch to oc file search fragment");
PhotoFragment photoFragment = new PhotoFragment(true);
Bundle bundle = new Bundle();
bundle.putParcelable(OCFileListFragment.SEARCH_EVENT, Parcels.wrap(searchEvent));
photoFragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.left_fragment_container, photoFragment, TAG_LIST_OF_FILES);
transaction.commit();
} else {
Log_OC.d(this, "Switch to oc file search fragment");
OCFileListFragment photoFragment = new OCFileListFragment();
Bundle bundle = new Bundle();
bundle.putParcelable(OCFileListFragment.SEARCH_EVENT, Parcels.wrap(searchEvent));
photoFragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.left_fragment_container, photoFragment, TAG_LIST_OF_FILES);
transaction.commit();
OCFileListFragment photoFragment = new OCFileListFragment();
Bundle bundle = new Bundle();
bundle.putParcelable(OCFileListFragment.SEARCH_EVENT, Parcels.wrap(searchEvent));
photoFragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.left_fragment_container, photoFragment, TAG_LIST_OF_FILES);
transaction.commit();
}
}
} else if (UsersAndGroupsSearchProvider.ACTION_SHARE_WITH.equals(intent.getAction())) {
Uri data = intent.getData();