|
@@ -82,7 +82,6 @@ import com.owncloud.android.ui.events.ChangeMenuEvent;
|
|
|
import com.owncloud.android.ui.events.DummyDrawerEvent;
|
|
|
import com.owncloud.android.ui.events.MenuItemClickEvent;
|
|
|
import com.owncloud.android.ui.events.SearchEvent;
|
|
|
-import com.owncloud.android.ui.fragment.OCFileListFragment;
|
|
|
import com.owncloud.android.utils.DisplayUtils;
|
|
|
import com.owncloud.android.utils.FilesSyncHelper;
|
|
|
import com.owncloud.android.utils.ThemeUtils;
|
|
@@ -91,7 +90,6 @@ import com.owncloud.android.utils.svg.MenuSimpleTarget;
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
|
-import org.parceler.Parcels;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
@@ -427,12 +425,12 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|
|
EventBus.getDefault().post(new ChangeMenuEvent());
|
|
|
break;
|
|
|
case R.id.nav_favorites:
|
|
|
- switchToSearchFragment(new SearchEvent("", SearchOperation.SearchType.FAVORITE_SEARCH,
|
|
|
- SearchEvent.UnsetType.NO_UNSET), menuItem);
|
|
|
+ EventBus.getDefault().post(new SearchEvent("", SearchOperation.SearchType.FAVORITE_SEARCH,
|
|
|
+ SearchEvent.UnsetType.NO_UNSET));
|
|
|
break;
|
|
|
case R.id.nav_photos:
|
|
|
- switchToSearchFragment(new SearchEvent("image/%", SearchOperation.SearchType.CONTENT_TYPE_SEARCH,
|
|
|
- SearchEvent.UnsetType.NO_UNSET), menuItem);
|
|
|
+ EventBus.getDefault().post(new SearchEvent("image/%", SearchOperation.SearchType.CONTENT_TYPE_SEARCH,
|
|
|
+ SearchEvent.UnsetType.NO_UNSET));
|
|
|
break;
|
|
|
case R.id.nav_on_device:
|
|
|
EventBus.getDefault().post(new ChangeMenuEvent());
|
|
@@ -481,20 +479,20 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|
|
startActivityForResult(manageAccountsIntent, ACTION_MANAGE_ACCOUNTS);
|
|
|
break;
|
|
|
case R.id.nav_recently_added:
|
|
|
- switchToSearchFragment(new SearchEvent("%",SearchOperation.SearchType.CONTENT_TYPE_SEARCH,
|
|
|
- SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR), menuItem);
|
|
|
+ EventBus.getDefault().post(new SearchEvent("%", SearchOperation.SearchType.CONTENT_TYPE_SEARCH,
|
|
|
+ SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR));
|
|
|
break;
|
|
|
case R.id.nav_recently_modified:
|
|
|
- switchToSearchFragment(new SearchEvent("", SearchOperation.SearchType.RECENTLY_MODIFIED_SEARCH,
|
|
|
- SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR), menuItem);
|
|
|
+ EventBus.getDefault().post(new SearchEvent("", SearchOperation.SearchType.RECENTLY_MODIFIED_SEARCH,
|
|
|
+ SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR));
|
|
|
break;
|
|
|
case R.id.nav_shared:
|
|
|
- switchToSearchFragment(new SearchEvent("", SearchOperation.SearchType.SHARED_SEARCH,
|
|
|
- SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR), menuItem);
|
|
|
+ EventBus.getDefault().post(new SearchEvent("", SearchOperation.SearchType.SHARED_SEARCH,
|
|
|
+ SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR));
|
|
|
break;
|
|
|
case R.id.nav_videos:
|
|
|
- switchToSearchFragment(new SearchEvent("video/%", SearchOperation.SearchType.CONTENT_TYPE_SEARCH,
|
|
|
- SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR), menuItem);
|
|
|
+ EventBus.getDefault().post(new SearchEvent("video/%", SearchOperation.SearchType.CONTENT_TYPE_SEARCH,
|
|
|
+ SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR));
|
|
|
break;
|
|
|
case Menu.NONE:
|
|
|
// account clicked
|
|
@@ -512,14 +510,6 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void switchToSearchFragment(SearchEvent event, MenuItem menuItem) {
|
|
|
- Intent recentlyAddedIntent = new Intent(getBaseContext(), FileDisplayActivity.class);
|
|
|
- recentlyAddedIntent.putExtra(OCFileListFragment.SEARCH_EVENT, Parcels.wrap(event));
|
|
|
- recentlyAddedIntent.putExtra(FileDisplayActivity.DRAWER_MENU_ID, menuItem.getItemId());
|
|
|
- recentlyAddedIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
- startActivity(recentlyAddedIntent);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* show the file list to the user.
|
|
|
*
|