Skip to content

Commit

Permalink
update webview for new koishi console
Browse files Browse the repository at this point in the history
  • Loading branch information
Anillc committed Jul 31, 2022
1 parent e11e5d5 commit dfbd469
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions app/src/main/java/cn/anillc/koishi/activities/ConsoleActivity.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand All @@ -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
}
}

0 comments on commit dfbd469

Please sign in to comment.