New Candy Lib: Widget Candy for Corona

It would’ve been useful to have a step property on the drag button too. And a choice on what side of the button the value-bubble appears (for design purposes and when the button is placed to the far left of the screen).

Another necessity as I see it, is the choice of turning off or hiding the bubbles on both the slider and the drag button. I’m currently using a slider in combination with Text Candy and are showing the changing slider values in a custom font. The slider-bubble then showing up is a disruptive element. [import]uid: 129287 topic_id: 25953 reply_id: 106289[/import]

Fantastic work. I love it!

I do get a couple of issues though. I get the same issue as 3 Dreams Gaming, with the native text box in Android being too small and offset to the right and below the border.

I am getting an issue with lists where on Android, where I can see the list items outside the list area underneath and in the list caption area. I am running the original sample files on a HTC Sensation XL.

I am using Build 812

[import]uid: 91886 topic_id: 25953 reply_id: 106445[/import]

First off, widget candy is fantastic, but i am having two problems. First the native text box in the text input box on android is not aligned in the border and it is very short with the letters getting cut off.
here is my code
[lua]–Username Textbox
userText = widgetC.NewInput ({
x = “center”, y = 150,
width = “70%”, theme = “theme_3”,
name = “usernameInput”, caption = “Username”,
notEmpty = true, textColor = { 0, 0, 0},
inputType = “default”, allowedChars = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_-”,
quitCaption = “Touch Screen to Continue”
})[/lua]

Also the password input type is not working for me, its still displaying the characters instead of masking them.

[lua]–Password Textbox
userPass = widgetC.NewInput ({
x = “center”, y = 200,
width = “70%”, theme = “theme_3”,
name = “passwordInput”, caption = “Password”,
notEmpty = true, textColor = { 0, 0, 0},
inputType = “password”, allowedChars = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_-”,
quitCaption = “Touch Screen to Continue”
})[/lua]

Edit: i am also getting this error in the terminal with native text boxes

WARNING: The ‘listener’ argument to native.newTextField( left, top, width, height [, listener] ) is deprecated. Call the object method o:addEventListener( ‘userInput’, listener ) instead.

i am using Corona build 813

EDIT Once More: I also noticed that when i try to hold down backspace on an android device it only deletes part of the word and skips to the front then i had to go back a delete the rest. [import]uid: 126161 topic_id: 25953 reply_id: 106392[/import]

@khincker: thanks for the hint. In the current version, toggle buttons aren’t visually updated when their toggle state was changed manually. This is already fixed in the upcoming update (will be available today or tomorrow).

@Dr.Mabuse: drag buttons already support a step value -we just forgot to mention it in the docs =) Just add step = [anyNumber] to the properties when creating a drag button. There will also be a new property named “hideBubble” with the next update to hide or show the text bubble (for sliders and drag buttons).

@donovanh: drop down widgets are already on the list (which grows longer and longer =), but you could also use a list widget here (set to hidden and being shown when needed, as we did with our “Liquix” app). The next update allows lists without a title caption, which would look more like a drop down list then.

@3DreamsGaming: the updated version (to be released today or tomorrow) does not produce this warning anymore. However, the input text issues may be caused by Corona itself. Do you experience the same issues without using Widget Candy?

[import]uid: 10504 topic_id: 25953 reply_id: 106499[/import]

UPDATE: WIDGET CANDY VERSION 1.0.1 AVAILABLE

WHAT’S NEW?

* New ‘iOS’ theme (‘theme_5’) added to provide a native widget look. This theme, (as all upcoming themes, too) is provided in normal (512x512, frame size 40 pixels) AND high resolution (1024x1024, frame size 80 pixels). Use the high resolution on the ‘New iPad’, for example. There is also a layered .psd file included in the theme’s folder that can be used with PhotoShop.

* You can now specify a vertical y-offset for widget captions (f.e. button texts, labels, checkboxes etc.). Do so by adjusting the variable ‘WidgetTextYOffset’ in a theme’s settings file. Negative values will shift the captions upwards, positive downwards.

* Auto-resizing buttons. Buttons are now automatically resized according to their text caption if their width property is set to ‘auto’. Also added a new sample ‘Auto-Resizing Buttons’.

* Lists without title caption bar. If you do not specify a list’s title caption (or set it to an empty string), no title caption bar is displayed anymore. See updated sample ‘List, Basic’. Please note that lists without a title caption bar may not look good with all themes though.

* Added property ‘ButtonTextColor’ to theme setting files. Use this to specifiy an individual color for all button texts. If this property is not available in your theme setting file, ‘WidgetColorText’ will be used instead (to ensure backward compatibility).

* Added property ‘reversed’ to sliders. Before, vertical sliders increased their value when dragged downwards and decreased their value when dragged upwards. Use ‘reversed = true’ to reverse this behaviour (max value will be at the top, min value at the bottom then). Same for horizontal sliders. See updated slider sample.

* Added property ‘hideBubble’ to sliders and drag button. If set to true, no text bubble is shown when being dragged.

* Fixed: Updated code to eliminate the ‘listener argument to native.newTextField( ) is deprecated’ console warning.

* Fixed: Manually updating the toggleState property of buttons and square buttons should now work as expected.

Updated version was sent to all Widget Candy customers. Please make sure that your spam filter does not block messages sent from order [at] x-pressive.com

List widget performance (mentioned above) has not been changed yet and was scheduled for the next update to make the other improvements available as soon as possible.
[import]uid: 10504 topic_id: 25953 reply_id: 106507[/import]

Great news!
[import]uid: 129287 topic_id: 25953 reply_id: 106511[/import]

I have another project that is built using corona build 807 that has no problems with the native text box. I am not at home so I cannot check the new updated widget candy file to see if the problem is resolved. It could have had something to do with the depreciated warning that is now fixed. I will check it when I get home. I am testing on an EVO 4g

Also I have did not see this option but I would like to make a feature request. For the new input box, could there be a feature to put some text in the box but when the box is touched, it shows an empty box and if there is any text input then the text that was set to the box would disappear. So the user does not have to delete the original text to input new text. [import]uid: 126161 topic_id: 25953 reply_id: 106526[/import]

3DreamsGaming:
could there be a feature to put some text in the box but when the box is touched, it shows an empty box and if there is any text input then the text that was set to the box would disappear

Good point. Added “onFocus” listener (available with next update) which is called when the input process just started, so you can perform your own text verification there, and, if neccessary, clear the current text.

[import]uid: 10504 topic_id: 25953 reply_id: 106539[/import]

Sounds great, thanks for the quick response. [import]uid: 126161 topic_id: 25953 reply_id: 106554[/import]

Update is great, solved my toggleState issue, thanks for getting it out quickly.

Feature request/suggestion: on either newText or perhaps newWindow, it would be super sexy to have a positionable arrow (small triangle) which could be placed somewhere on the border of the box. This would allow us to easily create info pop ups, especially with the new iOS Theme, where a text box appears and “points to” a specific on screen element.

Great work, keep it up.

[import]uid: 96383 topic_id: 25953 reply_id: 106599[/import]

Hello,

Great update! I was wondering if it will possible to add two buttons:

1- Sound Fx button (two states ON and maybe off with a red bar across it) The button will of course look like a speaker

2- A music button. Also two states and the button would like a music note.

The reason I ask is that these two button types are universal to pretty much all games apps. Of course it will be doable to add them but i will think that it will be better if they came standard.

Another thing I noticed with the IOS them is that button ON/OFF slider do not show an blue/grey color with the ON side blue like the regular IOS theme. And maybe even one with Orange color (for ON position) like in the case of Airplane mode in the settings. The blue/grey will suffice.

Thanks again so much for a library that would make GUI a breeze in my future apps!

Love it!

Mo [import]uid: 100814 topic_id: 25953 reply_id: 106639[/import]

After downloading and using the latest version of widget candy, the only problem that has been resolved from my previous post is the warning, i still have the problem with the input textbox, the problem with inputType = “password” not masking the characters, and the problem with backspacing an already filled input box. I did try to make a small app with a native textbox and it worked as intended with no problems in a regular corona app but i still have the same problem with the widget candy widget. [import]uid: 126161 topic_id: 25953 reply_id: 106693[/import]

Sent Email to support and orders at x-pressive… thanks
Larry [import]uid: 11860 topic_id: 25953 reply_id: 106712[/import]

@khincker: adding arrows to text fields would be an interesting feature -added to the list :slight_smile:

@LairdGames: sound / music buttons - most developers probably prefer using their own icons here that perfectly fit to their current app/game and it’s just a matter of a minute to create these toggle buttons, so this would probably only blow up the library.

On/Off switch background color: already added an option to apply a custom color when a switch is set to “ON”. Available with the next update then.

@3DreamsGaming: this seems to be some issue related to Corona or the device’s OS, but we’ll try to track it down. As a current workaround we added a property ‘disableInput’ for input texts with the next update. If set to ‘true’, no native input text field will pop up and only the widgets onPress listener will be available. Use this if you would like to display your own text input methods instead of Widget Candy’s built-in text input.

[import]uid: 10504 topic_id: 25953 reply_id: 106763[/import]

So the fade in background and the border will be there with the touch to cancel listener but the actual native box won’t be, correct? I can deal with that, I love how u handled, native inputs. What about my issue with the password inputtype password not masking characters?
Edit: I tested the input text box on two EVO 4gs and two EVO 3ds with the same outcome if that helps written all. [import]uid: 126161 topic_id: 25953 reply_id: 106770[/import]

@3DreamsGaming: if disableInput is set to true, there will be NO action, except that the onPress listener function will be called when the text field is tapped. Use this function to pop up your own input text field then or whatever you prefer instead.

Masking text issue for password texts was fixed and will be available with the next update (will be out until end of week).

Widget Candy + Corona Storyboard
To all who requested a Corona Storyboard example -you can download a Widget Candy / Corona Storyboard sample project here:

Download Sample
[import]uid: 10504 topic_id: 25953 reply_id: 106774[/import]

Great work.
I’m having one important issue with the input text box to add.
When you tap the ‘enter’ key on iOS, the user expects this to remove the keyboard.
Currently the only way to submit the form is to click somewhere else on the screen.

I’ve fixed it on my machine by adding the two lines of code at line 825 and 826: (under your commented-out code)

elseif event.phase == "ended" or event.phase == "submitted" then  
 V.\_RemoveInput()  

It seems to fix the problem in the iOS simulator (didn’t test it on Android or and actual device yet)

Otherwise I really like this library, it’s going to save people a ton of development time. [import]uid: 33608 topic_id: 25953 reply_id: 106801[/import]

Edit:
Sorry, I see that you already support the tap event for the switch, just not in the same way its implemented in iOS. In Widget Candy you have to tap the side of the switch where you want it to go to. With iOS, anywhere you tap the switch changes its state. (I still think it would be more user friendly to go along with the iOS way of doing this)

Original:
And one more request:
Can you make the switch widget respond to tap events? At the moment you can only drag the switch to its on and off states, but in iOS, the user expects it to work also with a tap.
Thanks [import]uid: 33608 topic_id: 25953 reply_id: 106815[/import]

Not sure if this was covered but we also had the issue with the text box not being aligned right on Android devices.

We have fixed this by:

  1. In the WidgetCandy.lua we modified the code to set the reference code for the newTextInput to center. I think this is a Corona issue, I suspect the text input is automatically set to center reference on iOS but not on Android, but I’m not totally sure, in any case explicitly setting the reference point solves the alignement issue.
  2. On Android we also noticed the text is cropped so we also had to enlarge the text input in case the platform is android…

Both these issues are CORONA issues and NOT Widget Candy so I cannot expect a fix from the lib itself because once Ansca decides to fix it it might break the patch.

It’s really a shame because we are running into these text input alignment issues for a few months now and had to patch it on our code with “if android” clauses… Sometimes I feel Ansca personnel don’t have even one Android device in their lab or such a thing would not even pass QA!!!

How can they release a native text input that works differently than on ios without noticing it in testing?? [import]uid: 80469 topic_id: 25953 reply_id: 106840[/import]

@x-pressive.com: Cool, sounds good. If i wanted to add the sound/music icons to a sheet, would I just remove the icons I do not need since the sheet is of a certain size (512x512 for instance) OR can i just increase the size of the sheet to accommodate the new icons?

Thanks again.

Mo [import]uid: 100814 topic_id: 25953 reply_id: 106865[/import]