aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-22 23:52:55 -0700
committerAllan Wang <me@allanwang.ca>2017-06-22 23:52:55 -0700
commit7bb1de11f0208ac6b6a9e7d8fd3db81490e18daf (patch)
treeb84b8bb1157c2e94df6527b29f542a8f87f26ebe /app/src/main/kotlin/com/pitchedapps
parent41f3952896fe6235895ba6bbf3cefe0f72907a87 (diff)
downloadfrost-7bb1de11f0208ac6b6a9e7d8fd3db81490e18daf.tar.gz
frost-7bb1de11f0208ac6b6a9e7d8fd3db81490e18daf.tar.bz2
frost-7bb1de11f0208ac6b6a9e7d8fd3db81490e18daf.zip
Fix urls in overlay
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/JsInjector.kt5
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt2
7 files changed, 4 insertions, 10 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
index 3991e53a..f6e5f2bf 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
@@ -125,7 +125,7 @@ class SettingsActivity : KPrefActivity() {
fun subPrefsNotifications(): KPrefAdapterBuilder.() -> Unit = {
- text(R.string.notification_frequency, { Prefs.notificationFreq }, { Prefs.notificationFreq = it; reloadByTitle(R.string.notifications) }) {
+ text(R.string.notification_frequency, { Prefs.notificationFreq }, { Prefs.notificationFreq = it; reloadByTitle(R.string.notification_frequency) }) {
val options = longArrayOf(-1, 15, 30, 60, 120, 180, 300, 1440, 2880)
val texts = options.map { this@SettingsActivity.minuteToText(it) }
onClick = {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
index b7bf3421..dfc3eaad 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
@@ -85,7 +85,7 @@ class WebFragment : Fragment() {
pauseLoad = false
}
-(position + 1) -> { //we are moving away from this fragment
- pauseLoad = true
+ if (!frostWebView.refresh.isRefreshing) pauseLoad = true
}
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt
index 5cb9897e..4edddbed 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt
@@ -22,7 +22,6 @@ enum class CssAssets(val folder: String = "themes") : InjectorContract {
injector = JsBuilder().css(content).build()
}
injector!!.inject(webView, callback)
- L.v("CSS ${injector!!.function}")
}
fun reset() {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
index ba0bdaac..655da3ff 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssHider.kt
@@ -20,7 +20,6 @@ enum class CssHider(vararg val items: String) : InjectorContract {
override fun inject(webView: WebView, callback: ((String) -> Unit)?) {
injector.inject(webView, callback)
- L.d(injector.function)
}
} \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
index 7bb73471..a176042e 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
@@ -22,7 +22,6 @@ enum class JsAssets : InjectorContract {
injector = JsBuilder().js(content).build()
}
injector!!.inject(webView, callback)
- L.v("JS ${injector!!.function}")
}
fun reset() {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsInjector.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsInjector.kt
index b7a162ae..deb6c0be 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsInjector.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsInjector.kt
@@ -53,10 +53,7 @@ fun WebView.jsInject(vararg injectors: InjectorContract, callback: ((Array<Strin
Observable.zip<String, Array<String>>(observables.map { it.toObservable() }, { it.map { it.toString() }.toTypedArray() }).subscribeOn(AndroidSchedulers.mainThread()).subscribe({
callback(it)
})
- (0 until validInjectors.size).asSequence().forEach {
- i ->
- validInjectors[i].inject(this, { observables[i].onSuccess(it) })
- }
+ (0 until validInjectors.size).forEach { i -> validInjectors[i].inject(this, { observables[i].onSuccess(it) }) }
}
fun FrostWebViewClient.jsInject(vararg injectors: InjectorContract, callback: ((Array<String>) -> Unit) = {}) = webCore.jsInject(*injectors, callback = callback)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
index ebea533c..065c9c08 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
@@ -66,7 +66,7 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : WebViewClient() {
L.d("Page finished reveal")
webCore.jsInject(CssHider.HEADER,
Prefs.themeInjector,
- JsAssets.CLICK_A,
+ JsAssets.CLICK_A.maybe(webCore.baseEnum != null),
callback = {
refreshObservable.onNext(false)
})