aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt5
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt18
4 files changed, 21 insertions, 5 deletions
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 ad42418e..d46422b8 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsAssets.kt
@@ -34,7 +34,7 @@ import java.util.Locale
*/
enum class JsAssets : InjectorContract {
MENU, CLICK_A, CONTEXT_A, MEDIA, HEADER_BADGES, TEXTAREA_LISTENER, NOTIF_MSG,
- DOCUMENT_WATCHER
+ DOCUMENT_WATCHER, HORIZONTAL_SCROLLING
;
@VisibleForTesting
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
index 0d980ba0..d75a4f1f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
@@ -140,4 +140,9 @@ class FrostJSI(val web: FrostWebView) {
html ?: return
header?.offer(html)
}
+
+ @JavascriptInterface
+ fun allowHorizontalScrolling(enable: Boolean) {
+ activity?.viewPager?.enableSwipe = enable
+ }
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
index 003ed7f9..85914f33 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
@@ -102,6 +102,7 @@ open class FrostWebViewClient(val web: FrostWebView) : BaseWebViewClient() {
Prefs.aggressiveRecents
),
JsAssets.DOCUMENT_WATCHER,
+ JsAssets.HORIZONTAL_SCROLLING,
JsAssets.CLICK_A,
CssHider.ADS.maybe(!Prefs.showFacebookAds),
JsAssets.CONTEXT_A,
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
index 7c3c48e7..da0ebf0d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
@@ -120,10 +120,20 @@ open class NestedWebView @JvmOverloads constructor(
dxUnconsumed: Int,
dyUnconsumed: Int,
offsetInWindow: IntArray?
- ) = childHelper.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow)
-
- final override fun dispatchNestedPreScroll(dx: Int, dy: Int, consumed: IntArray?, offsetInWindow: IntArray?) =
- childHelper.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow)
+ ) = childHelper.dispatchNestedScroll(
+ dxConsumed,
+ dyConsumed,
+ dxUnconsumed,
+ dyUnconsumed,
+ offsetInWindow
+ )
+
+ final override fun dispatchNestedPreScroll(
+ dx: Int,
+ dy: Int,
+ consumed: IntArray?,
+ offsetInWindow: IntArray?
+ ) = childHelper.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow)
final override fun dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean) =
childHelper.dispatchNestedFling(velocityX, velocityY, consumed)