Forum,
I have a card that has multiple controls that is larger then the display view, so I have created a Native Android Scroller for the page.
The problem is that the Slider Control does not allow the user to slide the slider smoothly because of the Native Android Scroller. Don't know if anyone else has run into this.
So I added message handlers to the Livecode slider to disable the Native Android Scroller when the user touches in the slider and then enable it again when the user stops touching the slider. I've implemented the functionality with both the mouseDown/mouseUp and touchStart/touchEnd message in the attached stack.
The problem is that when the user touches the slider, the slider doesn't slide until you touch it a second time. I've put a Debug field on the card and the slider gets the mouseDown or touchStart message when the user touches the slider, but the slider will not move until you release the touch and touch it again. No Messages are received. You can then slide the slider and you get a mouseUp / touchEnd message when you release the touch of the slider.
Looks like you need to double tap the slider to get it to slide. Is this how it should work or is it a bug?
Not a very good user experience, but at least the slider move smoothly after you get it to slide.
Any recommendation?
Thanks
dan
Slider Control with Native Scroller
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 87
- Joined: Tue Nov 13, 2007 6:40 pm
Slider Control with Native Scroller
- Attachments
-
- NativeScrollMultiSlider.zip
- Card with scroller and multiple slider contorls
- (8.09 KiB) Downloaded 282 times
Re: Slider Control with Native Scroller
Since you use livecode scroller, you can add a simple vertical scroll to the group. Use the property inspector, in the basic properties page.
No code needed.
No code needed.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- Posts: 87
- Joined: Tue Nov 13, 2007 6:40 pm
Re: Slider Control with Native Scroller
MaxV
Thanks for your reply. Using the Group scrolling option improves the Slider functionality, but eliminates the ability for the user to scroll the page content by touch. They need to use the scroll bar on the side to move the content up and down the page. It works, but is different from all the other parts of the app,
If there is no other way to do this, I will need to use this option, but it reduces the ease of use for the mobile app.
Any other idea on how to turn on and off vertical scrolling when you touch the slider?
Other Note:
I think the reason for the double touch requirement I think is due to the first touch disabling the Native Scrolling and the second touch activates the slider control.
Thanks for your reply. Using the Group scrolling option improves the Slider functionality, but eliminates the ability for the user to scroll the page content by touch. They need to use the scroll bar on the side to move the content up and down the page. It works, but is different from all the other parts of the app,
If there is no other way to do this, I will need to use this option, but it reduces the ease of use for the mobile app.
Any other idea on how to turn on and off vertical scrolling when you touch the slider?
Other Note:
I think the reason for the double touch requirement I think is due to the first touch disabling the Native Scrolling and the second touch activates the slider control.
Re: Slider Control with Native Scroller
Don't use both sets of handlers, remove the touch ones. MouseUp and mouseDown work fine in mobile and are all you need unless you are tracking multi-touch events.I've implemented the functionality with both the mouseDown/mouseUp and touchStart/touchEnd message in the attached stack.
The way it is now the engine is sending two sets of responses on every touch.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 87
- Joined: Tue Nov 13, 2007 6:40 pm
Re: Slider Control with Native Scroller
Found a solutions.
To get this to work smoothly do the following.
Define the following handlers in the slider control
Now this disables the native scroller when you touch a slider control. To re-enable the native scroller add the following handler to the card to re-enable the native scroller when the user touches outside of the slider.
Worked like a champ to still allow the touch scrolling, but with a slider that worked as expected.
To get this to work smoothly do the following.
Define the following handlers in the slider control
Code: Select all
on touchStart
put the uScrollID of this card into tScrollID
if tScrollID > 0 AND tScrollID is not Empty then
mobileControlSet tScrollID, "scrollingEnabled", false
end if
end touchStart
on touchEnd
pass touchEnd
end touchEnd
on touchRelease
pass touchRelease
end touchRelease
on scrollbarDrag pValue
put the uOutputLocation of me into tLocation
put pValue into fld tLocation
end scrollbarDrag
Code: Select all
on touchStart pID
put the uScrollID of this card into tScrollID
if tScrollID > 0 AND tScrollID is not Empty then
mobileControlSet tScrollID, "scrollingEnabled", true
end if
pass touchStart pID
end touchStart