apps-android-commons
apps-android-commons copied to clipboard
Fixes Issue #5832: Navigation Banner Appears in Media Details Screen
Description (required)
Fixes #5832
What changes did you make and why?
There were two changes made.
First, a helper method was created to easily retrieve the ContributionsFragment. Accessing the ContributionsFragment is required to hide the navigation banner.
(One concern I have with this helper method is that it attempts to find the ContributionsFragment by looping through the parent fragments repeatedly in a while loop. The advantage of this strategy is that it can retrieve the ContributionsFragment anywhere in the Fragment parent-child structure if it exists. The primary disadvantage is that if the Fragment parent-child structure is a loop with no ContributionsFragment, then the while loop will never terminate.
I can rewrite this method to retrieve the ContributionsFragment directly (using two calls to getParentFragment()), but this strategy is less flexible. Should I rewrite this helper method to not use a while loop or is the current implementation okay?)
Second, old code which attempted to hide the navigation banner (but was unsuccessful) was replaced with a call to the helper method and then checking for null objects. If the objects are not null, then the navigation banner is successfully hidden.
Tests performed (required)
Tested betaDebug on Android Studio Emulator with API level 34.
Screenshots (for UI changes only)
In this video, the navigation banner is visible from the contributions menu. When a specific contribution is selected, the navigation banner is hidden. Once the back button is pressed, the contributions menu appears with the navigation banner visible again.