apps-android-commons
apps-android-commons copied to clipboard
Add report menu for Leaderboard
As stated at https://github.com/commons-app/apps-android-commons/pull/5025#issuecomment-1206026553 , we need to add the Report menu in Explore to Leaderboard.
Actually, I am not sure why the whole menu (which can be seen via Explore) is missing. Looks like a bug I would say. 🙂
I've had a look into this and it seems that the media.MediaDetailPagerFragment needed to display the media content is created in two places - ExploreListRootFragment & ContributionsFragment. The explore side sets up with a .add(R.id.explore_container, fragment) and contributions side sets up with .add(R.id.root_frame, fragment, tag) which I believe may be the root cause of the issue - the contributions side doesnt have the ExploreFragment from which to draw the menu in question, the contribution side only has ContributionsFragment, ContributionsListFragment and LeaderboardFragment when setting up the MediaDetailPager
This is the first time I'm looking at this code base so let me know if my understanding is off
@DamienBradleyDSP Thanks a lot for the investigation! Please do not hesitate to send a pull request, if it solves the issue we will probably merge it :-)
@DamienBradleyDSP Thanks a lot for the investigation! Please do not hesitate to send a pull request, if it solves the issue we will probably merge it :-)
Well the reason I haven't is that I'd guess that the code needs a bit of a rewrite so that the mediadetailfragment is made inside of an explore fragment - or contributions is made inside the explore fragment. I'm not sure on the solution in that respect, I'm unable to hack together a solution with the architecture there at present
Had another look at this and it was simpler than I first thought - I have enabled the explore options menu for ProfileActivity so this should now be functional with the leaderboard
I had to disable certain option menu items appearing in ContributionsFragment -> within the fragment it checks if the activity is MainActivity and if not doesn't display the notifications / cloud button
Is this issue solved now? Else I will look into it.