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 17:50:22 -0800
committerGitHub <noreply@github.com>2020-02-23 17:50:22 -0800
commit654cc6b943177120dc1a0a22a0d68d5cbfde2b5e (patch)
tree3bba2feb0cf99ae222693a4d564d9acf624322e2 /app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
parent4d5aaf541dbfa7d521ebbc5f011a642c83c4b9c5 (diff)
parent1686de0d71d687990ca6f0d4b621bc4d52dee146 (diff)
downloadfrost-654cc6b943177120dc1a0a22a0d68d5cbfde2b5e.tar.gz
frost-654cc6b943177120dc1a0a22a0d68d5cbfde2b5e.tar.bz2
frost-654cc6b943177120dc1a0a22a0d68d5cbfde2b5e.zip
Merge pull request #1647 from AllanWang/kpref
Remove stateful singletons
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()) }
+ }
+ }
}