-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview support via Sailfish.WebView
#8
base: main
Are you sure you want to change the base?
Conversation
Thank you! It looks very good on a quick glance but I haven't tested it yet.
That's ok. A real enum would need C++ code and I'd prefer to keep this module as light weight as possible.
Maybe but not really necessary, I think. It can be implemented later if the need arises.
I think adding a note at the bottom of the page would be a good idea. I don't want apps to do any network access without explicit user interaction, and accidentally swiping could load a link that the user didn't want to load. Some more nitpicks:
Again, thank you for your effort! It's a really nice addition to the module! :) |
Hello!
Didn't really understand the question. I believe this method can check the network type. But in the current implementation it only checks if SailfishOS itself thinks if the device is online, and doesn't check what the network type is. I think SailfishOS UI (lipstick) itself uses same method as here.
Okay, I'll do that.
I'll think about that and add a note like you suggested or something else. Once I'll finish everything you suggested, I'll comment here. |
This reverts commit ca21f5d.
README.md
Outdated
@@ -34,6 +34,19 @@ Label { | |||
} | |||
``` | |||
|
|||
## Permissions | |||
|
|||
Some permissions are required for WebView-based preview support in this module to work in Sailjail. This only affects apps intended for the Harbour store that show local video files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"that show local video files" copy-paste oops ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, missed that!
I finished everything you suggested. But I just found another issue with this: it shows previews for URLs like phone numbers which is pointless because preview does the same thing as the button. Please wait for me to add a fix for this before merging the PR. |
Hello again, I fixed that issue and also added an animation for the preview indication label. The PR is ready to be merged, everything is fixed. |
Thank you @roundedrectangle, nice job! I'll be traveling the next few days but I will review it once I'm back! |
The PR is done and ready to be merged. The main change for the user is in the function. It now has a new argument
previewType
which can be set from enumerationLinkPreviewType
. It accepts:Internally, it also loads the webview only once the attached page with it is opened, destroys it when the page is closed
However there are still some things which could be improved (they aren't that important):
LinkPreviewType
is not a real enumerationprivate
folder isn't as clean as it could be ideally