RecycleView Question

34 views
Skip to first unread message

vladutmd

unread,
Aug 28, 2020, 3:29:18 PM8/28/20
to Kivy users support
Hi everyone,

I'm working on a Dictionary app and I'm having some issues with the RecycleView updating.
Essentially, the program works (or it should) as follows:

A ScreenManager is used and 2 screens are created at run time: the search screen and the Word (result) screen.

1. User enters search phrase on the Search screen in a textinput widget.
2. A Search class is used that finds the content in the dictionary
3. The results are updated in the rv.data
4. When clicking on a result, the user is taken to a new screen where the data is displayed.
5. If the user clicks the "Back" button, they are taken back to the word screen.


To simplify it now, I made a simple Search class that simply returns results based on the letters typed. Now, onto the issues I am having. Please see GIF I attached to this post. The initial part works as expected. When I click on a result, it takes me to the result screen and everything is fine. I click back and it takes me to the search list. The problem I am having is after I have clicked on a word and then back and I change the textinput text I get strange behaviour. Similarly, when I click on the textinput it is supposed to take me back to the search screen. Additionally, when I delete some of the text, it sometimes takes me back to the word screen.
I suspect the issue lies with changing the indices and how the recycleview handles updates but I'm not too sure how to fix it.
I appreciate any help or suggestions.

Thanks,
Vlad

issue.gif
main.kv
main.py

vladutmd

unread,
Aug 28, 2020, 3:30:45 PM8/28/20
to Kivy users support

issue.gif

Here's a GIF showing the problem I am having.

Elliot Garbus

unread,
Aug 29, 2020, 12:46:58 PM8/29/20
to kivy-...@googlegroups.com

I simplified the RecycleView.  

I added a ToggleButton to word.  I added an index to the rv data list, and made the rv data list a property so it will update automatically.

If you have any questions on these changes feel free to reach out.

 

 

 

From: 'vladutmd' via Kivy users support
Sent: Friday, August 28, 2020 12:31 PM
To: Kivy users support
Subject: [kivy-users] Re: RecycleView Question

 

--
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/ada81bda-51a1-49de-9137-68a68701a797o%40googlegroups.com.

 

main.zip

vladutmd

unread,
Sep 2, 2020, 3:41:19 AM9/2/20
to Kivy users support
Thank you so much, it works as I expect it now. I'll work on it the next few days and reach out if there's anything that's unclear.
Reply all
Reply to author
Forward
0 new messages