Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
jansensan
Posts: 30
Registered: ‎04-04-2012
My Device: BlackBerry Playbook
Accepted Solution

SegmentedControl only fires event when touched, not when dragged

When debugging a project, I realized that the SegmentedControl fires only the Event.CHANGE when the user taps on the UI element and not when the user ends dragging the tab.

 

It feels like a bug to me, but I'd like to confirm with you people if there is something I am missing.

 

I tried on desktop and on the Playbook. I develop with FDT5.5.

--
mat janson blanchet
twitter: @jansensan, portfolio: http://jansensan.net/portfolio, tech blog: http://jansensan.net
Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: SegmentedControl only fires event when touched, not when dragged

The SegmentedControl was designed on purpose to be tap only. Think of it more like a row of buttons, like the nav bar of a website. 

 

Cheers,

Dustin 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Contributor
jansensan
Posts: 30
Registered: ‎04-04-2012
My Device: BlackBerry Playbook

Re: SegmentedControl only fires event when touched, not when dragged

Thanks for replying quickly!

 

I understand the design choice, however I believe that there may be cases where the user will see that you can drag the bar and not understand why no trigger happens when they release their finger on a new option.

--
mat janson blanchet
twitter: @jansensan, portfolio: http://jansensan.net/portfolio, tech blog: http://jansensan.net
Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: SegmentedControl only fires event when touched, not when dragged

This is standard functionality across all mobile devices. Personally I think the choice was made not to drag because your finger obfuscates the options. 

 

If you would like drag functionality you can always use a slider control and have it snap to specific options. If you present the options above the slider I think it would work well. You'll have to write the snap to code yourself however. 

 

I do agree that the look of the component makes it appear as if the toggle can be dragged. Something like distinct lines in between options might be a good idea. I'll talk to the SDK team.

 

Dustin

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Contributor
jansensan
Posts: 30
Registered: ‎04-04-2012
My Device: BlackBerry Playbook

Re: SegmentedControl only fires event when touched, not when dragged

I don't mean that the values should be updated as you drag though, only when you release. The tab already aligns with the options anyways.

Is there an MouseEvent.MOUSE_UP that is fired by the SegmentedControl? Then it would be feasible manually to see if there is a difference, but it would feel more natural if Event.CHANGE was fired already.
--
mat janson blanchet
twitter: @jansensan, portfolio: http://jansensan.net/portfolio, tech blog: http://jansensan.net
Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: SegmentedControl only fires event when touched, not when dragged

This component is not meant to be dragged. 

 

The only event fired is the change event. 

 

Regards,

Dustin

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/