I have a unique case of webview issue (unlike any other issue online, so please before marking it as duplicate read it out) So, I have a webview which scrolls fine but as soon as I click on a button inside webview a popup comes up asking to enter name, email etc., but as soon as I start entering my name etc keyboard pops up hiding the content on the third line of the popup which is the email in my case. I am unable to scroll within this webview (popup) while the background scrolls fine. Any way I can fix this issue? I tried adjustresize and several other approaches online but no luck so far. Here's my code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.Redesign">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_and_status_bar_height"
android:background="@color/toolbar_background"
android:paddingTop="@dimen/status_bar_height"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.AppBarLayout>
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Heres my kt file for the same:
webView.settings.javaScriptEnabled = true
webView.settings.javaScriptCanOpenWindowsAutomatically = true
webView.settings.setAppCacheEnabled(true)
webView.settings.cacheMode = WebSettings.LOAD_DEFAULT
webView.settings.allowFileAccess = true
webView.settings.allowContentAccess = true
webView.settings.allowFileAccessFromFileURLs = true
webView.settings.allowUniversalAccessFromFileURLs = true
webView.settings.domStorageEnabled = true
webView.webChromeClient = WebChromeClient()
webView.webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView?, url: String?) {
hideProgress()
super.onPageFinished(view, url)
}
override fun onReceivedError(view: WebView?, request: WebResourceRequest?, error: WebResourceError?) {
hideProgress()
super.onReceivedError(view, request, error)
}
override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
if (request?.url?.toString()?.startsWith("mailto:") == true) {
val intent = Intent(Intent.ACTION_VIEW, request.url)
startActivity(intent)
return true
}
if (request?.url?.toString()?.startsWith("tel:") == true) {
startActivity(Intent(Intent.ACTION_DIAL, request.url))
return true
}
return super.shouldOverrideUrlLoading(view, request)
}
}
webView.loadUrl(urlToOpen)
Any ideas how to go ab out it?
Thanks in advance!