aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-02-23 16:06:45 -0800
committerAllan Wang <me@allanwang.ca>2020-02-23 16:06:45 -0800
commitc8b54fd10a08ed53eb7d21578a4fe990fe14e3bc (patch)
tree0841d112c8c00504ce10ca72ef39e403b69c595c /app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
parent4d5aaf541dbfa7d521ebbc5f011a642c83c4b9c5 (diff)
downloadfrost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.gz
frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.bz2
frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.zip
Move prefs to service locator
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
index edbe7682..423eda97 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
@@ -17,18 +17,25 @@
package com.pitchedapps.frost.utils
import ca.allanwang.kau.kpref.KPref
+import ca.allanwang.kau.kpref.KPrefFactory
+import com.pitchedapps.frost.BuildConfig
+import org.koin.dsl.module
/**
* Created by Allan Wang on 2017-07-03.
*
* Showcase prefs that offer one time helpers to guide new users
*/
-object Showcase : KPref() {
+class Showcase(factory: KPrefFactory) : KPref("${BuildConfig.APPLICATION_ID}.showcase", factory) {
// check if this is the first time launching the web overlay; show snackbar if true
val firstWebOverlay: Boolean by kprefSingle("first_web_overlay")
val intro: Boolean by kprefSingle("intro_pages")
- override fun deleteKeys() = arrayOf("shown_release", "experimental_by_default")
+ companion object {
+ fun module() = module {
+ single { Showcase(get()) }
+ }
+ }
}