Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9df37a26 authored by tibbi's avatar tibbi
Browse files

check if the user ever had Thank You installed before showing the donate dialog

parent d77840fd
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -82,10 +82,15 @@ fun Activity.appLaunched() {
    baseConfig.internalStoragePath = getInternalStoragePath()
    updateSDCardPath()
    baseConfig.appRunCount++
    if (!isThankYouInstalled() && (baseConfig.appRunCount % 50 == 0)) {

    if (!baseConfig.hadThankYouInstalled) {
        if (isThankYouInstalled()) {
            baseConfig.hadThankYouInstalled = true
        } else if (baseConfig.appRunCount % 50 == 0) {
            DonateDialog(this)
        }
    }
}

@SuppressLint("InlinedApi")
fun Activity.isShowingSAFDialog(path: String, treeUri: String, requestCode: Int): Boolean {
+4 −0
Original line number Diff line number Diff line
@@ -155,4 +155,8 @@ open class BaseConfig(val context: Context) {
    var sorting: Int
        get() = prefs.getInt(SORT_ORDER, context.resources.getInteger(R.integer.default_sorting))
        set(sorting) = prefs.edit().putInt(SORT_ORDER, sorting).apply()

    var hadThankYouInstalled: Boolean
        get() = prefs.getBoolean(HAD_THANK_YOU_INSTALLED, false)
        set(hadThankYouInstalled) = prefs.edit().putBoolean(HAD_THANK_YOU_INSTALLED, hadThankYouInstalled).apply()
}
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ const val SHOW_INFO_BUBBLE = "show_info_bubble"
const val LAST_CONFLICT_RESOLUTION = "last_conflict_resolution"
const val LAST_CONFLICT_APPLY_TO_ALL = "last_conflict_apply_to_all"
const val AVOID_WHATS_NEW = "avoid_whats_new"
const val HAD_THANK_YOU_INSTALLED = "had_thank_you_installed"

// licenses
const val LICENSE_KOTLIN = 1