From 00bc96d115879c841fc47242271db3761d19f746 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Mon, 4 Mar 2024 12:13:42 -0300 Subject: [PATCH] feat(android): add WryActivity::onWebViewCreate hook (#1179) --- .changes/wry-activity-webview-getter.md | 5 +++++ src/android/kotlin/WryActivity.kt | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changes/wry-activity-webview-getter.md diff --git a/.changes/wry-activity-webview-getter.md b/.changes/wry-activity-webview-getter.md new file mode 100644 index 000000000..3c95812b2 --- /dev/null +++ b/.changes/wry-activity-webview-getter.md @@ -0,0 +1,5 @@ +--- +"wry": patch +--- + +Added `WryActivity::onWebViewCreate(android.webkit.WebView)` on Android. diff --git a/src/android/kotlin/WryActivity.kt b/src/android/kotlin/WryActivity.kt index 8fb4e4950..1ed332f9f 100644 --- a/src/android/kotlin/WryActivity.kt +++ b/src/android/kotlin/WryActivity.kt @@ -15,8 +15,11 @@ import androidx.appcompat.app.AppCompatActivity abstract class WryActivity : AppCompatActivity() { private lateinit var mWebView: RustWebView + open fun onWebViewCreate(webView: WebView) { } + private fun setWebView(webView: RustWebView) { mWebView = webView + onWebViewCreate(webView) } val version: String