Added link sharing functionality (#103) #127
Closed
+104
−3
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.
Hi,
I've decided to add "Share link" functionality, raised in issue #103. I know there is already a possibility to share any link from the entry by long-pressing it. Still, this functionality is not very obvious (I've learned about it from the code even though I was using the app for some time), and I thought a separate "Share" button could be useful.
The implementation is based on downloading the dictionary entry in the background and searching for an anchor tag with
id="view-online-link"
. All dictionaries made out of MediaWiki have an original link with such id. From what I've seen in the dictionaries list, most of them are from MediaWiki pages, and those that aren't, don't contain any other reference to the original. Of course, if, with some time, slob files would keep a reference to the original resource, it can be rewritten, but from what I've found out while using the Python's slob tool, dictionaries don't keep such metadata for entries.I hope you like it, and if you have any comments on the code, I can fix it (I haven't programmed in Java for years, so I could do something wrong).