[WidgetCandy / Android] Input text fields misaligned on Android devices

From the WidgetCandy site:

Input text fields misaligned on Android devices
There is also an issue with current Corona versions causing input text fields to be positioned wrong (center origin is used instead of top left origin). We hope this issue will be addressed by Ansca itself as soon as possible. Meanwhile you could also display your own text input box (to do so, set the ‘disableInput’ property of the input text widget to ‘true’ and use the widget’s onPress listener function to display your own input text box then).

Can anyone from either the WidgetCandy or Corona sides comment on what is causing this issue, and if/when it might be fixed? I’d rather not create a workaround for this issue if I don’t have to.

(I didn’t put this in the bugs forum since I’m not clear whether this is an actual bug in Corona.)

Thanks for any info! [import]uid: 207504 topic_id: 35878 reply_id: 335878[/import]

I disagree with the assessment by the X-pressive. I don’t think it’s a bug on Corona Labs part. If it is it doesn’t fit that description. My own conclusion was that Android has large padding between the box and the text inside it. I looked at text boxes on non-corona apps and on Android always have a lot of space around the text. So if your text box is too short the font gets pushed up. The text box either needs to be bigger or the text needs to be adjusted down.

For example if the text box is 30 pixels high. Only 20 pixels of it can show text. The 5 pixels above and below it are white space.

If there is any bug perhaps it is the text doesn’t shrink to fit the box. However these are native objects and is controlled by the OS. You can adjust it but it’s a guessing game.
[import]uid: 56820 topic_id: 35878 reply_id: 142690[/import]

Are you talking about native.newTextField or display.newText()

What version of Corona SDK are you using?

Can you provide screen shots?

Keep in mind for native.* things, Androids “Chrome” (not the browser, but the lines that go around boxes) is different than iOS and is out of our control. [import]uid: 199310 topic_id: 35878 reply_id: 142697[/import]

I am pretty sure he is talking about the chrome space around Android native text boxes. Hopefully he will clarify though. If the text box is too small it looks like the text is centerlined. However my tests point to it being the chrome. The text is always pushed up because of it when the box is small. X-pressive says on their website it is a bug with Corona. I just disagree.

Here is a screenshot showing a native text box created 8 times on an Android phone. Starting with a height of 40, each of the following box’s height is 10 larger than the previous. So it’s 40, 50, 60, 70, 80, 90 and 100. I tapped on each and entered the text “test”. As you can see, the text gets pushed up if the box is too small. The chrome never lessens in size to compensate for the text. So you either need to make a bigger box or smaller text.

http://www.moonrisegames.com/test/test.jpg

You could just make your text boxes big and they should be good on all Android devices. However widget candy adds another problem. It sets the box height based on the font height and the calculations are basically set up to work with iOS. You could alter widget_candy.lua to either make the box bigger than usual or the text smaller than usual if the device is Android.

The whole text box dilemna is annoying enough but Retina/HD devices make the text even more out of whack. The text is always smaller on those devices. It works but it looks really out of place to me. So I check for them and make the text larger. [import]uid: 56820 topic_id: 35878 reply_id: 142784[/import]

I disagree with the assessment by the X-pressive. I don’t think it’s a bug on Corona Labs part. If it is it doesn’t fit that description. My own conclusion was that Android has large padding between the box and the text inside it. I looked at text boxes on non-corona apps and on Android always have a lot of space around the text. So if your text box is too short the font gets pushed up. The text box either needs to be bigger or the text needs to be adjusted down.

For example if the text box is 30 pixels high. Only 20 pixels of it can show text. The 5 pixels above and below it are white space.

If there is any bug perhaps it is the text doesn’t shrink to fit the box. However these are native objects and is controlled by the OS. You can adjust it but it’s a guessing game.
[import]uid: 56820 topic_id: 35878 reply_id: 142690[/import]

Are you talking about native.newTextField or display.newText()

What version of Corona SDK are you using?

Can you provide screen shots?

Keep in mind for native.* things, Androids “Chrome” (not the browser, but the lines that go around boxes) is different than iOS and is out of our control. [import]uid: 199310 topic_id: 35878 reply_id: 142697[/import]

I am pretty sure he is talking about the chrome space around Android native text boxes. Hopefully he will clarify though. If the text box is too small it looks like the text is centerlined. However my tests point to it being the chrome. The text is always pushed up because of it when the box is small. X-pressive says on their website it is a bug with Corona. I just disagree.

Here is a screenshot showing a native text box created 8 times on an Android phone. Starting with a height of 40, each of the following box’s height is 10 larger than the previous. So it’s 40, 50, 60, 70, 80, 90 and 100. I tapped on each and entered the text “test”. As you can see, the text gets pushed up if the box is too small. The chrome never lessens in size to compensate for the text. So you either need to make a bigger box or smaller text.

http://www.moonrisegames.com/test/test.jpg

You could just make your text boxes big and they should be good on all Android devices. However widget candy adds another problem. It sets the box height based on the font height and the calculations are basically set up to work with iOS. You could alter widget_candy.lua to either make the box bigger than usual or the text smaller than usual if the device is Android.

The whole text box dilemna is annoying enough but Retina/HD devices make the text even more out of whack. The text is always smaller on those devices. It works but it looks really out of place to me. So I check for them and make the text larger. [import]uid: 56820 topic_id: 35878 reply_id: 142784[/import]

I disagree with the assessment by the X-pressive. I don’t think it’s a bug on Corona Labs part. If it is it doesn’t fit that description. My own conclusion was that Android has large padding between the box and the text inside it. I looked at text boxes on non-corona apps and on Android always have a lot of space around the text. So if your text box is too short the font gets pushed up. The text box either needs to be bigger or the text needs to be adjusted down.

For example if the text box is 30 pixels high. Only 20 pixels of it can show text. The 5 pixels above and below it are white space.

If there is any bug perhaps it is the text doesn’t shrink to fit the box. However these are native objects and is controlled by the OS. You can adjust it but it’s a guessing game.
[import]uid: 56820 topic_id: 35878 reply_id: 142690[/import]

Are you talking about native.newTextField or display.newText()

What version of Corona SDK are you using?

Can you provide screen shots?

Keep in mind for native.* things, Androids “Chrome” (not the browser, but the lines that go around boxes) is different than iOS and is out of our control. [import]uid: 199310 topic_id: 35878 reply_id: 142697[/import]

I am pretty sure he is talking about the chrome space around Android native text boxes. Hopefully he will clarify though. If the text box is too small it looks like the text is centerlined. However my tests point to it being the chrome. The text is always pushed up because of it when the box is small. X-pressive says on their website it is a bug with Corona. I just disagree.

Here is a screenshot showing a native text box created 8 times on an Android phone. Starting with a height of 40, each of the following box’s height is 10 larger than the previous. So it’s 40, 50, 60, 70, 80, 90 and 100. I tapped on each and entered the text “test”. As you can see, the text gets pushed up if the box is too small. The chrome never lessens in size to compensate for the text. So you either need to make a bigger box or smaller text.

http://www.moonrisegames.com/test/test.jpg

You could just make your text boxes big and they should be good on all Android devices. However widget candy adds another problem. It sets the box height based on the font height and the calculations are basically set up to work with iOS. You could alter widget_candy.lua to either make the box bigger than usual or the text smaller than usual if the device is Android.

The whole text box dilemna is annoying enough but Retina/HD devices make the text even more out of whack. The text is always smaller on those devices. It works but it looks really out of place to me. So I check for them and make the text larger. [import]uid: 56820 topic_id: 35878 reply_id: 142784[/import]

I disagree with the assessment by the X-pressive. I don’t think it’s a bug on Corona Labs part. If it is it doesn’t fit that description. My own conclusion was that Android has large padding between the box and the text inside it. I looked at text boxes on non-corona apps and on Android always have a lot of space around the text. So if your text box is too short the font gets pushed up. The text box either needs to be bigger or the text needs to be adjusted down.

For example if the text box is 30 pixels high. Only 20 pixels of it can show text. The 5 pixels above and below it are white space.

If there is any bug perhaps it is the text doesn’t shrink to fit the box. However these are native objects and is controlled by the OS. You can adjust it but it’s a guessing game.
[import]uid: 56820 topic_id: 35878 reply_id: 142690[/import]

Are you talking about native.newTextField or display.newText()

What version of Corona SDK are you using?

Can you provide screen shots?

Keep in mind for native.* things, Androids “Chrome” (not the browser, but the lines that go around boxes) is different than iOS and is out of our control. [import]uid: 199310 topic_id: 35878 reply_id: 142697[/import]

I am pretty sure he is talking about the chrome space around Android native text boxes. Hopefully he will clarify though. If the text box is too small it looks like the text is centerlined. However my tests point to it being the chrome. The text is always pushed up because of it when the box is small. X-pressive says on their website it is a bug with Corona. I just disagree.

Here is a screenshot showing a native text box created 8 times on an Android phone. Starting with a height of 40, each of the following box’s height is 10 larger than the previous. So it’s 40, 50, 60, 70, 80, 90 and 100. I tapped on each and entered the text “test”. As you can see, the text gets pushed up if the box is too small. The chrome never lessens in size to compensate for the text. So you either need to make a bigger box or smaller text.

http://www.moonrisegames.com/test/test.jpg

You could just make your text boxes big and they should be good on all Android devices. However widget candy adds another problem. It sets the box height based on the font height and the calculations are basically set up to work with iOS. You could alter widget_candy.lua to either make the box bigger than usual or the text smaller than usual if the device is Android.

The whole text box dilemna is annoying enough but Retina/HD devices make the text even more out of whack. The text is always smaller on those devices. It works but it looks really out of place to me. So I check for them and make the text larger. [import]uid: 56820 topic_id: 35878 reply_id: 142784[/import]