This repository has been archived on 2021-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
ui/go/gothings/androidCwtchActivity.go

51 lines
983 B
Go

package gothings
import (
"github.com/therecipe/qt/androidextras"
"github.com/therecipe/qt/core"
)
type AndroidCwtchActivity struct {
core.QObject
_ func() `constructor:"init"`
_ string `property:"notification"`
_ func(string) `slot:"updateAndroidNotification"`
}
func (c *AndroidCwtchActivity) init() {
c.createOngoingNotification()
c.ConnectNotificationChanged(c.updateAndroidNotification)
}
func (c *AndroidCwtchActivity) updateAndroidNotification(n string) {
var err = androidextras.QAndroidJniObject_CallStaticMethodVoid2Caught(
"ca/openprivacy/cwtch/ui/CwtchActivity",
"notify",
"(Ljava/lang/String;)V",
n,
)
if err != nil {
println(err.Error())
}
}
func (c *AndroidCwtchActivity) createOngoingNotification() {
var err = androidextras.QAndroidJniObject_CallStaticMethodVoid2Caught(
"ca/openprivacy/cwtch/ui/CwtchActivity",
"ongoingNotify",
"(Ljava/lang/String;)V",
"Cwtch is running",
)
if err != nil {
println(err.Error())
}
}