Problem with adding Favorite button/switch

I’ve been struggling with one problem since this morning, I’ve reread many guides and watched many videos, I can’t solve it, the bottom line is, the search works for me, the list works great, but I decided to add a Switch that will switch lists, one position is all games, the other is Favorites, I want to assign adding/removing from favorites to a long click on the game card, but I couldn’t do it, an error occurs when the game is in the favorites, I can’t remove it from the list for some reason, I’ve tried a lot of different options, nothing works, the error is constant, maybe someone has ideas or knows how to implement this? I took away the non-working blocks, and made a test project, left only everything that is completely working, if anyone knows, please help, I also tried to make dynamic components through the extension but I also couldn’t figure out how and what works…
testcomponents.aia (6.8 KB)

Instead of aia, if you post your blocks it will be convenient for us to suggest you better

When i look into your aia through unchieve you have not attempted any blocks for add into favourite or switch lists? If so how can we suggest?

1 Like

sorry, I deleted part of the code because I thought it was very bad, now I tried from the beginning, everything is the same, I’m adding these blocks with which the problem is

testcomponents.aia (10.0 KB)

testcomponents_1.aia (10.5 KB)

check this, i hope it is working the add items to the favorite and reduced your blocks



1 Like

It works like this, but an error occurs with a simple click on the card, I also noticed that one game can be added several times to Favorites, interesting, I will have to figure this out, it is already more difficult, you really understand very well, thanks for the help
P.S - I tested a little, some still open, but with some errors occur, sometimes it opens, sometimes it doesn’t, randomly =)

Pls clear your tinydb and try again

1 Like

tested, added a check when adding to favorites so that there are no identical cards, which does not work: adding to favorites from the search adds a random game, when clicking on a card from favorites an incorrect link to the telegram open


testcomponents_1.aia (10.3 KB)

to implement such ting, you need to focus on few things…

click on the list view is possible in three cases…
on the global list
on the fav items
after search

so you need to focus all this and should include those things in code

Now search will be focused based on switch. (search in global if not switch else search in fav)

i hope now it will work as you expect

testcomponents_2.aia (11.0 KB)

Now test it

Yes, it’s incredible, everything works, but it doesn’t work when you add game from search cards it adds a random card from the search, but the structure is so complicated that I don’t even know how to fix it, maybe you know this?

Even search also fixed. Doesnot it show search item? When switch is on and off? If switch on, search will happen from global list else search will do from fav list

yes, the search works both in the main list and in the favorites, the problem is different, for example, in the main list I write “Spider” it finds a game, and when I add this game to my favorites, a random game is added instead of the one that should be added, do you know what I mean? your code is very cool, but unfortunately my knowledge is not enough to fix it(

I understand the issue now. But current block should work, so somewhere it does problem, let me see it again

So the problem is after search when you add it to the fav it arises hmmm

1 Like

it looks like this

Edit: I noticed the logic was missing in long click, now i hope all are working

testcomponents_3.aia (12.9 KB)

1 Like

So everything works as it should, thank you for your help, I definitely wouldn’t have done this myself without you.

1 Like

I also noticed a problem: when a game is added to favorites and you use the search function in favorites, the wrong Telegram link opens. Maybe there are ideas on how to fix this?

I tested everything, everything works, but when I added this screen to my project and compiled the apk nothing works =)
I wonder if I run it through the companion everything works

Send me the apk

Unfortunately, yesterday I released an update to my app without the add to favorites feature because it didn’t work, and the apk wasn’t saved with an error.

I redid everything again, and you know it works, there are no more errors when testing the apk, although yesterday there was an error with the apk, is it possible to fix the error that when you search for a game in the list of favorites when opening games from the search, it redirects to the wrong link?

PlayVerse.v.2.4Test.apk (8.9 MB)
testcomponents_3.aia (12.9 KB)