aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-04 11:13:47 -0700
committerAllan Wang <me@allanwang.ca>2017-07-04 11:13:47 -0700
commit4cf368be0cd2f179485b05a3d2cd9b7bc236ba8e (patch)
treedec58af06d220ba80920fcf9c816b71413c61108 /app/src/main/kotlin
parent43885c6c063a76738ed7220aba619e47db7c4080 (diff)
parentd6c5bcd56e293eaf281663b6c1e6b0ab7236be9f (diff)
downloadfrost-4cf368be0cd2f179485b05a3d2cd9b7bc236ba8e.tar.gz
frost-4cf368be0cd2f179485b05a3d2cd9b7bc236ba8e.tar.bz2
frost-4cf368be0cd2f179485b05a3d2cd9b7bc236ba8e.zip
Fix merge
Diffstat (limited to 'app/src/main/kotlin')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt5
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt3
4 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
index aa84edf7..85a49730 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
@@ -37,8 +37,8 @@ class FrostApp : Application() {
override fun onCreate() {
FlowManager.init(FlowConfig.Builder(this).build())
- Prefs.initialize(this, "${BuildConfig.APPLICATION_ID}.prefs")
Showcase.initialize(this, "${BuildConfig.APPLICATION_ID}.showcase")
+ Prefs.initialize(this, "${BuildConfig.APPLICATION_ID}.prefs")
// if (LeakCanary.isInAnalyzerProcess(this)) return
// refWatcher = LeakCanary.install(this)
if (BuildConfig.DEBUG) {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt
index e0e18622..6022ee26 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt
@@ -5,6 +5,7 @@ import com.pitchedapps.frost.MainActivity
import com.pitchedapps.frost.R
import com.pitchedapps.frost.SettingsActivity
import com.pitchedapps.frost.utils.Prefs
+import com.pitchedapps.frost.utils.Showcase
/**
* Created by Allan Wang on 2017-06-29.
@@ -15,6 +16,10 @@ fun SettingsActivity.getExperimentalPrefs(): KPrefAdapterBuilder.() -> Unit = {
descRes = R.string.experimental_disclaimer_info
}
+ checkbox(R.string.experimental_by_default, { Showcase.experimentalDefault }, { Showcase.experimentalDefault = it }) {
+ descRes = R.string.experimental_by_default_desc
+ }
+
checkbox(R.string.search_bar, { Prefs.searchBar }, { Prefs.searchBar = it; setResult(MainActivity.REQUEST_SEARCH) }) {
descRes = R.string.search_bar_desc
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
index cf565b09..07127dd5 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
@@ -97,6 +97,6 @@ object Prefs : KPref() {
var analytics: Boolean by kpref("analytics", true)
- var searchBar: Boolean by kpref("search_bar", false)
+ var searchBar: Boolean by kpref("search_bar", Showcase.experimentalDefault)
}
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 1429dc1a..b1dbe6f1 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
@@ -12,5 +12,8 @@ object Showcase : KPref() {
//check if this is the first time launching the web overlay; show snackbar if true
var firstWebOverlay: Boolean by kpref("first_web_overlay", true)
+
+ //not a showcase but cannot be in the same file as Prefs
+ var experimentalDefault: Boolean by kpref("experimental_by_default", false)
}