From dfbd46948c19c48f5bc7c7d2116a4a21761e578d Mon Sep 17 00:00:00 2001 From: Anillc Date: Mon, 1 Aug 2022 01:24:47 +0800 Subject: [PATCH] update webview for new koishi console --- .../anillc/koishi/activities/ConsoleActivity.kt | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/cn/anillc/koishi/activities/ConsoleActivity.kt b/app/src/main/java/cn/anillc/koishi/activities/ConsoleActivity.kt index e2221c4..6603b0f 100644 --- a/app/src/main/java/cn/anillc/koishi/activities/ConsoleActivity.kt +++ b/app/src/main/java/cn/anillc/koishi/activities/ConsoleActivity.kt @@ -1,10 +1,9 @@ package cn.anillc.koishi.activities import android.annotation.SuppressLint -import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.webkit.WebView -import android.webkit.WebViewClient +import androidx.appcompat.app.AppCompatActivity import cn.anillc.koishi.KoishiApplication import cn.anillc.koishi.R import cn.anillc.koishi.services.KoishiService @@ -14,15 +13,6 @@ class ConsoleActivity : AppCompatActivity() { private lateinit var webview: WebView - private val webViewClient = object : WebViewClient() { - override fun onLoadResource(view: WebView, url: String) { - view.evaluateJavascript( - "document.querySelector('meta[name=\"viewport\"]').setAttribute('content', 'width=1920');", - null - ) - } - } - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -47,8 +37,7 @@ class ConsoleActivity : AppCompatActivity() { webview.settings.javaScriptEnabled = true webview.settings.useWideViewPort = true webview.settings.loadWithOverviewMode = true - webview.settings.builtInZoomControls = true - webview.settings.setSupportZoom(true) - webview.webViewClient = webViewClient + webview.settings.domStorageEnabled = true + webview.settings.databaseEnabled = true } }