mirror of https://gitee.com/godoos/godoos.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
697 B
28 lines
697 B
package os.godoos.com
|
|
|
|
import android.app.Activity
|
|
import app.tauri.annotation.Command
|
|
import app.tauri.annotation.InvokeArg
|
|
import app.tauri.annotation.TauriPlugin
|
|
import app.tauri.plugin.JSObject
|
|
import app.tauri.plugin.Plugin
|
|
import app.tauri.plugin.Invoke
|
|
|
|
@InvokeArg
|
|
class PingArgs {
|
|
var value: String? = null
|
|
}
|
|
|
|
@TauriPlugin
|
|
class ExamplePlugin(private val activity: Activity): Plugin(activity) {
|
|
private val implementation = Example()
|
|
|
|
@Command
|
|
fun ping(invoke: Invoke) {
|
|
val args = invoke.parseArgs(PingArgs::class.java)
|
|
|
|
val ret = JSObject()
|
|
ret.put("value", implementation.pong(args.value ?: "default value :("))
|
|
invoke.resolve(ret)
|
|
}
|
|
}
|
|
|