I have a cross platform Cordova application and I am trying to ensure that the adjustPan behavior defined in the Android developer docs works in my Android application. In other words, I want the contents of the window panned so that the current focus is never obscured by the keyboard and users can always see what they are typing.
I set the windowSoftInputMode preference to adjustPan, and I have fullscreen set to false as outlined in this stackoverflow answer, but this does not cause the application to pan up when a user focuses on an input - it overlays the window content instead. I also tried editing the AndroidManifest.xml file and that did not work either.
Here’s my config.xml file from the root of my Cordova project (with the iOS specific configuration stuff removed):
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.foo.bar" version="4.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Foo</name>
<description>
Lorem Ipsum
</description>
<author>
Foo
</author>
<content src="index.html" />
<access origin="*" />
<preference name="DisallowOverscroll" value="true" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="img"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="SplashScreenDelay" value="10000"/>
<platform name="android">
<preference name="windowSoftInputMode" value="adjustPan"/>
<icon src="www/images/icons-platform/android/drawable-mdpi/icon.png" width="48" height="48"/>
<icon src="www/images/icons-platform/android/drawable-hdpi/icon.png" width="72" height="72"/>
<icon src="www/images/icons-platform/android/drawable-xhdpi/icon.png" width="96" height="96"/>
<icon src="www/images/icons-platform/android/drawable-xxhdpi/icon.png" width="144" height="144"/>
<icon src="www/images/icons-platform/android/drawable-xxxhdpi/icon.png" width="192" height="192"/>
<icon src="www/images/icons-platform/android/drawable/icon.png" width="512" height="512"/>
<splash src="www/images/icons-platform/android/drawable-land-mdpi/img.png" density="land-mdpi"/>
<splash src="www/images/icons-platform/android/drawable-land-hdpi/img.png" density="land-hdpi"/>
<splash src="www/images/icons-platform/android/drawable-land-xhdpi/img.png" density="land-xhdpi"/>
<splash src="www/images/icons-platform/android/drawable-port-mdpi/img.png" density="port-mdpi"/>
<splash src="www/images/icons-platform/android/drawable-port-hdpi/img.png" density="port-hdpi"/>
<splash src="www/images/icons-platform/android/drawable-port-xhdpi/img.png" density="port-xhdpi"/>
</platform>
</widget>
Here's some other pertinent information:
Android Versions where I have observed this: 5.1.1, 4.4
PhoneGap version: 5.0.0
Build tool: CLI
OS where I am building: Windows 8.1