From 2caa8e75a3b40a99d236a5b9b07fe26f5423cbf6 Mon Sep 17 00:00:00 2001 From: Skoften Date: Mon, 9 Dec 2019 15:37:09 +0100 Subject: [PATCH] Update TiWebChromeClient.java add progress event --- .../titanium/ui/widget/webview/TiWebChromeClient.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java index df695b1d2e0..018551da6db 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java @@ -100,6 +100,16 @@ public void onClick(DialogInterface dialog, int which) return true; } + public void onProgressChanged(WebView view, int progress) + { + WebViewProxy proxy = (WebViewProxy) tiWebView.getProxy(); + if (proxy != null) { + KrollDict data = new KrollDict(); + data.put("progress", progress); + proxy.fireEvent("progress", data); + } + } + // This exposes onCreateWindow to JS with a similar API to Android: // If the end-developer sets the 'onCreateWindow' property of the WebViewProxy // to a callback function, then it gets executed when a new window is created