inkeliz / gowebview

Simple WebView for Golang, avoiding CGO for Windows.
MIT License
54 stars 12 forks source link

New option to programmatically minimize/maximize the Webview #6

Closed inkeliz closed 3 years ago

inkeliz commented 3 years ago

Now it's possible to hide/show the Webview. Previously the only option is to destroy and initiate another, especially on Android.


For Gio, it could be used together with the BackButton:

case *system.CommandEvent:
    if e.Type == system.CommandBack {
        if webview != nil {
            webview.SetVisibility(gowebview.VisibilityMinimized)
        }
    }

That doesn't destroys the Webview, just set the View back to the Gio. You can, later on, set the webview.SetVisibility(gowebview.VisibilityMaximized) to go back to the Webview. The Webview will resume without any reload.