From 5583f519dd7c4843f045029b0e48fd882dd79c71 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 30 Jul 2017 17:04:32 -0700 Subject: Feature/disable reload on textarea focus (#101) * Implement and test * Update themes again --- app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt') 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 912a957e..018ad737 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -1,10 +1,10 @@ package com.pitchedapps.frost.web import android.content.Context +import android.support.v4.widget.SwipeRefreshLayout import android.webkit.JavascriptInterface import com.pitchedapps.frost.activities.MainActivity import com.pitchedapps.frost.dbflow.CookieModel -import com.pitchedapps.frost.facebook.formattedFbUrl import com.pitchedapps.frost.utils.* import io.reactivex.subjects.Subject @@ -54,6 +54,14 @@ class FrostJSI(val webView: FrostWebViewCore) { activity?.viewPager?.enableSwipe = !start } + /** + * Allow or disallow the pull down to refresh action + */ + @JavascriptInterface + fun disableSwipeRefresh(disable: Boolean) { + webView.post { (webView.parent as? SwipeRefreshLayout)?.isEnabled = !disable } + } + @JavascriptInterface fun loadLogin() { context.launchLogin(cookies, true) -- cgit v1.2.3