-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Add embed webview for Android #50440
Conversation
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
Flaky tests detected in 50b6f41. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4928801336
|
f2580b7
to
8fbeb8c
Compare
Fix renaming --ammend
4c3ead4
to
46d29ff
Compare
@Override | ||
public void onPageStarted(WebView view, String url, Bitmap favicon) { | ||
// Center the embed with a black background; | ||
String css = "body{margin:0;background:#000;display:flex;align-items:center;}"; |
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.
The fullscreen preview on iOS has a black background by default so there is no need to check the user theme preference .
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.
@jhnstn Tested via wordpress-mobile/WordPress-Android#18383 (review). I added some comments but shouldn't block the PR.
Not sure how feasible would be but it would be great automatically play the video once the WebView is launched. I found it a bit weird that you have to tap two times on the play button to actually play the video. WDYT? I wouldn't consider this a blocker but an interesting QoL to incorporate.
.../react-native-bridge/src/main/java/org/wordpress/mobile/WPAndroidGlue/WPAndroidGlueCode.java
Outdated
Show resolved
Hide resolved
...main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/GutenbergEmbedWebViewActivity.java
Outdated
Show resolved
Hide resolved
Thanks for the reviews @fluiddot !
I had a similar thought about the autoplay. I know we can trigger a play event via VideoPress and it seems fairly straight forward to inject JS into the WebView. I didn't explore that in the interest of getting a MVP working. I can look into that as a follow up. |
These are no longer overriden in the main Android app
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.
Tested via wordpress-mobile/WordPress-Android#18383 (review). Since I spotted some issues there, I'll hold the approval until we tackle them.
0280d01
to
50b6f41
Compare
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.
Approved via wordpress-mobile/WordPress-Android#18383 (review).
@fluiddot you can ignore the re-request to review. I meant to re-request a different PR |
What?
Fixes wordpress-mobile/gutenberg-mobile#5509
Adds a full screen embed preview for Android.
Depends on:
Related:
Why?
The
react-native-webview
on Android has event propagation issues when nested inside aPressable
component. As a work around we need an Android WebView to render interactive embed content.How?
Adds a new Android Activity to render embed content in a native WebView.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast