Widgets 2.0 bug in onOff type switch setState in ios7 theme

Hi All - I have discovered a bug in the Widget 2.0 library:

An iOS7 theme onOff switch gets animated/rendered incorrectly and left in an inconsistent graphical state when setState is used to change it’s state.  This behavior only happens in the ios7 theme.  It’s demonstrated in the sample code below. 

I’ll file a bug report after posting this.

Thanks

[lua]-- Demonstrating bug in widget switch setState method. (main.lua)
– ios7 theme switches are rendered incorrectly when their state is changed via setState

local widget=require(‘widget’)
widget.setTheme(“widget_theme_ios7”)

local master – switch to change
local slave – switch that’s changed via setState when master is changed.

local function masterChanged(event)
slave:setState({isOn=master.isOn})
end

master = widget.newSwitch({left=40,top=50,initialSwitchState=true,onPress=masterChanged})
slave = widget.newSwitch({left=40,top=200,initialSwitchState=true})
[/lua]

I see now that it looks like @ksan reported this same issue in December…  In any case, I filed another bug report.

Scott

The more the merrier! Lets hope this one gets fixed soon. It is a nasty one. 

Welcome to the club Scott, we are all running into the same bugs - great bonding experience. 

If its not fixed next week, will fix it myself and post an update. 

Hi Scott,

It turns out this is a different bug from the one I was running into under non-iOS7 themes and was easier to fix. If this is your only issue with switch controls and you need a quick fix, send me a PM and I will email you the fix. 

Unfortunately, I have still not fixed the bug that is apparent under non-iOS7 themes

Best

  Atanas

Atanas - thanks for the offer…  This is really buried in my UI and doesn’t get called much so I ended up doing a workaround that destroys and re-creates the switch for now.

Thanks

I see now that it looks like @ksan reported this same issue in December…  In any case, I filed another bug report.

Scott

The more the merrier! Lets hope this one gets fixed soon. It is a nasty one. 

Welcome to the club Scott, we are all running into the same bugs - great bonding experience. 

If its not fixed next week, will fix it myself and post an update. 

Hi Scott,

It turns out this is a different bug from the one I was running into under non-iOS7 themes and was easier to fix. If this is your only issue with switch controls and you need a quick fix, send me a PM and I will email you the fix. 

Unfortunately, I have still not fixed the bug that is apparent under non-iOS7 themes

Best

  Atanas

Atanas - thanks for the offer…  This is really buried in my UI and doesn’t get called much so I ended up doing a workaround that destroys and re-creates the switch for now.

Thanks