TheFinestArtist / FinestWebView-Android

Beautiful and customizable Android Activity that shows web pages within an app.
https://finestwebview.web.app
2.32k stars 532 forks source link

Programmatically close #156

Open shanecontinued opened 6 years ago

shanecontinued commented 6 years ago

How can I programmatically close the modal? Specifically from inside a WebListener.

sukhcha-in commented 5 years ago

Yeah i am also looking for this @TheFinestArtist

gintechsystems commented 4 years ago

I implemented some code to allow us to programmatically close the activity. You can do Builder.close()

Kotlin Example:

val webviewBuilder = FinestWebView.Builder(this)
webviewBuilder.setWebViewListener(object : WebViewListener() {
            override fun onPageFinished(url: String?) {
                Handler().postDelayed({
                    webviewBuilder.close()
                }, 5000)
            }
})

implementation 'com.github.gintechsystems:FinestWebView-Android:1.2.7'