cancel
Showing results for 
Search instead for 
Did you mean: 

Slider with swipe container

er3481
Senior

Hi,

I want to use swap container and a slider on same page. But when i click on slider background, i can not use swipe container, i.e i can not swap to second page. I just want to update the slider when i drag the indicator, not with clicking the background. So how can i implement this? Any advise?

10 REPLIES 10
Martin KJELDSEN
Chief III

Hi,

I'm having a little difficulty understanding your issue. I don't see any problem using a swipe container / slider on the same page (unless the slider is in one of the swipe container pages). Is this the case? Can you show me a screenshot?

/Martin

er3481
Senior

Hi @Martin KJELDSEN​ 

Please see the attached screenshot.

0690X0000098ImaQAE.png

Martin KJELDSEN
Chief III

At which point do you want the slider to activate then? Only if you press the actual indicator? Is the slider in a swipe container page?

Hi, @Martin KJELDSEN​ 

Yes, i just want to press and drag the actual indicator and adjust its value. And yes, the slider is in a swipe container page. Do you have any advise for me ?

What happens if you actually try to drag the indicator? "Unfortunately", in your case, the standard slider-widget you're using accepts touch input for the entire area of its container (indicator + rest of the bar). You could modify the code (it's open to you) to only accept touch input for the indicator.

The remaining "challenge" is to handle when the touch goes to the swipe container and when it goes to the indicator. Because the standard behavior for the swipe container is to "steal" all touch input unless you handle it specifically. If you, as in your case, have other touch sensitive elements inside the swipe container.

/Martin

Hi, @Martin KJELDSEN​ 

How can i seperate the touchable property for indicator and rest of the bar ? I could not find any function about this.

Generally, you can call setTouchable(bool); to dis- or enable touch for a widget. I'll have a look at the code later when i have some more time, since i don't recall how it's coded.

But what happens if you just try to drag the indicator knob and not touch anywhere on the bar?

er3481
Senior

Hi, @Martin KJELDSEN​ 

I just want to swipe to second page from anywhere on the screen except the slider knob. This is only a design specification, because some users may want to slide screen from anywhere, so i want to control the slider with only its indicator. By the way , the setTouchable function can take one parameter of which true or false. How can we use this function with this aim?

Hi @er3481​,

Sorry, this slipped my mind! And i didn't get a notification about this, for some reason. Did you get anywhere on your own, or should we continue?