Remove UnsetType as we do not have bottom bar anymore…

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-02-04 11:51:47 +01:00
parent 7c84a9f929
commit e118f9a516
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
4 changed files with 8 additions and 46 deletions

View file

@ -430,9 +430,7 @@ public abstract class DrawerActivity extends ToolbarActivity
break;
case R.id.nav_favorites:
handleSearchEvents(new SearchEvent("",
SearchRemoteOperation.SearchType.FAVORITE_SEARCH,
SearchEvent.UnsetType.NO_UNSET),
handleSearchEvents(new SearchEvent("", SearchRemoteOperation.SearchType.FAVORITE_SEARCH),
menuItem.getItemId());
break;
case R.id.nav_photos:
@ -472,15 +470,11 @@ public abstract class DrawerActivity extends ToolbarActivity
UserInfoActivity.openAccountRemovalConfirmationDialog(getAccount(), getSupportFragmentManager());
break;
case R.id.nav_shared:
handleSearchEvents(new SearchEvent("",
SearchRemoteOperation.SearchType.SHARED_SEARCH,
SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR),
handleSearchEvents(new SearchEvent("", SearchRemoteOperation.SearchType.SHARED_SEARCH),
menuItem.getItemId());
break;
case R.id.nav_recently_modified:
handleSearchEvents(new SearchEvent("",
SearchRemoteOperation.SearchType.RECENTLY_MODIFIED_SEARCH,
SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR),
handleSearchEvents(new SearchEvent("", SearchRemoteOperation.SearchType.RECENTLY_MODIFIED_SEARCH),
menuItem.getItemId());
break;
default:
@ -532,9 +526,7 @@ public abstract class DrawerActivity extends ToolbarActivity
}
private void startPhotoSearch(MenuItem menuItem) {
SearchEvent searchEvent = new SearchEvent("image/%",
SearchRemoteOperation.SearchType.PHOTO_SEARCH,
SearchEvent.UnsetType.NO_UNSET);
SearchEvent searchEvent = new SearchEvent("image/%", SearchRemoteOperation.SearchType.PHOTO_SEARCH);
Intent intent = new Intent(getApplicationContext(), FileDisplayActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

View file

@ -39,11 +39,4 @@ import lombok.Setter;
public class SearchEvent {
public String searchQuery;
public SearchRemoteOperation.SearchType searchType;
public UnsetType unsetType;
public enum UnsetType {
NO_UNSET,
UNSET_DRAWER,
UNSET_BOTTOM_NAV_BAR
}
}

View file

@ -85,7 +85,6 @@ import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
import com.owncloud.android.ui.dialog.SetupEncryptionDialogFragment;
import com.owncloud.android.ui.events.ChangeMenuEvent;
import com.owncloud.android.ui.events.CommentsEvent;
import com.owncloud.android.ui.events.DummyDrawerEvent;
import com.owncloud.android.ui.events.EncryptionEvent;
import com.owncloud.android.ui.events.FavoriteEvent;
import com.owncloud.android.ui.events.SearchEvent;
@ -1380,20 +1379,6 @@ public class OCFileListFragment extends ExtendedListFragment implements
}
}
private void unsetAllMenuItems(final boolean unsetDrawer) {
new Handler(Looper.getMainLooper()).post(() -> {
if (unsetDrawer) {
EventBus.getDefault().post(new DummyDrawerEvent());
}
});
}
public void setTitleFromSearchEvent(SearchEvent event) {
prepareCurrentSearch(event);
setTitle();
}
private void setTitle() {
// set title
@ -1520,12 +1505,6 @@ public class OCFileListFragment extends ExtendedListFragment implements
setFabVisible(false);
if (event.getUnsetType() == SearchEvent.UnsetType.UNSET_BOTTOM_NAV_BAR) {
unsetAllMenuItems(false);
} else if (event.getUnsetType() == SearchEvent.UnsetType.UNSET_DRAWER) {
unsetAllMenuItems(true);
}
Runnable switchViewsRunnable = () -> {
if (isGridViewPreferred(mFile) && !isGridEnabled()) {
switchToGridView();
@ -1714,10 +1693,10 @@ public class OCFileListFragment extends ExtendedListFragment implements
}
private boolean isSearchEventSet(SearchEvent event) {
return event != null && event.getSearchType() != null &&
return event != null &&
event.getSearchType() != null &&
(!TextUtils.isEmpty(event.getSearchQuery()) ||
event.searchType == SearchRemoteOperation.SearchType.SHARED_SEARCH)
&& event.getUnsetType() != null;
event.searchType == SearchRemoteOperation.SearchType.SHARED_SEARCH);
}
@Override

View file

@ -65,9 +65,7 @@ public class PhotoFragment extends OCFileListFragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
searchEvent = new SearchEvent("image/%",
SearchRemoteOperation.SearchType.PHOTO_SEARCH,
SearchEvent.UnsetType.NO_UNSET);
searchEvent = new SearchEvent("image/%", SearchRemoteOperation.SearchType.PHOTO_SEARCH);
searchRemoteOperation = new SearchRemoteOperation(searchEvent.getSearchQuery(),
searchEvent.getSearchType(),