Skip to main content
Inspiring
October 29, 2012
Question

renderMode=direct and softKeyboardBehavior=none not compatible on Android

  • October 29, 2012
  • 2 replies
  • 3363 views

I have discovered that if I set renderMode=direct and softKeyboardBehavior=none the app continues to pan when the softkeyboard is activated on the ASUS Transformer (Android 4.0.3). Further, after the soft keyboard is dismissed, the contents of the TextInput's disappear or begin to flicker.

I do not see these problems on the iPad2. Here is an app that demonstrates the issue:

SoftKeyboardSpike-app.xml:

<?xml version="1.0" encoding="utf-8" standalone="no"?>

<application xmlns="http://ns.adobe.com/air/application/3.4">

    <id>SoftKeyboardSpike</id>

    <filename>SoftKeyboardSpike</filename>

    <name>SoftKeyboardSpike</name>

    <versionNumber>0.0.0</versionNumber>                

    <initialWindow>

        <content>[This value will be overwritten by Flash Builder in the output app.xml]</content>

        <renderMode>direct</renderMode>

        <autoOrients>true</autoOrients>

        <fullScreen>false</fullScreen>

        <visible>true</visible>

        <softKeyboardBehavior>none</softKeyboardBehavior>

    </initialWindow>

    <android>

        <colorDepth>32bit</colorDepth>

        <manifestAdditions><![CDATA[

            <manifest android:installLocation="auto">

                <uses-permission android:name="android.permission.INTERNET"/>

            </manifest>           

        ]]></manifestAdditions>

    </android>

</application>

SoftKeyboardSpike.mxml:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

               xmlns:s="library://ns.adobe.com/flex/spark">

    <s:TextInput bottom="0"/>                   

</s:Application>

This topic has been closed for replies.

2 replies

Adobe Employee
November 12, 2013

Are you able to reproduce the issue with plain Actionscript project?

-NImit

Known Participant
November 13, 2013

I can confirm that this bug is happening with pure actionscript code too.

This one is really a pain, since it only happens on Android. The solution might be to deal with

stage.softKeyboardRect and SoftKeyboardEvent classes.

EDIT:

I was wrong: you can't balance the unwanted raise of the app when the soft keyboard shows up by listening to SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE and then set the y value of your main container to -stage.softKeyboardRect.height

There is no point to report this bug (or any other) on the JIRA bugbase, since Adobe clearly decided to drop AIR, letting customers alone, until AIR really dies.

Message was edited by: electrofrog

Adobe Employee
November 13, 2013

Thanks for the confirmation. I tried actionscript(textfield) code but not able to reproduce. I would be great if you can share the pure actionscript code with which you are able to reproduce the issue. Please email me @ nimitja@adobedotcom. 

-Nimit

Participant
November 9, 2013

"if I set renderMode=direct and softKeyboardBehavior=none the app continues to pan when the softkeyboard is activated" I've also been struggling with this. It appears to be a bug. The only workaround I've found so far is making sure the object which is activating the softkeyboard (like a TextInput object) is high enough up on the screen that it isn't covered by the keyboard. Ensuring this is very difficult however, because I haven't found a consistent way to determine the size of the software keyboard. If anyone could point me to what value is being changed when the screen pans, that would be very appreciated. I would like to try triggering this bug, then checking how much the stage is panned, and then setting the activating object based upon the panning value. I can't do this until i figure out how much the screen pans.