Kivy spinner not working - but Only in Android

72 views
Skip to first unread message

MrBillium

unread,
Dec 13, 2022, 11:18:26 AM12/13/22
to Kivy users support
I have a basic  spinner in a screen to choose theme colors. It works fine in Windows.
I click the spinner widget and on release, the other spinner options are displayed. I can then click & choose any of the options to hide the rest.

It works fine in Windows.

But, when running the app in Android, touching the spinner and releasing displays the option list just for a split-second ( one frame perhaps?). There are no  errors and I see nothing in logcat.
Any ideas what might be happening?


from kivy.uix.spinner import Spinner

class ThemeSpinner(Spinner):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.app = MDApp.get_running_app()
        self.values = ['Red', 'Pink', 'Purple', 'DeepPurple']
        self.text = 'Choose Theme'
        self.bind(text=self.choose)
    
    def choose(self, obj, txt):
        logger.debug(f'spinner text = {txt}')
        self.app.theme_cls.primary_palette = txt




Bill Marriott

unread,
Dec 18, 2022, 11:01:01 AM12/18/22
to kivy-...@googlegroups.com
Update on this.

Through trial and error I found that the source of my problem  is this statement in main:
from kivy.config import Config
Config.set('input', 'mouse', 'mouse,multitouch_on_demand')
If I comment it out everything runs fine again.
I added that statement (without understanding what it does) to solve the problem of random red dots appearing on the gui - which it did.
Here is the link  to the issue and solution https://stackoverflow.com/questions/12692851/why-does-right-clicking-create-an-orange-dot-in-the-center-of-the-circle
154728422-91dbab74-9ff2-4cdf-a942-141592a0e9bd.png

So is there a better way to stop the random red dots that won't break spinners in Android?



--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/vJytKTa99FA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/552b0f74-cbe7-4a21-a005-2bb082ef846fn%40googlegroups.com.

Elliot Garbus

unread,
Dec 18, 2022, 11:30:25 AM12/18/22
to kivy-...@googlegroups.com

Read: https://kivy.org/doc/stable/api-kivy.input.providers.mouse.html#using-multitouch-interaction-with-the-mouse

To disable the multi-touch on Windows and Mac I use:

Config.set('input', 'mouse', 'mouse,disable_multitouch')

 

The red dot is part of the multi-touch simulation.  Disabling multi-touch for the mouse removes the red dot.

I have not done any android programming.  Does the touch on Android get reported to kivy as a mouse?

 

From: Bill Marriott
Sent: Sunday, December 18, 2022 9:01 AM
To: kivy-...@googlegroups.com
Subject: Re: [kivy-users] Kivy spinner not working - but Only in Android

 

Update on this.

 

Through trial and error I found that the source of my problem  is this statement in main:

from kivy.config import Config
Config.set(
'input', 'mouse', 'mouse,multitouch_on_demand')
If I comment it out everything runs fine again.
I added that statement (without understanding what it does) to solve the problem of random red dots appearing on the gui - which it did.
Here is the link  to the issue and solution https://stackoverflow.com/questions/12692851/why-does-right-clicking-create-an-orange-dot-in-the-center-of-the-circle
 
So is there a better way to stop the random red dots that won't break spinners in Android?
 
 

 

On Tue, Dec 13, 2022 at 11:18 AM MrBillium <bilm...@gmail.com> wrote:

I have a basic  spinner in a screen to choose theme colors. It works fine in Windows.

I click the spinner widget and on release, the other spinner options are displayed. I can then click & choose any of the options to hide the rest.

 

It works fine in Windows.

 

But, when running the app in Android, touching the spinner and releasing displays the option list just for a split-second ( one frame perhaps?). There are no  errors and I see nothing in logcat.

Any ideas what might be happening?

 


from kivy.uix.spinner import Spinner


class ThemeSpinner(Spinner):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.app = MDApp.get_running_app()
        self.values = ['Red', 'Pink', 'Purple', 'DeepPurple']
        self.text = 'Choose Theme'
        self.bind(text=self.choose)
    
    def choose(self, obj, txt):
        logger.debug(f'spinner text = {txt}')
        self.app.theme_cls.primary_palette = txt

 

 

 

 

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/vJytKTa99FA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/552b0f74-cbe7-4a21-a005-2bb082ef846fn%40googlegroups.com.

--
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/CAN5ZQKucU-9QvLK4Hv9m%2Bpj9ztFDk0M4TVgRZw97SrHGOccf7w%40mail.gmail.com.

 

Robert

unread,
Dec 18, 2022, 12:12:03 PM12/18/22
to Kivy users support
I do the same thing as Elliot (geez I hate that red dot), but never do it on Android or iOS (where the red dot does not appear).
For example (some other functionality here too):
https://github.com/Android-for-Python/c4k_photo_example/blob/main/main.py#L14-L34

Bill Marriott

unread,
Dec 20, 2022, 9:04:11 AM12/20/22
to kivy-...@googlegroups.com
I had not realized the dots were:
a)  a simulation
b) only happened  on my development machine.

I am quite surprised this  was enabled in the first place and cannot think of any other sw that enables testmodes or simulations by default!
Anyway the solution to disable using 'if platform' makes perfect sense and will allow me to cross this off my list of weird bugs ( down to only 2 now).

Thanks



Robert

unread,
Dec 20, 2022, 1:57:41 PM12/20/22
to Kivy users support
Absolutely, grrrrr.
Reply all
Reply to author
Forward
0 new messages