Given the lengthy community discussion here: https://www.mediawiki.org/wiki/Wikimedia_Apps/Share_a_fact, it is currently misleading (and problematic in some regions) to have share a fact cards rendering a default CC by SA for all cards, regardless of the actual image license. We need to extract exact license info from https://www.mediawiki.org/wiki/API:Imageinfo.
@Vibhabamba, the extracted license would replace the existing current CC by SA field?
- Use one of the three license icons we use in Gallery (cc, pd, free).
- Once the user enters the share preview screen, we initially disable the share as image button, (possibly show a progress bar?), fetch the license info, then reenable the button.
- The preview doesn't need to have the license icon yet, but the final image which will be shared must have it.
We already have image gallery code that parses the license type into those three categories: GalleryItem and GalleryItemFetchTask. We just reuse those.
Suggestion to refactor: move GalleryActivity.getLicenseIcon(GalleryItem item) to GalleryItem.getLicenseIcon(), and make public.
SnippetImage: We remove the call of drawLicenseIcons() from createImage(). But will have a public method we can call later to draw one of the other three icons. (Will need to save the location of the icon in the canvas as instance var.)
We disable the "Share as image" button by default.
We extend GalleryItemFetchTask to add the extra UI code to enable the "Share as image" button and also update the SnippetImage to include one of the license icons. (It would be nice to update the preview as well.)
Care should be given to cancel the GalleryItemFetchTask when the PreviewDialog gets dismissed.
Extra requests take time and can fail. I'm not sure what we should do in the failure case yet.
It would be nice if there was a default icon we could use. But as far as I understand this there is no default icon.
We could keep the "Share as image" button disabled in that case. The user would have to go back to try again manually.
-> It would be good to have some progress indication for the user.
The hope is that in the future this information can be provided by the mobileapps content service in the page load request, next to the lead image info.
Cleanup: R.drawable.cc_by_sa_white (png + svg) can be removed since it's not used anywhere else.