-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paywalls
: PaywallDialogOptions
no longer requires dismissRequest
#1386
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,24 +38,26 @@ fun PaywallDialog( | |
} | ||
} | ||
if (shouldDisplayDialog) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking, since we are going to be handling the visibility ourselves, we should remember this parameter through configuration changes. For example, when going between portrait/landscape, changing dark mode or locale,... I haven't tested it but if I'm not wrong, currently, if we display the paywall, the user dismisses it, and then there is one of those configuration changes, it would reappear. I think we probably want to avoid that by making that state survive configuration changes. One of the options is to use rememberSaveable, instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a really good point. I just read about the difference and that makes sense 👍🏻 |
||
val dismissRequest = { shouldDisplayDialog = false } | ||
|
||
Dialog( | ||
onDismissRequest = paywallDialogOptions.dismissRequest, | ||
onDismissRequest = dismissRequest, | ||
properties = DialogProperties(usePlatformDefaultWidth = shouldUsePlatformDefaultWidth()), | ||
) { | ||
DialogScaffold(paywallDialogOptions) | ||
DialogScaffold(paywallDialogOptions.toPaywallOptions(dismissRequest)) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
private fun DialogScaffold(paywallDialogOptions: PaywallDialogOptions) { | ||
private fun DialogScaffold(paywallOptions: PaywallOptions) { | ||
Scaffold(modifier = Modifier.fillMaxSize()) { paddingValues -> | ||
Box( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(paddingValues), | ||
) { | ||
Paywall(paywallDialogOptions.toPaywallOptions()) | ||
Paywall(paywallOptions) | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done by
PaywallViewModelImpl
now.