Widget 2.0 Onoff Switch - Onrelease Not Working (Correctly)

In the docs for widget.newSwitch() it says this:

onRelease (optional)

Listener. This is an optional function to be called as soon as the user releases the Switch (while their finger was still over theSwitch). This callback function does not require you to test for an event.phase (as it only has one) and should return true.

 

In build 1076 it doesn’t work as described. In fact, if you just click/tap the switch, onRelease is never called, although the switch stat changes toggles on/off.

 

However, if you manually slide the switch, onRelease works in that case. 

 

At least for me – anybody else run into this?

 

 Jay

In the docs for widget.newSwitch() it says this:

onRelease (optional)

Listener. This is an optional function to be called as soon as the user releases the Switch (while their finger was still over theSwitch). This callback function does not require you to test for an event.phase (as it only has one) and should return true.

 

In build 1076 it doesn’t work as described. In fact, if you just click/tap the switch, onRelease is never called, although the switch stat changes toggles on/off.

 

However, if you manually slide the switch, onRelease works in that case. 

 

At least for me – anybody else run into this?

 

 Jay

Hey Jay.

Would you be so kind as to [buglink] so I can investigate this and also keep track of it?

Thanks

I probably won’t have time until next week to create the sample code, but I’ll do it then unless someone beats me to it (hope hope).

 Jay

In the docs for widget.newSwitch() it says this:

onRelease (optional)

Listener. This is an optional function to be called as soon as the user releases the Switch (while their finger was still over theSwitch). This callback function does not require you to test for an event.phase (as it only has one) and should return true.

 

In build 1076 it doesn’t work as described. In fact, if you just click/tap the switch, onRelease is never called, although the switch stat changes toggles on/off.

 

However, if you manually slide the switch, onRelease works in that case. 

 

At least for me – anybody else run into this?

 

 Jay

Hey Jay.

Would you be so kind as to [buglink] so I can investigate this and also keep track of it?

Thanks

I probably won’t have time until next week to create the sample code, but I’ll do it then unless someone beats me to it (hope hope).

 Jay

Hi,

Yes my app failed the Samsung app store because of this (but the other way around). Its handy that they did because my iPhone user are complaining of settings not working and I used the Samsung video to diagnose the problem. They were sliding and I was expecting them to be tapping.

I am using the onPress rather than the onRelease when I set up my widget. All my other users (myself included) just tap the thing and it changes no problem.

Samsung guys thought it was some kind of slider which is perfectly understandable. They slide it and It looks like it changes. User is happy BUT the listener never gets called.

So if you create the widget like this then pressAction only gets called if they tap and release. If they slide it then nothing gets called and the user gets upset because he changed the settings and it looks like in on-screen but it doesn’t do anything.

    local theSwitch = widget.newSwitch

                        {

                           style = “onOff”,

                           initialSwitchState = false,

                           onPress = pressAction

                        }  

Actually if you specify both onRelease and onTap then the listener gets called for the sliders and the tappers so its at least a workaround.

Hi,

Yes my app failed the Samsung app store because of this (but the other way around). Its handy that they did because my iPhone user are complaining of settings not working and I used the Samsung video to diagnose the problem. They were sliding and I was expecting them to be tapping.

I am using the onPress rather than the onRelease when I set up my widget. All my other users (myself included) just tap the thing and it changes no problem.

Samsung guys thought it was some kind of slider which is perfectly understandable. They slide it and It looks like it changes. User is happy BUT the listener never gets called.

So if you create the widget like this then pressAction only gets called if they tap and release. If they slide it then nothing gets called and the user gets upset because he changed the settings and it looks like in on-screen but it doesn’t do anything.

    local theSwitch = widget.newSwitch

                        {

                           style = “onOff”,

                           initialSwitchState = false,

                           onPress = pressAction

                        }  

Actually if you specify both onRelease and onTap then the listener gets called for the sliders and the tappers so its at least a workaround.