apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Add report menu for Leaderboard

Open misaochan opened this issue 3 years ago • 5 comments

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.

misaochan avatar Aug 05 '22 09:08 misaochan

Actually, I am not sure why the whole menu (which can be seen via Explore) is missing. Looks like a bug I would say. 🙂

nicolas-raoul avatar Aug 06 '22 05:08 nicolas-raoul

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 avatar Aug 09 '22 13:08 DamienBradleyDSP

@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 :-)

nicolas-raoul avatar Aug 09 '22 13:08 nicolas-raoul

@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

DamienBradleyDSP avatar Aug 09 '22 13:08 DamienBradleyDSP

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

DamienBradleyDSP avatar Oct 10 '22 16:10 DamienBradleyDSP

Is this issue solved now? Else I will look into it.

glitched-sudhanshu avatar Oct 22 '22 11:10 glitched-sudhanshu