Text widgets taking over with full screen

We’ve been trying to configure corona such that text box widgets do not take over the full screen.  We’ve been unable to produce this result, are we overlooking something here?  To the best of my knowledge this is possible via native android code.

Thanks.

Hello @hiep,

Can you please post some code here (that you’re using to display the text boxes) so we can diagnose what might be happening?

Thanks,

Brent Sorrentino

Hello,

I am working on this project that Hiep mentioned, and we are creating a very basic text field.  Here’s our code:

                local function createTextField( x, y, width, height, text, inputType, validator )                     local textField = native.newTextField( x, y, width, height )                     textField.font = native.newFont( myFont, 16 )                     textField.hasBackground = false                     textField.defaultText = text                     textField.text = textField.defaultText                     textField.inputType = inputType                     textField.validator = validator                     textField:setTextColor( 255, 255, 255, 255 )                     redeemPanel:insert(textField)                     textField:addEventListener( "userInput", textHandler )                     return textField                 end                 local firstNameText = createTextField( 254, 278, 235, 60, "First Name", "default" )

Where textHandler deals with text placeholder and validator is optional.

I have also tried a very basic core function:

                    local textField = native.newTextField( 254, 278, 235, 60 )                     textField.font = native.newFont( myFont, 16 )

While both methods work and created text field as intended, we still face with keyboards taking over full screen… with a dialog box showing what I typed and the button “Done” taking up the whole screen.  I am testing this on Galaxy Nexus running Android 4.2.2 with stock keyboard.  I also noticed that using the same app, when installed on Nexus 7, a 7" tablet, the keyboard does not take over full screen.

I am suspecting this is the OS behavior, but since it is possible to force the keyboard not to have full screen on Android SDK, I am hoping we can achieve the something like this on Corona SDK as well.

Regards,

Nattawat

I should also mention that the game is running on landscape mode.

This is the screenshot of the problem we are having:

i52nox.png

Hi @min.nattawat,

This is actually the default behavior on Android phones for apps that are landscape. You can see this same behavior in other Android apps as well, such as the “Calendar” app. Android does this for landscape apps because the virtual keyboard covers most of the screen and the OS wants to ensure that the text field’s contents are viewable. So, this is the expected behavior. The end-user can escape the fullscreen view by pressing the “Back” button or the “Done” button that is to the right side of the text field.

Best regards,

Brent Sorrentino

Hi @Brent Sorrentino,

I know that the default behavior for keyboard in landscape mode is full screen, but it’s possible to force the keyboard to not go full screen, as seen in many Android apps.  You can force this behavior natively, I’m just looking for a solution to do the same on Corona.

awvybs.png

Hello @hiep,

Can you please post some code here (that you’re using to display the text boxes) so we can diagnose what might be happening?

Thanks,

Brent Sorrentino

Hello,

I am working on this project that Hiep mentioned, and we are creating a very basic text field.  Here’s our code:

                local function createTextField( x, y, width, height, text, inputType, validator )                     local textField = native.newTextField( x, y, width, height )                     textField.font = native.newFont( myFont, 16 )                     textField.hasBackground = false                     textField.defaultText = text                     textField.text = textField.defaultText                     textField.inputType = inputType                     textField.validator = validator                     textField:setTextColor( 255, 255, 255, 255 )                     redeemPanel:insert(textField)                     textField:addEventListener( "userInput", textHandler )                     return textField                 end                 local firstNameText = createTextField( 254, 278, 235, 60, "First Name", "default" )

Where textHandler deals with text placeholder and validator is optional.

I have also tried a very basic core function:

                    local textField = native.newTextField( 254, 278, 235, 60 )                     textField.font = native.newFont( myFont, 16 )

While both methods work and created text field as intended, we still face with keyboards taking over full screen… with a dialog box showing what I typed and the button “Done” taking up the whole screen.  I am testing this on Galaxy Nexus running Android 4.2.2 with stock keyboard.  I also noticed that using the same app, when installed on Nexus 7, a 7" tablet, the keyboard does not take over full screen.

I am suspecting this is the OS behavior, but since it is possible to force the keyboard not to have full screen on Android SDK, I am hoping we can achieve the something like this on Corona SDK as well.

Regards,

Nattawat

I should also mention that the game is running on landscape mode.

This is the screenshot of the problem we are having:

i52nox.png

Hi @min.nattawat,

This is actually the default behavior on Android phones for apps that are landscape. You can see this same behavior in other Android apps as well, such as the “Calendar” app. Android does this for landscape apps because the virtual keyboard covers most of the screen and the OS wants to ensure that the text field’s contents are viewable. So, this is the expected behavior. The end-user can escape the fullscreen view by pressing the “Back” button or the “Done” button that is to the right side of the text field.

Best regards,

Brent Sorrentino

Hi @Brent Sorrentino,

I know that the default behavior for keyboard in landscape mode is full screen, but it’s possible to force the keyboard to not go full screen, as seen in many Android apps.  You can force this behavior natively, I’m just looking for a solution to do the same on Corona.

awvybs.png