aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-04 14:11:52 -0400
committerGitHub <noreply@github.com>2017-07-04 14:11:52 -0400
commitd6c5bcd56e293eaf281663b6c1e6b0ab7236be9f (patch)
treedec58af06d220ba80920fcf9c816b71413c61108 /app/src/main/kotlin/com/pitchedapps
parent7a13673828f088c179763e8621a94e334319f226 (diff)
downloadfrost-d6c5bcd56e293eaf281663b6c1e6b0ab7236be9f.tar.gz
frost-d6c5bcd56e293eaf281663b6c1e6b0ab7236be9f.tar.bz2
frost-d6c5bcd56e293eaf281663b6c1e6b0ab7236be9f.zip
Small miscellaneous fixes
* mist * Add back experimental section * Remove update dev sh
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
-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)
}