Skip to content

Commit fae4f9c

Browse files
author
mert.yuksel
committed
Update README.md
1 parent 0aacc8f commit fae4f9c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

libraries/dialogs/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,35 @@ Sample usage:
6161
}.show(supportFragmentManager)
6262
```
6363

64+
** Configuring WebView:**
65+
To configure the WebView instance of the dialog, you can call the DialogFragment's function named show,
66+
which takes WebViewDownloadConfigurator and WebViewConfigurator objects as parameters.
67+
These objects must extend Fragments.
68+
69+
These passed objects will be used to configure the webview instance of the dialog.
70+
See the sample usage below:
71+
```kotlin
72+
infoDialog {
73+
title = "Info Dialog with WebView Download Listener"
74+
webViewContent = WebViewContent.UrlContent("https://github.com/Trendyol")
75+
showContentAsHtml = true
76+
titleTextColor = CardInputViewR.color.civ_error_stroke
77+
showCloseButton = true
78+
}.showDialog(
79+
fragmentManager = supportFragmentManager,
80+
webViewConfigurator = WebViewJavascriptEnabler(),
81+
downloadConfigurator = null
82+
)
83+
84+
class WebViewJavascriptEnabler : WebViewConfigurator, Fragment() {
85+
86+
override fun configureWebView(webView: WebView) {
87+
webView.settings.javaScriptEnabled = true
88+
}
89+
}
90+
```
91+
```kotlin
92+
6493
* Agreement Dialog:
6594

6695
Dialog with buttons on bottom. You can show 2 buttons at the bottom or just one button.

0 commit comments

Comments
 (0)