Add "share at current time" button to the main video player #2271
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.
The button is placed in the upper right corner, under "more settings". No changes has been made to the popup video player (as for other things, there is no space for a share button).
The share button generates this text (for the video above at the current time):
This implements #2000, but it does not give a chance of choosing whether to share the url normally or to at the current time. But as discussed in #2000 this is not a problem because there are already many other ways to do that.
The share utilities (i.e.
shareUrl()
andopenUrlInBrowser()
) were placed under the BaseStateFragment class. But since they have nothing to do with fragments, I moved them to a separate utilities class:utils.ShareUtils
. This way they can be accessed from anywhere. I could not find any way to access them from the MainVideoPlayer, using the previous setup.I tested the feature both from a phone (Huawei P9 lite, where the used layout is normal) and from a tablet (Amazon Kindle, where the layout is large-land, I think). Also, since I moved the sharing functions, I tested the "share" buttons in the app and they work as they did before.
Please note that this is my first pull request ever, so if I did something wrong I'm sorry :-)