Widget for text input...

Hi Guys.

Are each one working in your own text widget or do we have 1 common repository for everyone to contribute?

I created my own text widget and works ok (the only problem is that difference font size that everyone faces…). I can open source it so everyone can contribute or I will be more than happy to contribute if anyone has a text widget better than mine…

Mine isn’t anywhere sharable yet.  It’s in my local copy of the business sample app.

Rob

Renato, we are all doing our own thing as a most productive way :slight_smile: I’ll be happy to merge with you, shoot me a private message Atanas

Great @atanas.

I just created a public repository and upload our rb-display lib that includes our newTextField “widget” version.

In few words, it basically substitutes the native textField with a newText together a newRect (or newRoundedRect) when the native textField is not in use (focus)).

Some features already implemented:

– . Keyboard automatically hides when touching outside the textField

– . Auto-translate the screen to avoid the inputField to be hidden by the keyboard device

– . Obey to group behaviors, specially useful for use together with storyboard

Improvements still needed:

– . Adjust font differences between the placeholder text and the text inside the native field, specially on Android devices

– . Support to native textBox 

The link to repository is https://bitbucket.org/redbeach/

Very cool Renato, I have checked in mine at https://github.com/atanasster/framework-widget/blob/master/widgetLibrary/widget_editfield.lua

I will start a new thread to discuss the features that we all need and a way to merge all the copies

So nice to see the collaboration. Thank you very much for all this. 

Great idea atanas. Let’s centralize the collaboration in a specific thread.

Just did a quick look thru your widget and it has some very interesting features. 

I have done exactly the same thing a while back after the blog was posted using placeholder newText with 3 slice theming but I wa focusing on the keyboard hiding problem and keyboard dismiss problem on android. I basically had my newTextField hide it’s designated parent (scene view) and reposition on top of the screen along with an optional assigned label and adding a post button next to it (for the keyboard dismiss problem). I did not want to scroll up the content and then in the event the keyboard was canceled leave the user with an offset screen and there is also the problem of getting the keyboard height, so basicaly now they get a text input screen which automaticaly resets to previous state on submit or second back button press on android (because the first one doesn’t trigger an event) or on button press that I put next to it. Can post my code if interested to get some more ideas. I also had the text size problem but I think on my android test device I just used the same size for newText and newTextField and they were the same. I have to check my code when I get home.

I can confirm that in my case the text stayed the same if used this:

textField.font = native.newFont(font, fontSize)

I used the same fontSize in the display.newText function.

Doing anything about the scale made it wrong.

This was on an Android 2.3.3 device.

The Androids font scaling are all over the place. Unfortunately doing nothing with the scale wont get you very far. Neither is Rob’s scaling method working.

I have done exactly the same thing a while back after the blog was posted using placeholder newText with 3 slice theming but I wa focusing on the keyboard hiding problem and keyboard dismiss problem on android. I basically had my newTextField hide it’s designated parent (scene view) and reposition on top of the screen along with an optional assigned label and adding a post button next to it (for the keyboard dismiss problem). I did not want to scroll up the content and then in the event the keyboard was canceled leave the user with an offset screen and there is also the problem of getting the keyboard height, so basicaly now they get a text input screen which automaticaly resets to previous state on submit or second back button press on android (because the first one doesn’t trigger an event) or on button press that I put next to it. Can post my code if interested to get some more ideas. I also had the text size problem but I think on my android test device I just used the same size for newText and newTextField and they were the same. I have to check my code when I get home.

I can confirm that in my case the text stayed the same if used this:

textField.font = native.newFont(font, fontSize)

I used the same fontSize in the display.newText function.

Doing anything about the scale made it wrong.

This was on an Android 2.3.3 device.

The Androids font scaling are all over the place. Unfortunately doing nothing with the scale wont get you very far. Neither is Rob’s scaling method working.

Hi Guys, been following this thread closely. Any news on where the latest effort is?

see the result at widgetstown.com . You can register for a free download of the widget and sample app.

The widgetstown editText is the best option for now, but it still has some fontScale issues, specially on Android.

I spent last week working on a 100% widget textField and I got some pretty good results. But I got stuck trying to disable the spelling correction, since Corona does not give access to disable it.

Without that problem, I really think it is very possible to have it working in a way that solves the native problems.

I have only started my struggle with textInputs and I’m already about to throw my computer out of the window… :angry:

I have one suggestion to Corona:

As it seems that you are not capable of making a functioning textInput widget (this is your own words as far as I’m able to interpret the above), could you at least remove " Business Apps" from the front page of your the coronalabs.com web site?

I agree. For a Windows user trying to build a “BUSINESS APP” it is not right to advertise the very same business app on your front page. We are left to either look for a mac to build on. Please specify that business apps can be coded only via a MAC. It is very misleading to windows users WHO INVEST and BUY a PRO SUBSCRIPTION and only find this out way down the line that basic text inputs cannot be used or simulated… i mean what happens when a user building a game tries to have a text input but cant?

Kind Regards

Greg

Hi Guys, been following this thread closely. Any news on where the latest effort is?

see the result at widgetstown.com . You can register for a free download of the widget and sample app.