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 restoring software license dialog #10436

Merged
merged 3 commits into from
Sep 23, 2023
Merged

Fix restoring software license dialog #10436

merged 3 commits into from
Sep 23, 2023

Conversation

TobiGr
Copy link
Contributor

@TobiGr TobiGr commented Sep 20, 2023

What is it?

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

Description of the changes in your PR

The last viewed license was re-opened after an orientation change in the About and License Fragments even if the license view/dialog has been closed by the user earlier. I needed to move the method creating the AlertDialog into the Fragment class to access activeLicense. An alternative implementation would have been to pass the listener as variable. But I think that the AlertDialog creation is part of the Fragment and should therefore be in the LicenseFragment and not a helper class.

The dialog buttons to open the software's website is also restored correctly after a rotation change now.

Before/After Screenshots/Screen Record

Before After
https://github.com/TeamNewPipe/NewPipe/assets/17365767/6efedaaf-8680-4481-be06-0ef86357ce21 https://github.com/TeamNewPipe/NewPipe/assets/17365767/82f54007-f2c3-4139-8f87-a2452daa5eba

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@TobiGr TobiGr added bug Issue is related to a bug GUI Issue is related to the graphical user interface labels Sep 20, 2023
@TobiGr TobiGr force-pushed the fix/license-restore branch 2 times, most recently from bae8e9d to 8a3f69f Compare September 20, 2023 16:58
@TobiGr TobiGr changed the title [About] Do not restore last opened license after rotation change when license was closed earlier Do not restore last opened license after rotation change when license was closed earlier Sep 20, 2023
@TobiGr TobiGr changed the title Do not restore last opened license after rotation change when license was closed earlier Do not restore last opened license when license was closed earlier after rotation change Sep 20, 2023
@TobiGr TobiGr force-pushed the fix/license-restore branch 2 times, most recently from 7c45fc4 to 56765eb Compare September 20, 2023 18:47
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

The neutral button "open website license" disappears on rotation, right? Since you don't distinguish between SoftwareComponent and License. Also, setting the activeLicense should happen from inside showLicense, not right before calling it.

@TobiGr TobiGr changed the title Do not restore last opened license when license was closed earlier after rotation change Fix restoring software license dialog Sep 21, 2023
Do not restore last opened license after a rotation change when the license was closed earlier.

This commit adds onCancelListener and onDismissListener to the AlertDialogs which are used to display the licenses.
Do not keep the active License but the active SoftwareComponent.
Rename string res "recaptcha_done_button" to "done".
@TobiGr TobiGr force-pushed the fix/license-restore branch from 5955b51 to 94c1438 Compare September 23, 2023 11:59
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@TobiGr TobiGr merged commit c68a6ee into dev Sep 23, 2023
5 of 6 checks passed
@TobiGr TobiGr deleted the fix/license-restore branch September 23, 2023 12:19
This was referenced Oct 5, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants