mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-31 15:08:21 +01:00
Add ads limit (#1662)
This commit is contained in:
parent
a59d10b6c1
commit
fcc71c0d5f
@ -699,6 +699,7 @@
|
|||||||
<string name="pref_ads_privacy_agree">Agree</string>
|
<string name="pref_ads_privacy_agree">Agree</string>
|
||||||
<string name="pref_ads_privacy_link">Privacy policy</string>
|
<string name="pref_ads_privacy_link">Privacy policy</string>
|
||||||
<string name="pref_ads_loading">Ad is loading</string>
|
<string name="pref_ads_loading">Ad is loading</string>
|
||||||
|
<string name="pref_ads_once_per_visit">Thank you for your support, come back later for more ads</string>
|
||||||
|
|
||||||
<string name="pref_settings_advanced_title">Advanced</string>
|
<string name="pref_settings_advanced_title">Advanced</string>
|
||||||
<string name="pref_settings_appearance_title">Appearance & Behavior</string>
|
<string name="pref_settings_appearance_title">Appearance & Behavior</string>
|
||||||
|
@ -68,6 +68,13 @@ class AdsFragment : PreferenceFragmentCompat(), MainView.TitledView, AdsView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun showWatchAdOncePerVisit(show: Boolean) {
|
||||||
|
findPreference<Preference>(getString(R.string.pref_key_ads_single_support))?.run {
|
||||||
|
isEnabled = !show
|
||||||
|
summary = if (show) getString(R.string.pref_ads_once_per_visit) else null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun showError(text: String, error: Throwable) {
|
override fun showError(text: String, error: Throwable) {
|
||||||
(activity as? BaseActivity<*, *>)?.showError(text, error)
|
(activity as? BaseActivity<*, *>)?.showError(text, error)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,10 @@ class AdsPresenter @Inject constructor(
|
|||||||
.onFailure(errorHandler::dispatch)
|
.onFailure(errorHandler::dispatch)
|
||||||
.onSuccess { it?.let { view?.showAd(it) } }
|
.onSuccess { it?.let { view?.showAd(it) } }
|
||||||
|
|
||||||
view?.showLoadingSupportAd(false)
|
view?.run {
|
||||||
|
showLoadingSupportAd(false)
|
||||||
|
showWatchAdOncePerVisit(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,4 +14,6 @@ interface AdsView : BaseView {
|
|||||||
fun openPrivacyPolicy()
|
fun openPrivacyPolicy()
|
||||||
|
|
||||||
fun showLoadingSupportAd(show: Boolean)
|
fun showLoadingSupportAd(show: Boolean)
|
||||||
|
|
||||||
|
fun showWatchAdOncePerVisit(show: Boolean)
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user