Android native scrollbar?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
MarcusF
Posts: 5
Joined: Sat May 02, 2020 1:03 am

Android native scrollbar?

Post by MarcusF » Sat May 02, 2020 6:57 am

I'm trying to figure out how to create an Android native scrollbar/slider, and for a language that prides itself on mobile development, this is surprisingly difficult to find.

Anyone got an example they could share?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5840
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android native scrollbar?

Post by jacque » Sat May 02, 2020 5:33 pm

What do you need to scroll? Typically fields do not have scrollbars on mobile, for that you'll need a native mobile scroller. Or is it something else?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MarcusF
Posts: 5
Joined: Sat May 02, 2020 1:03 am

Re: Android native scrollbar?

Post by MarcusF » Sat May 02, 2020 7:42 pm

I'm using a line chart to display data, but there's so much I can't show it all at once.

To make it easier, I'm using a scroller to move around the timeline.

So it's a freestanding scroller which runs a function when the user moves the slider.

I'm trying to figure out how to attach a screenshot, but not sure how. Also can't insert an image to an external url.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5840
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android native scrollbar?

Post by jacque » Sat May 02, 2020 9:52 pm

I see. I have a large image in one project that needs to scroll the same way, it's several times wider than a phone screen and sometimes taller too. The native mobile scroller works great, the user can swipe on the image and it moves in all directions. You don't need a separate visible control, swiping is more natural for a mobile device.

See mobileControlCreate in the dictionary. Also look at mobileControlSet and scrollerDidScroll. There's probably a LC lesson on how to make a mobile scroller.

BTW, you need 10 posts here before you can attach images or post URLs. It keeps the bots at bay.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MarcusF
Posts: 5
Joined: Sat May 02, 2020 1:03 am

Re: Android native scrollbar?

Post by MarcusF » Sat May 02, 2020 10:03 pm

Thanks for the link.

I have an old account somewhere, I was a LiveCode Open Source Contributor years ago, but this is a new account.

I'm not using the scroller to actually scroll the line chart.

What I'm doing is using it to set the starting point in the dataset (line number in csv data) and when the user slides it triggers a re-render using 10 rows at the sliders offset, letting you "scroll through" the timeline without overloading the on-screen rendered chart as it's quite small on a phone.

So it's really just a standalone control that I read and set the endValue and thumbPosition of, it's not directly linked to anything else, but the default one of course looks like Windows 95 on the Android device so I need to figure out how to create an Android native scroller/slider to achieve the same effect.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5840
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android native scrollbar?

Post by jacque » Sat May 02, 2020 10:47 pm

Yeah, that's way different. I'm afraid you'll have to go with a custom group. I haven't looked at it on Android, but I wonder if the progress bar could be adapted with a round graphic on top of it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Android Deployment”