making newSlider with 2 handles?

Wondering if anyone have a way to create a slider with 2 handles. Any ideas appreciated.

Thought of using 2 sliders with the bar for 1 slider made invisible, does anyone know if this can work?

Do you mean like these?

RangeSliderLeadImage.png

If, “Yes,” Then that would require some custom coding, but it wouldn’t be hard.

I could definitely do that as a level-1 hit assuming basic textures are all that is needed for the knobs, bar, and fills.

PS - Image credit to Ray Wenderlich.  His site is awesome, you should visit it.

https://www.raywenderlich.com/

https://www.raywenderlich.com/?s=corona&cof=FORID%3A10

Thanks for sharing I’ll think about it

Could I get ideas for how I can go about implementing it? Is the custom coding a significant amount of lines of code?

I estimate the coding would be between 100 and 300 lines of code.

See below for discussion of high-level design.

I would make a module that has a single builder function.

The function would probably have a signature like this:
 

dbar.create( group, x, y, params )

Some params would be:

  • w - width
  • h - height
  • b1p -  button 1 starting percent
  • b2p -  button 2 starting percent
  • listener - optional listener

This would draw the slider and place the thumb buttons in the right places.

The bar it self would probably be composed of these elements:

  • three graphic images for the bar
  • 1…3 graphic elements for the bar fill
  • thumb (button) image

These would all be stitched together using math, the parameter values, and corona features.

Easy Peasy.

An example call to the builder would look like this:

local function listener( event ) -- do some stuff here end dbar.create( group, x, y, { w = 200, h = 20, b1p = 0.2, b2p = 0.6, listener = listener } )

Thanks for the insight, and it looks good. Though I don’t want to have to buy a service mostly because of inconvenience

If anyone has code they could share here that can achieve 2 handled slider please let me know?

@alvin480, if you can’t do it yourself even after the points roaminggamer gave you, you should consider going back to read some more books about algorithms and programming.

2 handled slider is lvl 1 programming problem. it’s like 1 handled slider with 1 more variable and a check boundary to not mess with each handler.

if you are trying to get free code just for laziness, don’t count on me.

If you had made any code at all, I could help you any bugs and problems you had. but just asking a free complete code is kinda rude if you ask me.

Usually i give my code to people that at least try to make something and give him mine so they compare my code to their code so they can learn from it.

I guess programmers this days are used to copy paste code from the Internet. When a copy/paste web “programmer” tries to make apps they struggle because they actually need to code.

@roaminggamer, do you make native integrations in a app?

for example if i need a background process (app is minimized, but still running) to run in a app (android and ios) can you make it?

the things i’m talking is if i want to build a music player in corona right now i can’t because it will suck without the ability of background play.

the other things i can’t do is a navigation app, that still gives me directions (left or right, or stop) while app is minimized.

I thought I was being polite with my question, no need to be bitter with the response and call it laziness while misinterpreting my intentions. Plus widget building needs specific experience with widgets and Corona, not algorithms or OOP per se, so the books you recommended wouldn’t help.

My attempt/observation was in my first post. 

1.The place I was stuck on is getting the second handle. I thought about using 2 sliders, and making the slidebar for one invisible.

  1. At this point I guess using 1 slider and creating button handles myself is better. 

If my second approach is right, it’s completely unlike a 1 handled slider, because that can be done directly by API conveniently.

Still, I see some copy pastas going on in other threads thought I’ll ask for it here. I’m sure a lot of others would benefit down the road.

Speaking of rude, you’re kinda turning my thread into your own. He’s got a thread specifically for his help service.  

Do you mean like these?

RangeSliderLeadImage.png

If, “Yes,” Then that would require some custom coding, but it wouldn’t be hard.

I could definitely do that as a level-1 hit assuming basic textures are all that is needed for the knobs, bar, and fills.

PS - Image credit to Ray Wenderlich.  His site is awesome, you should visit it.

https://www.raywenderlich.com/

https://www.raywenderlich.com/?s=corona&cof=FORID%3A10

Thanks for sharing I’ll think about it

Could I get ideas for how I can go about implementing it? Is the custom coding a significant amount of lines of code?

I estimate the coding would be between 100 and 300 lines of code.

See below for discussion of high-level design.

I would make a module that has a single builder function.

The function would probably have a signature like this:
 

dbar.create( group, x, y, params )

Some params would be:

  • w - width
  • h - height
  • b1p -  button 1 starting percent
  • b2p -  button 2 starting percent
  • listener - optional listener

This would draw the slider and place the thumb buttons in the right places.

The bar it self would probably be composed of these elements:

  • three graphic images for the bar
  • 1…3 graphic elements for the bar fill
  • thumb (button) image

These would all be stitched together using math, the parameter values, and corona features.

Easy Peasy.

An example call to the builder would look like this:

local function listener( event ) -- do some stuff here end dbar.create( group, x, y, { w = 200, h = 20, b1p = 0.2, b2p = 0.6, listener = listener } )

Thanks for the insight, and it looks good. Though I don’t want to have to buy a service mostly because of inconvenience

If anyone has code they could share here that can achieve 2 handled slider please let me know?

@alvin480, if you can’t do it yourself even after the points roaminggamer gave you, you should consider going back to read some more books about algorithms and programming.

2 handled slider is lvl 1 programming problem. it’s like 1 handled slider with 1 more variable and a check boundary to not mess with each handler.

if you are trying to get free code just for laziness, don’t count on me.

If you had made any code at all, I could help you any bugs and problems you had. but just asking a free complete code is kinda rude if you ask me.

Usually i give my code to people that at least try to make something and give him mine so they compare my code to their code so they can learn from it.

I guess programmers this days are used to copy paste code from the Internet. When a copy/paste web “programmer” tries to make apps they struggle because they actually need to code.

@roaminggamer, do you make native integrations in a app?

for example if i need a background process (app is minimized, but still running) to run in a app (android and ios) can you make it?

the things i’m talking is if i want to build a music player in corona right now i can’t because it will suck without the ability of background play.

the other things i can’t do is a navigation app, that still gives me directions (left or right, or stop) while app is minimized.

I thought I was being polite with my question, no need to be bitter with the response and call it laziness while misinterpreting my intentions. Plus widget building needs specific experience with widgets and Corona, not algorithms or OOP per se, so the books you recommended wouldn’t help.

My attempt/observation was in my first post. 

1.The place I was stuck on is getting the second handle. I thought about using 2 sliders, and making the slidebar for one invisible.

  1. At this point I guess using 1 slider and creating button handles myself is better. 

If my second approach is right, it’s completely unlike a 1 handled slider, because that can be done directly by API conveniently.

Still, I see some copy pastas going on in other threads thought I’ll ask for it here. I’m sure a lot of others would benefit down the road.

Speaking of rude, you’re kinda turning my thread into your own. He’s got a thread specifically for his help service.