google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.43k stars 598 forks source link

[WebView] Too many null checks in cases where it doesn't make sense #1564

Closed cosminstefanxp closed 1 year ago

cosminstefanxp commented 1 year ago

Description There are too many null checks in situations that don't really make sense. For example, the methods in WebViewClient and WebChromeClient all have nullable arguments, while that is not correct, since they'll never be called with a null web view. This is likely due to missing of nullable annotations on the Java WebView.

cosminstefanxp commented 1 year ago

Hello again. And thanks for taking a first round at this. But it's not yet complete, so I don't think it should be closed. For example, the signature in AccompanistWebViewClient is: override fun onPageStarted(view: WebView, url: String?, favicon: Bitmap?), while the url can never be null. Why not override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?)?