Update instant app (#200)

This commit is contained in:
Lucas Nunes 2020-10-19 09:51:23 -03:00 committed by GitHub
parent 835ee03af5
commit f0aecf26db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,12 +59,8 @@ class SupportAppDialogFragment : AppCompatDialogFragment() {
setView(view)
if (isInstantMode) {
setNeutralButton(R.string.no) { _, _ ->
analyticsManager.sentEvent(Analytics.DenyIapDialog)
}
val unlockMessage = context.getString(R.string.try_it)
setPositiveButton("$unlockMessage \uD83C\uDF9E") { _, _ ->
setNeutralButton("$unlockMessage \uD83C\uDF9E") { _, _ ->
activity?.let {
if (!it.isFinishing) {
adsManager.requestRewarded(
@ -82,6 +78,14 @@ class SupportAppDialogFragment : AppCompatDialogFragment() {
}
}
}
setPositiveButton(R.string.unlock_all) { _, _ ->
lifecycleScope.launch {
preferenceRepository.setShowSupport(false)
analyticsManager.sentEvent(Analytics.UnlockIapDialog)
billingManager.charge(requireActivity())
}
}
} else {
if (targetThemeId != -1L) {
val unlockMessage = context.getString(R.string.try_it)