Simple-Thank-You/app/src/main/kotlin/com/simplemobiletools/thankyou/helpers/Config.kt

19 lines
657 B
Kotlin

package com.simplemobiletools.thankyou.helpers
import android.content.Context
import com.simplemobiletools.commons.helpers.BaseConfig
import kotlinx.coroutines.flow.Flow
class Config(context: Context) : BaseConfig(context) {
companion object {
const val HIDE_LAUNCHER_ICON = "hide_launcher_icon"
fun newInstance(context: Context) = Config(context)
}
var hideLauncherIcon: Boolean
get() = prefs.getBoolean(HIDE_LAUNCHER_ICON, false)
set(hideLauncherIcon) = prefs.edit().putBoolean(HIDE_LAUNCHER_ICON, hideLauncherIcon).apply()
val hideLauncherIconFlow: Flow<Boolean> = ::hideLauncherIcon.asFlowNonNull()
}