From b5f4fb9562b598d20c084189a244890d7fea3aae Mon Sep 17 00:00:00 2001 From: "erol.aksoy" Date: Tue, 28 Jun 2022 09:39:20 +0300 Subject: [PATCH] Add dismissListener to builder --- .../main/java/com/trendyol/uicomponents/dialogs/Builder.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/Builder.kt b/libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/Builder.kt index 51278c11..14e42e52 100644 --- a/libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/Builder.kt +++ b/libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/Builder.kt @@ -13,6 +13,7 @@ open class Builder internal constructor() { var showCloseButton: Boolean = false var closeButtonListener: ((DialogFragment) -> Unit)? = null var animateCornerRadiusWhenExpand: Boolean = false + var onDialogDismissListener: ((DialogFragment) -> Unit)? = null var cornerRadius: Float? = null } @@ -50,6 +51,7 @@ open class InfoDialogBuilder internal constructor() : Builder() { webViewBuilder = it.webViewBuilder, ).toBundle() this.closeButtonListener = it.closeButtonListener ?: { } + this.onDismissListener = it.onDialogDismissListener ?: {} } } } @@ -81,6 +83,7 @@ open class AgreementDialogBuilder internal constructor() : InfoDialogBuilder() { closeButtonListener = it.closeButtonListener rightButtonClickListener = it.rightButtonClickListener leftButtonClickListener = it.leftButtonClickListener + this.onDismissListener = it.onDialogDismissListener ?: {} } } } @@ -125,6 +128,7 @@ class SelectionDialogBuilder internal constructor() : InfoDialogBuilder() { closeButtonListener = it.closeButtonListener onItemSelectedListener = it.onItemSelectedListener onItemReselectedListener = it.onItemReselectedListener + this.onDismissListener = it.onDialogDismissListener ?: {} } } @@ -153,6 +157,7 @@ class InfoListDialogBuilder internal constructor() : InfoDialogBuilder() { itemDividers = it.itemDividers ).toBundle() closeButtonListener = it.closeButtonListener + this.onDismissListener = it.onDialogDismissListener ?: {} } }