Flashing screen on Android while bringing up the native keyboard

257 views
Skip to first unread message

timo.v...@gmail.com

unread,
Feb 12, 2014, 5:10:01 AM2/12/14
to codenameone...@googlegroups.com
I have a scrollable Form with many TextFields in a container with TableLayout.
When I select any of these TextField, the native keyboard moves in from the bottom of the screen as expected.
In the emulator and on my iPad, this all works perfectly without visual artefacts.

On my Android Nexus 10 tablet running Android 4.4, however, the screen appears to be vertically magnified 2x for a short moment as the keyboard starts to move in/out the screen.

What could be wrong?
Is there a way to prevent this from happening?

Shai Almog

unread,
Feb 12, 2014, 12:44:25 PM2/12/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Can you see if this happens when enabling the build flag android.asyncPaint=true

timo.v...@gmail.com

unread,
Feb 12, 2014, 1:24:56 PM2/12/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi Shai,

On Wednesday, February 12, 2014 6:44:25 PM UTC+1, Shai Almog wrote:
Can you see if this happens when enabling the build flag android.asyncPaint=true

I enabled the build flag which lead to these results:
  1. The "magnification" artefact is now gone.
  2. The screen occasionally flashes black when moving from one TextField to another.
  3. An additional black band is flashing just above the keyboard when moving from one TextField to another. (This was also the case without the build flag.)
  4. When scrolling the Form while the keyboard is showing, the black band is also visible. (It appears to be part of the keyboard, as it does not respond to touch events?)
Enabling this build flag does have the side effect that my application appears to have become extremely unresponsive, and frequently "hangs" for quite some time in the middle of Form transitions. (The problem increases dramatically in a screen where a UITimer is running.)

Shai Almog

unread,
Feb 13, 2014, 2:56:52 AM2/13/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi,
we are deploying a new server with a fix to a minor regression that might affect this. Can you try building in an hour or so without the async flag to see if this issue is resolved?

Thanks.

timo.v...@gmail.com

unread,
Feb 13, 2014, 8:38:17 AM2/13/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi Shai,


On Thursday, February 13, 2014 8:56:52 AM UTC+1, Shai Almog wrote:
Can you try building in an hour or so without the async flag to see if this issue is resolved?

I have built a new version a few minutes ago and ran it on my Nexus 10, Android 4.4.

The problem has not been resolved:
  1. The 2x magnification artefact is still happening while moving the focus between TextFields. Hiding the keyboard also consistently flashes the same artefact.
  2. The temporary "black bar" above the keyboard contains the word suggestions from Android. (Aha!) - What puzzles me is why it is briefly displayed when switching TextFields. (I would like it to be either always there or never at all.)
  3. When the "black bar" shows, the size of the remaining screen is influenced and the layout therefore recalculated. This is causing unwanted flicker and a slight "jump" of the Form. (I guess the magnification artefact is somehow also due to the layout being updated?)
  4. After moving the focus around a few times, I got a blinking cursor in a field without the keyboard showing. (=new problem?)
  5. When the focus is on a TextField and a value can be entered through the keyboard, scrolling the Form consistently brings up the black "word suggestion" bar. (=new problem?)
  6. When the black "word suggestion" bar is showing, I can type text that leads to word suggestions from Android. This text does not show up in the TextField with the (blinking) cursor. (Although I encountered the situation once that it showed up in a "random" field after moving focus to another field.)
  7. I tried the exact same code on my Android 2.2 phone, and did not see the magnification artefact. (One explanation could be that the "word suggestion" is not part of the keyboard, but rather a floating control in this Android version.)
I hope this information helps in pinpointing the exact cause...

Shai Almog

unread,
Feb 13, 2014, 2:16:20 PM2/13/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi,
does this reproduce to you with a simple hello world test case application?
Does it happen on the native Android emulator (not our simulator)?
Is there a way to grab a screenshot/video of these issues or is it too fast?

timo.v...@gmail.com

unread,
Feb 14, 2014, 6:11:49 AM2/14/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi Shai,
I tried a new Hello World app with just a few TextFields in the default main Form on the Android emulator.
The emulator is set up as Android 4.4.2, API level 19 with soft keyboard.
Since the emulator is extremely slow, you can observe all of the artefacts reported above
(You should be able to reproduce them yourself with this setup.)

This is a screen capture of the Hello World app in the emulator:  https://www.youtube.com/watch?v=RVf7u87-ahw

You can clearly see all the redraw artefacts, the flashing "word suggestion" bar, and the magnification/compression effect of the keyboard growing and shrinking.

There is also a new artefact: the screen periodically blacks out!? When I run the same app in the CodenameOne emulator and open one of the emulator menus, the menu is flashing. Could this be an indication the screen is periodically redrawn?

Hope this helps...

Shai Almog

unread,
Feb 14, 2014, 1:01:09 PM2/14/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi,
are you sure you turned off the async flag?

timo.v...@gmail.com

unread,
Feb 16, 2014, 1:33:24 AM2/16/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi Shai,


On Friday, February 14, 2014 7:01:09 PM UTC+1, Shai Almog wrote:
Hi,
are you sure you turned off the async flag?

I am 100% sure the async flag is off, as I created the app in the video using the following steps:
  1. Create a new CodenameOne project in Eclipse.
  2. Open the "Theme.res" file in CodenameOne Designer.
  3. Add 4 TextFields (with all defaults) to the main form.
  4. (Delete the Label from the main form.)
  5. Save the resources file and switch back to Eclipse.
  6. Send Android build to server.
The problems on the video are exactly what I observe on my Nexus 10, only in slow-motion due to the performance of the Google emulator.

Shai Almog

unread,
Feb 16, 2014, 1:47:59 PM2/16/14
to codenameone...@googlegroups.com, timo.v...@gmail.com
Hi,
OK we managed to reproducing and are working to resolve this right now.

Thanks.

timo.v...@gmail.com

unread,
Feb 16, 2014, 1:50:31 PM2/16/14
to codenameone...@googlegroups.com, timo.v...@gmail.com

On Sunday, February 16, 2014 7:47:59 PM UTC+1, Shai Almog wrote:
Hi,
OK we managed to reproducing and are working to resolve this right now.

On a sunday; You guys rock! 
Reply all
Reply to author
Forward
0 new messages