-
-
Notifications
You must be signed in to change notification settings - Fork 455
Expand file tree
/
Copy pathRust.kt
More file actions
46 lines (36 loc) · 1.92 KB
/
Rust.kt
File metadata and controls
46 lines (36 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2020-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
@file:Suppress("unused")
package {{package}}
import android.content.Intent
import android.webkit.WebView
import android.webkit.WebResourceRequest
import android.webkit.WebResourceResponse
object Rust {
init {
System.loadLibrary("{{library}}")
}
@JvmStatic external fun onActivityCreate(activity: WryActivity)
@JvmStatic external fun onActivityDestroy(activity: WryActivity)
@JvmStatic external fun onActivitySaveInstanceState()
@JvmStatic external fun onActivityLowMemory()
@JvmStatic external fun onWindowFocusChanged(activity: WryActivity, focus: Boolean)
@JvmStatic external fun onNewIntent(intent: Intent)
@JvmStatic external fun create()
@JvmStatic external fun start(activity: WryActivity)
@JvmStatic external fun resume(activity: WryActivity)
@JvmStatic external fun pause(activity: WryActivity)
@JvmStatic external fun stop(activity: WryActivity)
@JvmStatic external fun wryCreate()
@JvmStatic external fun onWebviewDestroy(activity: WryActivity, webviewId: String)
@JvmStatic external fun ipc(webviewId: String, url: String, message: String)
@JvmStatic external fun assetLoaderDomain(webviewId: String): String
@JvmStatic external fun withAssetLoader(webviewId: String): Boolean
@JvmStatic external fun handleRequest(webviewId: String, request: WebResourceRequest, isDocumentStartScriptEnabled: Boolean): WebResourceResponse?
@JvmStatic external fun shouldOverride(webviewId: String, url: String): Boolean
@JvmStatic external fun onPageLoading(webviewId: String, url: String)
@JvmStatic external fun onPageLoaded(webviewId: String, url: String)
@JvmStatic external fun onEval(webviewId: String, id: Int, result: String)
@JvmStatic external fun handleReceivedTitle(webviewId: String, title: String)
}