From 7adcefcb9ea88cac9193ded9fc43cd8025ce6246 Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Thu, 29 Aug 2024 22:51:18 +0200 Subject: [PATCH 1/2] feat(android): webview fill property --- .../ti/modules/titanium/ui/widget/webview/TiUIWebView.java | 4 ++++ apidoc/Titanium/UI/WebView.yml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java index e7099c1dee4..dbfa831b43d 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java @@ -375,6 +375,10 @@ public TiUIWebView(TiViewProxy proxy) TiCompositeLayout.LayoutParams params = getLayoutParams(); params.autoFillsHeight = true; params.autoFillsWidth = true; + if (proxy.hasProperty(TiC.LAYOUT_FILL) && TiConvert.toBoolean(proxy.getProperty(TiC.LAYOUT_FILL), false)) { + params.height = TiCompositeLayout.LayoutParams.MATCH_PARENT; + params.width = TiCompositeLayout.LayoutParams.MATCH_PARENT; + } setNativeView(webView); } diff --git a/apidoc/Titanium/UI/WebView.yml b/apidoc/Titanium/UI/WebView.yml index 3b447f95fb3..cf55f904a76 100644 --- a/apidoc/Titanium/UI/WebView.yml +++ b/apidoc/Titanium/UI/WebView.yml @@ -1027,6 +1027,13 @@ properties: since: "1.8.0" default: true + - name: fill + summary: If `true` the body inside the WebView will have a height by default + type: Boolean + platforms: [android] + since: "12.6.0" + default: false + - name: mixedContentMode summary: If `true`, allows the loading of insecure resources from a secure origin. description: | From 9072825e2da2aa477034019a86f49049ef6372c6 Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Sat, 9 Nov 2024 19:56:26 +0100 Subject: [PATCH 2/2] make it the default --- .../ti/modules/titanium/ui/widget/webview/TiUIWebView.java | 6 ++---- apidoc/Titanium/UI/WebView.yml | 7 ------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java index dbfa831b43d..ef191355591 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java @@ -375,10 +375,8 @@ public TiUIWebView(TiViewProxy proxy) TiCompositeLayout.LayoutParams params = getLayoutParams(); params.autoFillsHeight = true; params.autoFillsWidth = true; - if (proxy.hasProperty(TiC.LAYOUT_FILL) && TiConvert.toBoolean(proxy.getProperty(TiC.LAYOUT_FILL), false)) { - params.height = TiCompositeLayout.LayoutParams.MATCH_PARENT; - params.width = TiCompositeLayout.LayoutParams.MATCH_PARENT; - } + params.height = TiCompositeLayout.LayoutParams.MATCH_PARENT; + params.width = TiCompositeLayout.LayoutParams.MATCH_PARENT; setNativeView(webView); } diff --git a/apidoc/Titanium/UI/WebView.yml b/apidoc/Titanium/UI/WebView.yml index cf55f904a76..3b447f95fb3 100644 --- a/apidoc/Titanium/UI/WebView.yml +++ b/apidoc/Titanium/UI/WebView.yml @@ -1027,13 +1027,6 @@ properties: since: "1.8.0" default: true - - name: fill - summary: If `true` the body inside the WebView will have a height by default - type: Boolean - platforms: [android] - since: "12.6.0" - default: false - - name: mixedContentMode summary: If `true`, allows the loading of insecure resources from a secure origin. description: |