mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
Merge pull request #5823 from nextcloud/npeSearch
Search: only parse search if search event is there
This commit is contained in:
commit
b413d942ad
1 changed files with 20 additions and 18 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue