Merge pull request #4998 from ByteHamster/fix-navdrawer-pressed

Only react to onContextItemSelected if something was actually selected
This commit is contained in:
ByteHamster 2021-03-07 11:18:36 +01:00 committed by GitHub
commit 9d2467a4e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -134,8 +134,10 @@ public class NavDrawerFragment extends Fragment implements SharedPreferences.OnS
@Override @Override
public boolean onContextItemSelected(@NonNull MenuItem item) { public boolean onContextItemSelected(@NonNull MenuItem item) {
if (contextPressedItem.type == NavDrawerData.DrawerItem.Type.FEED) { NavDrawerData.DrawerItem pressedItem = contextPressedItem;
return onFeedContextMenuClicked(((NavDrawerData.FeedDrawerItem) contextPressedItem).feed, item); contextPressedItem = null;
if (pressedItem != null && pressedItem.type == NavDrawerData.DrawerItem.Type.FEED) {
return onFeedContextMenuClicked(((NavDrawerData.FeedDrawerItem) pressedItem).feed, item);
} }
return false; return false;
} }