disable bouncing down when scrolling up with scrollview

288 views
Skip to first unread message

xavier cattelain

unread,
Jun 25, 2020, 8:54:36 AM6/25/20
to Kivy users support
Hi to all !

Using kivy 1.11.1

Hi I tried without success to disable the bounce effect when finger scrolling and reaching the top, kivy bounce back a specific distance.  I created 100 buttons in a vertical gridlayout to see the effect on y axis when I reach by finger scrolling the first button, the scrollview top, and I stop scrollling, kivy bounce back and goes to the 4th button

Do you know how to stop this boucing ?

Here is the sample : 


import kivy
kivy.require('1.11.1')
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.scrollview import ScrollView
from kivy.core.window import Window
from kivy.app import runTouchApp
from kivy.app import App
from kivy.effects.scroll import ScrollEffect
from kivy.effects.dampedscroll import DampedScrollEffect
from kivy.properties import NumericProperty

layout = GridLayout(cols=1spacing=10size_hint_y=None)
layout.bind(minimum_height=layout.setter('height'))

for i in range(100):
    btn = Button(text=str(i), size_hint_yNoneheight=40)
    layout.add_widget(btn)

root = ScrollView(size_hint=(1None),\
    size=(Window.width, Window.height),\
    bar_width = 10bar_color= (0,1,0,1),\
    scroll_type = ['bars''content'])

root.add_widget(layout)
root.effect_y = ScrollEffect(overscroll = 0)

print(root.effect_y)
runTouchApp(root)

a=2


Elliot Garbus

unread,
Jun 25, 2020, 10:32:37 AM6/25/20
to kivy-...@googlegroups.com

Your code stops the bounce when I run in on Windows10.   When I comment out the line below, the bounce comes back.  The overscroll arg is not necessary.

root.effect_y = ScrollEffect(overscroll = 0)

 

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/f79d3051-a292-4d6d-93f9-a20abbf46f2eo%40googlegroups.com.

 

xavier cattelain

unread,
Jun 25, 2020, 5:35:12 PM6/25/20
to kivy-...@googlegroups.com
Hi Elliot, thank you for your quick response, I'm running kivy on a windows 10 also.

My issue is still there, mybe i used a confused word (bounce) sorry I will try to be more explicit. Here is my action when the app is running : 

1. I scroll to reach the top with a fast movement of 2 fingers.
2. kivy scrolls up as expected
3. My fingers quit the touchpad
4 kivy continue to going up and its okay
5. kivy goes down, and this is the default reaction I'm trying to stop


Any idea how ? Thanks, i'm trying to modify every class scrollview attributes, I'll comment if i find something but it looks too complicated for me (I'm a kivy beginner)



Elliot Garbus

unread,
Jun 25, 2020, 8:46:32 PM6/25/20
to kivy-...@googlegroups.com

I don’t see the behavior that you see.  This might be related to a touchpad issue on your machine, a driver or a setting.

 

Something else to try:

2 fingers on the touchpad is interpreted the same as the mouse scroll wheel.

Try setting a lower value scroll_wheel_distance

root.scroll_wheel_distance = 5

xavier cattelain

unread,
Jun 26, 2020, 4:55:55 AM6/26/20
to Kivy users support
Hi Elliot,

I figured it out that I have Windows 8.1 *64 :)

Well I've tried to uninstall-install 2 touchpad driver
     -Synaptics 17.0.6.13
     -Elantech 11.6.27.201

I tried to modify screel_wheel_distance to 5
without success

But I found maybe a beginning of a solution that if I take back my previous steps 

1. I scroll to reach the top with a fast movement of 2 fingers.

2. kivy scrolls up as expected

3. My fingers quit the touchpad

4 kivy continue to going up and its okay

5. Before kivy goes down, I do a quick movement on X-axis with 2 fingers, whitch stops the scrolling down, so the idea will be to fake a scroll on X axis maybe ?


Do you know how to do that ?

 


Elliot Garbus

unread,
Jun 26, 2020, 8:49:37 AM6/26/20
to kivy-...@googlegroups.com

I don’t understand your question.

 

From: xavier cattelain
Sent: Friday, June 26, 2020 1:56 AM
To: Kivy users support
Subject: Re: [kivy-users] disable bouncing down when scrolling up with scrollview

 

Hi Elliot,

--

You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

xavier cattelain

unread,
Jun 26, 2020, 9:59:39 AM6/26/20
to Kivy users support
No problem, i can explain in details : 

i noticed that at the 5th step, doing a manual scroll on x-axis with 2 fingers, stopped the scroll down. I thought maybe faking a scroll on X axis worth the try.

But i don't know how. maybe with a event like on_release or other event that is triggered when i stop scrolling and i can do a scroll_to method. I'll try this



Le vendredi 26 juin 2020 14:49:37 UTC+2, Elliot Garbus a écrit :

I don’t understand your question.

 

From: xavier cattelain
Sent: Friday, June 26, 2020 1:56 AM
To: Kivy users support
Subject: Re: [kivy-users] disable bouncing down when scrolling up with scrollview

 

Hi Elliot,

 

I figured it out that I have Windows 8.1 *64 :)

 

Well I've tried to uninstall-install 2 touchpad driver

     -Synaptics 17.0.6.13

     -Elantech 11.6.27.201

 

I tried to modify screel_wheel_distance to 5

without success

 

But I found maybe a beginning of a solution that if I take back my previous steps 

 

1. I scroll to reach the top with a fast movement of 2 fingers.

2. kivy scrolls up as expected

3. My fingers quit the touchpad

4 kivy continue to going up and its okay

5. Before kivy goes down, I do a quick movement on X-axis with 2 fingers, whitch stops the scrolling down, so the idea will be to fake a scroll on X axis maybe ?

 

Do you know how to do that ?

 

 

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Elliot Garbus

unread,
Jun 26, 2020, 10:08:35 AM6/26/20
to kivy-...@googlegroups.com

There Is an event is scrollview, that occurs when scroll touch stops, on_scroll_stop.  Good luck!

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5876f534-750f-4687-954a-373a3598d628o%40googlegroups.com.

 

Reply all
Reply to author
Forward
0 new messages