Widgets 2.0 Open-Source

Hello Corona SDK developers,

As promised, we have officially open-sourced Widgets 2.0. While the core library handles most needs, we understand that many developers want to tinker “under the hood” or build in functionality that is customized to a very specific behavior. The decision to open-source the widgets library was made with that intent in mind.

Note that the core widgets library will continue to receive updates and bug fixes. However, if you wish to inspect and modify the code, you may now download the necessary files from our GitHub repository:

https://github.com/coronalabs/

In this repository, you will find two libraries: framework-widgets and framework-widgets-sample. Please read the corresponding “README” file in each directory for usage details and other information.

Brent, thanks for this post. I apologize for the ignorant question that follows.

If I have no interest in inspecting the widgets code and improving them myself will I be ok to simply download the latest daily build and carry on as before? In other words, if I only wish to use the Corona supplied version of the widget 2.0 library, will it still be included in the Daily builds? I am hoping not to have to chase the latest & greatest out of github all the time.

Additionally, there are bunch of widget related bugs out there being discussed by fellow developers and Corona Labs staff. Now that the source is out there, will Coronal Labs continue to remain committed to those bug fixes?

Thanks for your clarification. 

Hi @ksan,

That’s not an ignorant question at all. :slight_smile: Certainly, we’ll continue to build upon the widgets core library, investigate/fix bugs, and add various improvements. The open sourcing is mainly intended for users who want to customize widgets at the deepest level for a specific functionality, or need a certain fix immediately.

Brent

Hi Brent, 

This is wonderful news! Thanks much for this confirmation. I look forward to seeing prompt resolutions to the current crop of issues with this library that has been keeping you busy. Thanks for all the hard work by the Corona Labs team. 

Cheers,

Kerem

That’s great. Anyone up to making scrollView work in both directions at the same time? (Diagonal flicking/dragging). 

Thanks for getting this out!

It has so many bugs…

the more i transfer from Widget 1.0 to 2.0

,more bugs i got…

when it’s going to be stable?

i can’t publish my app for long time …especially now it 's almost 5/1

i can’t use old one (build 993) to publish in iOS.

it’s one immature bad widget…i can’t truest it . 

also i have reported some bugs.

the more i use , more bug i found…

can u fix it and make it stable?

when u wanna do one “BIG” change , please make sure it’s good.

Also u enforce us to change , it’s not good action.

takes lots time to change “ALL” my apps.

and got bug bug bug…upset

PLZ, don’t do that again OKAY? serious

Owen

Hi Owen,

We realize there were (and still are) some lingering bugs with Widgets 2.0 and we’ve been working almost every day to fix them. Even when we fix a bug, some issues remain on various devices and/or with “uncommon” usage of widgets. It’s impossible for us to predict each and every use of widgets and how they will perform if, for example, you place 600 display objects into a TableView and run it on an older Android device.

As for the bugs, in my investigation of some of these cases, they are not actually “bugs” but instead user error in converting from 1.0 to 2.0. Many parameters changed, which is why the Migration Guide was created: http://docs.coronalabs.com/api/library/widget/migration.html.

Finally, we are not enforcing that you change to anything. You now have three choices:

  1. Use Widgets 2.0 “stock” as we provide it
  2. Use Widgets 2.0 open-sourced and implement the low-level specific functionality you need
  3. Use Widgets 1.0, also open-sourced (it has been for several weeks): https://github.com/coronalabs/widget-v1

So in summary, although there are still some bugs to work out, most people are pleased with the performance and flexibility of Widgets 2.0 in comparison to 1.0. But as I said, you are free to use 1.0 if you want… drop the files into your project and code just as you did before 2.0.

Sincerely,

Brent Sorrentino

Brent, thanks for this post. I apologize for the ignorant question that follows.

If I have no interest in inspecting the widgets code and improving them myself will I be ok to simply download the latest daily build and carry on as before? In other words, if I only wish to use the Corona supplied version of the widget 2.0 library, will it still be included in the Daily builds? I am hoping not to have to chase the latest & greatest out of github all the time.

Additionally, there are bunch of widget related bugs out there being discussed by fellow developers and Corona Labs staff. Now that the source is out there, will Coronal Labs continue to remain committed to those bug fixes?

Thanks for your clarification. 

Hi @ksan,

That’s not an ignorant question at all. :slight_smile: Certainly, we’ll continue to build upon the widgets core library, investigate/fix bugs, and add various improvements. The open sourcing is mainly intended for users who want to customize widgets at the deepest level for a specific functionality, or need a certain fix immediately.

Brent

Hi Brent, 

This is wonderful news! Thanks much for this confirmation. I look forward to seeing prompt resolutions to the current crop of issues with this library that has been keeping you busy. Thanks for all the hard work by the Corona Labs team. 

Cheers,

Kerem

That’s great. Anyone up to making scrollView work in both directions at the same time? (Diagonal flicking/dragging). 

Thanks for getting this out!

It has so many bugs…

the more i transfer from Widget 1.0 to 2.0

,more bugs i got…

when it’s going to be stable?

i can’t publish my app for long time …especially now it 's almost 5/1

i can’t use old one (build 993) to publish in iOS.

it’s one immature bad widget…i can’t truest it . 

also i have reported some bugs.

the more i use , more bug i found…

can u fix it and make it stable?

when u wanna do one “BIG” change , please make sure it’s good.

Also u enforce us to change , it’s not good action.

takes lots time to change “ALL” my apps.

and got bug bug bug…upset

PLZ, don’t do that again OKAY? serious

Owen

Hi Owen,

We realize there were (and still are) some lingering bugs with Widgets 2.0 and we’ve been working almost every day to fix them. Even when we fix a bug, some issues remain on various devices and/or with “uncommon” usage of widgets. It’s impossible for us to predict each and every use of widgets and how they will perform if, for example, you place 600 display objects into a TableView and run it on an older Android device.

As for the bugs, in my investigation of some of these cases, they are not actually “bugs” but instead user error in converting from 1.0 to 2.0. Many parameters changed, which is why the Migration Guide was created: http://docs.coronalabs.com/api/library/widget/migration.html.

Finally, we are not enforcing that you change to anything. You now have three choices:

  1. Use Widgets 2.0 “stock” as we provide it
  2. Use Widgets 2.0 open-sourced and implement the low-level specific functionality you need
  3. Use Widgets 1.0, also open-sourced (it has been for several weeks): https://github.com/coronalabs/widget-v1

So in summary, although there are still some bugs to work out, most people are pleased with the performance and flexibility of Widgets 2.0 in comparison to 1.0. But as I said, you are free to use 1.0 if you want… drop the files into your project and code just as you did before 2.0.

Sincerely,

Brent Sorrentino

Is it intended soon to add a reRender function for the hole visible tableView? Like this:

local list — the tableView local flag local function buttonHandler(event) -–toolBarButton Handler flag = true list.reRender end local function onRowRender(event) if flag then -— put something new in the row end end

Is it intended soon to add a reRender function for the hole visible tableView? Like this:

local list — the tableView local flag local function buttonHandler(event) -–toolBarButton Handler flag = true list.reRender end local function onRowRender(event) if flag then -— put something new in the row end end

Corona Staff,

Thank you immensely for open sourcing the Widget 2.0 library!

I am running into an interesting scenario when trying to use the libraries from github vs. the built-in corona widget libraries. I am using the frameworks-widget-sample for testing changes.

When I have this directory structure:

21bgRGE.pngI seem to have no problems and whatever overrides I make to the widgets work.

But when I do this:

um7Rdb1.png

and then in the code use:

local widget = require( "widgets.widgetLibrary.widget" )

it defaults to using the Corona built-in widget library and none of my widget overrides work.

Now I can use the first setup, but for large projects I feel like this tends to crowd the directory structure. Does anyone have any experience with the problem and know a way to pack the widgetLibrary into a sub directory ? 

Thanks!

-Justin Lindsey

When I was testing out some things using the open source library. I have something like this:

-rwxr-xr-x   1 rmiracle  staff    339 May 19 20:59 config.lua drwxr-xr-x   5 rmiracle  staff    170 May 19 21:10 images -rw-r--r--   1 rmiracle  staff   2421 Jun 12 21:58 main.lua drwxr-xr-x  16 rmiracle  staff    544 May 20 21:05 widgetLibrary -rwxr-xr-x@  1 rmiracle  staff  16388 May 18 04:14 widgetx.lua

I move the widget.lua out of that folder and into the folder with my main.lua (and renamed it widgetx.lua).

That way my code can still do:

local widget = require(“widgetx”)

or

local widget = require(“widget”)

and not have to mess around with my requires other than changing the file name.  Though it seems if you left the files where they are, you should:

 

local widget = require(“widgetLibrary.widget”)

Corona Staff,

Thank you immensely for open sourcing the Widget 2.0 library!

I am running into an interesting scenario when trying to use the libraries from github vs. the built-in corona widget libraries. I am using the frameworks-widget-sample for testing changes.

When I have this directory structure:

21bgRGE.pngI seem to have no problems and whatever overrides I make to the widgets work.

But when I do this:

um7Rdb1.png

and then in the code use:

local widget = require( "widgets.widgetLibrary.widget" )

it defaults to using the Corona built-in widget library and none of my widget overrides work.

Now I can use the first setup, but for large projects I feel like this tends to crowd the directory structure. Does anyone have any experience with the problem and know a way to pack the widgetLibrary into a sub directory ? 

Thanks!

-Justin Lindsey