wei-spring / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Layout shrinking in Android when focusing a textfield #690

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Please clearly state whether the issue relates to a device/the simulator or the 
tools. If related to a device be sure to specify exactly which device with as 
much details as possible.

The layout on an Android app shrinks when you focus on a Textfield and the 
virtual keyboard appears. Although this is a normal behaviour on Android, the 
OS provides the option to do so by adding the attribute 
android:windowSoftInputMode="adjustPan" on the AndroidManifest.xml CN1 should 
give the option to do so.

What steps will reproduce the problem?
1. On Android, clic on a textfield
2. When virtual keyboard appears, the layout shrinks.

What is the expected output? What do you see instead?
To be able to modify the android:windowSoftInputMode attribute on the 
AndroidManifest.xml file and set its value to "adjustPan" so the layout doesn't 
resize.

What version of the product are you using? On what operating system?
CN1: 1.0.0.201304161905 Android 4.0.3

Please provide any additional information below.

Original issue reported on code.google.com by marioba...@gmail.com on 2 May 2013 at 7:19

Attachments:

GoogleCodeExporter commented 8 years ago
There is an issue where we don't have the ability to define something similar 
to xapplication for a specific attribute in the manifest, this should be added 
to the build process to allow custom attribute addition.
We also need to check whether this particular feature is possible.

Original comment by shai.almog on 3 May 2013 at 5:27

GoogleCodeExporter commented 8 years ago
adding the "adjustPan" won't change the above behavior, since we are 
controlling the keyboard and the layout is not an Android layout.

To avoid the shrinking I would suggest you to override the Form 
sizeChangedInternal (your extended Form will have to be in the same package as 
Form) and to check if the current focused is instanceof TextArea and check if 
only the height has changed then don't call super.sizeChangedInternal

Original comment by cf27...@gmail.com on 5 May 2013 at 2:06