Merge pull request #5445 from ByteHamster/fix-context-menu
Fix wrong fragment receiving context menu event
This commit is contained in:
commit
bb36cfef63
|
@ -168,10 +168,9 @@ public abstract class EpisodesListFragment extends Fragment {
|
|||
@Override
|
||||
public boolean onContextItemSelected(@NonNull MenuItem item) {
|
||||
Log.d(TAG, "onContextItemSelected() called with: " + "item = [" + item + "]");
|
||||
if (!getUserVisibleHint()) {
|
||||
return false;
|
||||
}
|
||||
if (!isVisible()) {
|
||||
if (!getUserVisibleHint() || !isVisible() || !isMenuVisible()) {
|
||||
// The method is called on all fragments in a ViewPager, so this needs to be ignored in invisible ones.
|
||||
// Apparently, none of the visibility check method works reliably on its own, so we just use all.
|
||||
return false;
|
||||
}
|
||||
if (item.getItemId() == R.id.share_item) {
|
||||
|
|
Loading…
Reference in New Issue