Update code
This commit is contained in:
parent
cfb444b8d6
commit
ef819114c4
1 changed files with 8 additions and 6 deletions
|
@ -172,15 +172,17 @@ class EndGameDialogFragment : AppCompatDialogFragment() {
|
||||||
if (!preferencesRepository.isPremiumEnabled() && !instantAppManager.isEnabled(context)) {
|
if (!preferencesRepository.isPremiumEnabled() && !instantAppManager.isEnabled(context)) {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
adsView.visibility = View.VISIBLE
|
adsView.visibility = View.VISIBLE
|
||||||
removeAdsButton.visibility = View.VISIBLE
|
|
||||||
val label = context.getString(R.string.remove_ad)
|
val label = context.getString(R.string.remove_ad)
|
||||||
val price = billingManager.getPrice().singleOrNull()
|
val price = billingManager.getPrice().singleOrNull()
|
||||||
val unlockLabel = price?.let { "$label - $it" } ?: label
|
val unlockLabel = price?.let { "$label - $it" } ?: label
|
||||||
removeAdsButton.text = unlockLabel
|
removeAdsButton.apply {
|
||||||
removeAdsButton.setOnClickListener {
|
visibility = View.VISIBLE
|
||||||
lifecycleScope.launch {
|
text = unlockLabel
|
||||||
billingManager.charge(activity)
|
setOnClickListener {
|
||||||
adsView.visibility = View.GONE
|
lifecycleScope.launch {
|
||||||
|
billingManager.charge(activity)
|
||||||
|
adsView.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue