Skip to content

Commit

Permalink
Second attempt: Fix #445: Problem with "Go back after mark all items …
Browse files Browse the repository at this point in the history
…as read"
  • Loading branch information
nilsbraden committed Mar 16, 2021
1 parent 7d7f14f commit be20cae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Expand Up @@ -199,6 +199,12 @@ protected void doUpdate(boolean forceUpdate) {
public boolean onPrepareOptionsMenu(Menu menu) {
boolean ret = super.onPrepareOptionsMenu(menu);
menu.removeItem(R.id.Menu_MarkFeedRead);

if (!Controller.isTablet && selectedCategoryId != Integer.MIN_VALUE)
menu.removeItem(R.id.Menu_MarkAllRead);
if (selectedCategoryId == Integer.MIN_VALUE)
menu.removeItem(R.id.Menu_MarkFeedsRead);

return ret;
}

Expand Down
Expand Up @@ -128,15 +128,6 @@ public boolean onContextItemSelected(android.view.MenuItem item) {
return false;
}

@Override
public void onPrepareOptionsMenu(Menu menu) {
if (!Controller.isTablet && selectedId != Integer.MIN_VALUE)
menu.removeItem(R.id.Menu_MarkAllRead);
if (selectedId == Integer.MIN_VALUE)
menu.removeItem(R.id.Menu_MarkFeedsRead);
super.onPrepareOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (super.onOptionsItemSelected(item))
Expand All @@ -146,7 +137,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
if (activity == null)
return false;

boolean backAfterUpdate = Controller.getInstance().goBackAfterMarkAllRead();
boolean backAfterUpdate = Controller.getInstance().goBackAfterMarkAllRead() && !Controller.isTablet;

switch (item.getItemId()) {
case R.id.Menu_MarkAllRead: {
IUpdatable updateable = new ReadStateUpdater(ReadStateUpdater.TYPE.ALL_CATEGORIES);
Expand Down

0 comments on commit be20cae

Please sign in to comment.