Skip to content

Commit 76593b8

Browse files
authored
Merge pull request #123 from mbakgun/master
feature/full-screen-webview
2 parents 57bc7c7 + c710acd commit 76593b8

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/Builder.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ open class Builder internal constructor() {
1919
var animateCornerRadiusWhenExpand: Boolean = false
2020
var onDialogDismissListener: ((DialogFragment) -> Unit)? = null
2121
var cornerRadius: Float? = null
22+
var isFullHeightWebView: Boolean = false
2223
}
2324

2425
open class InfoDialogBuilder internal constructor() : Builder() {
@@ -56,6 +57,7 @@ open class InfoDialogBuilder internal constructor() : Builder() {
5657
contentTextPosition = it.contentTextPosition,
5758
webViewContent = it.webViewContent,
5859
webViewBuilder = it.webViewBuilder,
60+
isFullHeightWebView = it.isFullHeightWebView
5961
).toBundle()
6062
this.closeButtonListener = it.closeButtonListener ?: { }
6163
this.onDismissListener = it.onDialogDismissListener ?: {}

libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/DialogFragment.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ class DialogFragment internal constructor() : BaseBottomSheetDialog() {
196196
dialogArguments.webViewBuilder?.invoke(webViewContent)
197197

198198
loadWebViewContent(viewState.webViewContent)
199+
if (dialogArguments.isFullHeightWebView) {
200+
binding.webViewContent.layoutParams.height =
201+
resources.displayMetrics.heightPixels
202+
}
199203
}
200204
}
201205
with(editTextSearch) {

libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/DialogFragmentArguments.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class DialogFragmentArguments(
4040
val webViewBuilder: (WebView.() -> Unit)? = null,
4141
val infoListItems: List<Pair<CharSequence, CharSequence>>? = null,
4242
val itemDividers: List<ItemDivider> = emptyList(),
43+
val isFullHeightWebView : Boolean = false
4344
) : Parcelable {
4445

4546
fun toBundle() = bundleOf("ARGUMENTS" to this)

0 commit comments

Comments
 (0)