Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button: state should became 'normal' if the always_release is False and user moves the finger away the button before releasing touch #4478

Open
ghost opened this issue Jul 18, 2016 · 3 comments
Labels
Component: Widgets kivy/uix, style.kv Type: Feature Issue is a feature request

Comments

@ghost
Copy link

ghost commented Jul 18, 2016

On every major platform, both touch-oriented (Android, iOS) and desktop (Ubuntu for example) when user touches the button unintentionally or simply before releasing touch wants to cancel the action to take place, holding the touch and swiping it away from the button bounding box, makes the button to change its state to normal (visually) and not fire the click event (behavioral change). On Kivy its not the case and its very annoying, especially on touch platforms. We expect Kivy to work the way user wants it to work (natural, intuitive user interface). If we want to enable devs to create fully-featured Kivy apps for mobile, we should make the behavior similar to that found in normal, native solutions.

Here is the gist with the bug:

https://gist.github.com/rafalo1333/d45eb5b167ce221305c6283038f6cc41

If any reviewer has the Android device, please try to open for example system Settings. If you click on any settings button and then simply release, the click will happen and the another activity will launch. If you will hold the touch away from button, it will not fire the event, and the background of the button will be set back to normal state.

For me it's one of the biggest, weirdest Kivy bugs in the terms of behavior for end user. Now the Button works the way that can be described like this: "Haha! I am the bad Button! I've got your touch, I will never drop it! Haha, poor user, guess if the button will fire the event or not, haha, I wont hint you visually anyway, once touched button will always look the same!".

This behavior makes the Kivy UI looking very static, not responding to the user interaction. Unresponsive.

If I am moving the touch away the button, I expect it to not fire any event. Thats why always_release was set to False as default in 1.9.2. The same, if I am moving the touch/mouse away the button, I expect the UI to tell me, that the Button will not fire the event, that it becomes unfocused.

I believe it's needed in 1.9.2 to improve user experience and better integrate Kivy with supported platforms.

What do you think?

@udiboy1209
Copy link
Contributor

We should define a new event in button like on_cancel or on_touch_leave. There might be use cases where people want to detect a cancelled press. For default behaviour, this function will be called instead of on_release when we drag the touch out of the button.

This might interfere with the logic of always_release maybe. We can conditionally trigger on_release or on_cancel depending on whether always_release is True or False.

@udiboy1209 udiboy1209 added Component: core-providers kivy/core Type: Feature Issue is a feature request Component: Widgets kivy/uix, style.kv and removed Component: core-providers kivy/core labels Sep 23, 2016
@saqib1707
Copy link
Contributor

saqib1707 commented Dec 9, 2016

@rafalo1333 @udiboy1209 For deciding between whether to call on_release() or on_cancel() here , I was thinking to count the number of times touch_move is being called and set a threshold.If the user after on_touch_down swipes a little and number of touch_move exceeds the threshold then the click event will get cancelled otherwise below the threshold it will call on_release().Any other ideas ?

@stale
Copy link

stale bot commented Oct 7, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Widgets kivy/uix, style.kv Type: Feature Issue is a feature request
Projects
None yet
Development

No branches or pull requests

4 participants