We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main import ( "image/color" "log" "os" "gioui.org/app" "gioui.org/io/system" "gioui.org/layout" "gioui.org/op" "gioui.org/text" "gioui.org/widget/material" "gioui.org/font/gofont" "github.com/inkeliz/gowebview" ) func main() { go func() { w := app.NewWindow() if err := loop(w); err != nil { log.Fatal(err) } os.Exit(0) }() app.Main() } func loop(w *app.Window) error { th := material.NewTheme(gofont.Collection()) var ops op.Ops var wv gowebview.WebView var has_back bool for { e:=<-w.Events() switch e:=e.(type) { case app.ViewEvent: if wv==nil { go func() { var err error wv,err = gowebview.New(&gowebview.Config{URL:"https://google.com/ncr", WindowConfig:&gowebview.WindowConfig{Title:"Hello World", Window:e.View, VM:app.JavaVM()}}) if err!=nil {panic(err)} defer wv.Destroy() wv.Run() }() } else { wv.SetVisibility(gowebview.VisibilityMaximized) log.Println("===================resume webview==============") } case *system.CommandEvent: if e.Type==system.CommandBack { if has_back==false { log.Println("===================back button==============", wv) e.Cancel = true wv.SetVisibility(gowebview.VisibilityMinimized) has_back=true } else { log.Println("===================back button second time==============", wv) e.Cancel=false has_back=false } } case system.DestroyEvent: return e.Err case system.FrameEvent: gtx := layout.NewContext(&ops, e) l := material.H1(th, "Hello, gowebview") maroon := color.NRGBA{R: 127, G: 0, B: 0, A: 255} l.Color = maroon l.Alignment = text.Middle l.Layout(gtx) e.Frame(gtx.Ops) } } }
javac -source 8 -target 8 -bootclasspath $ANDROID_SDK_ROOT/platforms/android-29/android.jar -d /tmp/gowebview/classes /opt/lib/go/src/github.com/inkeliz/gowebview/gowebview_android.java
jar cf /opt/lib/go/src/github.com/inkeliz/gowebview/gowebview_android.jar -C /tmp/gowebview/classes .
The text was updated successfully, but these errors were encountered:
No branches or pull requests
javac -source 8 -target 8 -bootclasspath $ANDROID_SDK_ROOT/platforms/android-29/android.jar -d /tmp/gowebview/classes /opt/lib/go/src/github.com/inkeliz/gowebview/gowebview_android.java
jar cf /opt/lib/go/src/github.com/inkeliz/gowebview/gowebview_android.jar -C /tmp/gowebview/classes .
The text was updated successfully, but these errors were encountered: