Skip to content

Commit

Permalink
Merge pull request #123 from mbakgun/master
Browse files Browse the repository at this point in the history
feature/full-screen-webview
  • Loading branch information
mbakgun authored Mar 13, 2024
2 parents 57bc7c7 + c710acd commit 76593b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ open class Builder internal constructor() {
var animateCornerRadiusWhenExpand: Boolean = false
var onDialogDismissListener: ((DialogFragment) -> Unit)? = null
var cornerRadius: Float? = null
var isFullHeightWebView: Boolean = false
}

open class InfoDialogBuilder internal constructor() : Builder() {
Expand Down Expand Up @@ -56,6 +57,7 @@ open class InfoDialogBuilder internal constructor() : Builder() {
contentTextPosition = it.contentTextPosition,
webViewContent = it.webViewContent,
webViewBuilder = it.webViewBuilder,
isFullHeightWebView = it.isFullHeightWebView
).toBundle()
this.closeButtonListener = it.closeButtonListener ?: { }
this.onDismissListener = it.onDialogDismissListener ?: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ class DialogFragment internal constructor() : BaseBottomSheetDialog() {
dialogArguments.webViewBuilder?.invoke(webViewContent)

loadWebViewContent(viewState.webViewContent)
if (dialogArguments.isFullHeightWebView) {
binding.webViewContent.layoutParams.height =
resources.displayMetrics.heightPixels
}
}
}
with(editTextSearch) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class DialogFragmentArguments(
val webViewBuilder: (WebView.() -> Unit)? = null,
val infoListItems: List<Pair<CharSequence, CharSequence>>? = null,
val itemDividers: List<ItemDivider> = emptyList(),
val isFullHeightWebView : Boolean = false
) : Parcelable {

fun toBundle() = bundleOf("ARGUMENTS" to this)
Expand Down

0 comments on commit 76593b8

Please sign in to comment.