Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate menu options in ChannelFragment #12083

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

har-123
Copy link

@har-123 har-123 commented Mar 8, 2025

What is it?

  • [Yes ] Bugfix (user facing)
  • [Yes ] Feature (user facing)
  • [Yes ] Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

MenuProvider is being added in onCreate, but it’s only removed in onDestroy. If the fragment is recreated (e.g., due to configuration changes), the menu Provider might be added again without being properly removed first, leading to duplicate menu items.

Before/After Screenshots/Screen Record

Before :
before_DuplicateMenuItemFix

After :
after_DuplicateMenuFix

Fixes the following issue(s)

@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Mar 8, 2025
Copy link

sonarqubecloud bot commented Mar 8, 2025

@ShareASmile ShareASmile added bug Issue is related to a bug waiting for review Most of the work is done, PR is now ready for a review labels Mar 8, 2025
@KnockoffFeline

This comment has been minimized.

@Pabley
Copy link

Pabley commented Mar 8, 2025

Duplicate menu options are fixed, but now if you perform the back gesture the buttons on the top right disappear.

newpipe.mp4
newpipe2.mp4

@Override
public void onDestroyView() {
super.onDestroyView();
if (menuProvider != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add this check in onCreate, so that it doesn't add a duplicate menu if one is already added for the channel fragment

@AudricV AudricV changed the title BF-11894 : Fix the Duplicate menu options in ChannelFragment Fix duplicate menu options in ChannelFragment Mar 9, 2025
@AudricV AudricV added the GUI Issue is related to the graphical user interface label Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug GUI Issue is related to the graphical user interface size/small PRs with less than 50 changed lines waiting for review Most of the work is done, PR is now ready for a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants