Fixed lock warning on NONE and RANDOM popup effects

This commit is contained in:
partisan 2025-05-28 16:14:42 +02:00
parent 3fa2bc38ab
commit 4c9b0a1b22
4 changed files with 10 additions and 4 deletions

View file

@ -133,7 +133,11 @@ class PopupSettingsFragment : Fragment() {
binding.popupEffectSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>, view: View?, position: Int, id: Long) {
val selectedEffect = allEffects[position]
if (!prefs.isDonationActivated && selectedEffect !in prefs.getAvailablePopupEffects()) {
if (!prefs.isDonationActivated &&
selectedEffect !in prefs.getAvailablePopupEffects() &&
selectedEffect != Preferences.PopupEffect.NONE &&
selectedEffect != Preferences.PopupEffect.RANDOM
) {
Toast.makeText(requireContext(), getString(R.string.donate_lock), Toast.LENGTH_SHORT).show()
binding.popupEffectSpinner.setSelection(prefs.popupEffect.ordinal)
} else {