Put simply, after loading the content in a webview and tapping on a text field, my app refuses to resize or pan.
Here's my setup
I have a single Activity with multiple fragments. Here's the layout with the container for the fragment.
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- MAIN CONTENT -->
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white" />
<RelativeLayout
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start">
<!-- ... -->
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
Here's the webview fragment's layout.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/tbOnlinePayment"
layout="@layout/toolbar" />
<WebView
android:layout_below="@+id/tbOnlinePayment"
android:id="@+id/paymentWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ProgressBar
android:id="@android:id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</RelativeLayout>
My app's theme extends Theme.AppCompat.Light.DarkActionBar
what I've tried:
- Like it's written all over the web I tried both
android:windowSoftInputMode="adjustResize"
andandroid:windowSoftInputMode="adjustPan"
. - I know in fullscreen the
android:windowSoftInputMode="adjustResize"
won't work, but I don't force this manually. I placed here the app's theme, because maybe someone knows this theme somehow forces fullscreen. - Building on the assumption above I added
<item name="android:windowFullscreen">false</item>
to the app's theme, but still no result. - Wrapping the
webview
in ascrollview
. - Changing the
webview
's height towrap_content
. - Basically went through most of the SO posts and solutions.
What I want:
I don't really care if the webview is resized or pushed up. What I want is the keyboard not to hide the input fields.