From 6adfc496374eb88919f70a240eb15a726d2c18e0 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 7 Jul 2017 03:26:55 -0400 Subject: Dev 1.1.6 (#33) - Fix play store listing, add sharing options, update css & js * Remove play store listing updates * Fix up listing * Combine url getters for overlay activity * Begin building context menu programmatically * Update css and js --- app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (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 89f7d20b..68163333 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -4,17 +4,14 @@ import android.content.Context import android.webkit.JavascriptInterface import com.pitchedapps.frost.MainActivity import com.pitchedapps.frost.dbflow.CookieModel -import com.pitchedapps.frost.utils.L -import com.pitchedapps.frost.utils.cookies -import com.pitchedapps.frost.utils.launchLogin -import com.pitchedapps.frost.utils.launchWebOverlay +import com.pitchedapps.frost.utils.* import io.reactivex.subjects.Subject /** * Created by Allan Wang on 2017-06-01. */ -class FrostJSI(val context: Context, val webView: FrostWebViewCore) { +class FrostJSI(val context: Context, val webView: FrostWebViewCore, val contextMenu: FrostWebContextMenu) { val headerObservable: Subject? = (context as? MainActivity)?.headerBadgeObservable @@ -35,6 +32,11 @@ class FrostJSI(val context: Context, val webView: FrostWebViewCore) { } } + @JavascriptInterface + fun contextMenu(url: String) { + contextMenu.post { contextMenu.show(url) } + } + @JavascriptInterface fun loadLogin() { context.launchLogin(cookies, true) -- cgit v1.2.3