Disable in-app ads

This commit is contained in:
Lucas Lima 2020-12-18 17:43:51 -03:00
parent 2e43f957cd
commit 0bedf5e6de
No known key found for this signature in database
GPG key ID: 049CCC5A365B00D2
4 changed files with 14 additions and 7 deletions

View file

@ -930,15 +930,19 @@ class GameActivity : ThematicActivity(R.layout.activity_game), DialogInterface.O
}
private fun refreshAds() {
val isTutorialComplete = preferencesRepository.isTutorialCompleted()
if (isTutorialComplete && !preferencesRepository.isPremiumEnabled() && billingManager.isEnabled()) {
if (!instantAppManager.isEnabled(this)) {
navigationView.menu.setGroupVisible(R.id.remove_ads_group, true)
ad_placeholder.visibility = View.VISIBLE
ad_placeholder.loadAd()
if (featureFlagManager.isInAppAdsEnabled()) {
val isTutorialComplete = preferencesRepository.isTutorialCompleted()
if (isTutorialComplete && !preferencesRepository.isPremiumEnabled() && billingManager.isEnabled()) {
if (!instantAppManager.isEnabled(this)) {
navigationView.menu.setGroupVisible(R.id.remove_ads_group, true)
ad_placeholder.visibility = View.VISIBLE
ad_placeholder.loadAd()
}
} else {
navigationView.menu.setGroupVisible(R.id.remove_ads_group, false)
ad_placeholder.visibility = View.GONE
}
} else {
navigationView.menu.setGroupVisible(R.id.remove_ads_group, false)
ad_placeholder.visibility = View.GONE
}
}

View file

@ -3,4 +3,5 @@ package dev.lucasnlm.external
interface IFeatureFlagManager {
fun isGameHistoryEnabled(): Boolean
fun isRateUsEnabled(): Boolean
fun isInAppAdsEnabled(): Boolean
}

View file

@ -3,4 +3,5 @@ package dev.lucasnlm.external
class FeatureFlagManager : IFeatureFlagManager {
override fun isGameHistoryEnabled(): Boolean = true
override fun isRateUsEnabled(): Boolean = false
override fun isInAppAdsEnabled(): Boolean = false
}

View file

@ -3,4 +3,5 @@ package dev.lucasnlm.external
class FeatureFlagManager : IFeatureFlagManager {
override fun isGameHistoryEnabled(): Boolean = false
override fun isRateUsEnabled(): Boolean = true
override fun isInAppAdsEnabled(): Boolean = false
}