Improve credit line in image list #6295
Merged
+363
−81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (required)
Fixes #6264 and #5030
I replaced the credit line in the list of images (in contribution, explore, etc) with 3 kinds of text, in order to resolve [Bug]: Uploaded by shows what's in the source/author field, not the upload #6264 (comment)
I added mechanism to retrieve creator value, when needed & available. This is to resolve Author field shows HTML tags when template used #5030 and used when HTML parsing of the author field fails. (More on this below.)
Because structured data requires additional HTTP requests, I took this approach:
Tests performed (required)
I mostly used an API 35 emulator with betaDebug and prodDebug. I briefly tested with Pixel 3 and prodDebug, too.
For BetaDebug: I removed the author values from file pages, and added "author" values in structured data. (Its P253075 on Beta Cluter.) The latter was shown in the contributions activity.
For ProdDebug: # 3 Featured Picture is "Blackspotted puffer (''Arothron nigropunctatus''), Anilao, Philippines". Its credit line contained an HTML fragment. It now shows "Diego Delso". (I added the creator value into the structured data.)
Screenshots (for UI changes only)
Remaining tasks to be resolved:
Less critical concerns:
ContributionViewHolder
andPagedMediaAdapter
is not ideal. Not happy with more parameters being passed around toContributionViewHolder
. To resolve this, I think a large refactoring in the surrounding code is necessary. (A new ViewModel might help?)Media
is getting large. Do we want to keep adding parameters to it?