Shuffle icon indicating copy to clipboard operation
Shuffle copied to clipboard

Add Infinite Cards Example

Open mac-gallagher opened this issue 5 years ago • 7 comments

Possible starting on version 3.0.1

mac-gallagher avatar Jul 08 '20 09:07 mac-gallagher

Hi, any update on this enhancement? Or a way around start over card swiping like a circular loop? Thank you for providing this library.

sharadchauhan0504 avatar Aug 19 '20 10:08 sharadchauhan0504

@skdevil see my answer here https://github.com/mac-gallagher/Shuffle/issues/59#issuecomment-629024241

mac-gallagher avatar Aug 20 '20 07:08 mac-gallagher

@mac-gallagher Thanks, got it. Though after swiping all cards, if I reload it starts from the beginning, I can use that, looks a bit glitchy, as the view are removed and added again, but that will do for now. Thank you.

sharadchauhan0504 avatar Aug 20 '20 07:08 sharadchauhan0504

Have you tried the appendCards method? You should only reload data if you want to start over and clear your swipe history

mac-gallagher avatar Aug 20 '20 07:08 mac-gallagher

Yes, I have two requirements:

  1. Load cards via a paginated API call
  2. Once all data is loaded and you are on the last card, it should start over again.

So if I have 500 cards initially, I can append those 500 data elements again, but if I keep doing this, there will be performance issues right, as you maintain an array? For now, I won't be using undo or swipe back operation. Please let me know if I am wrong.

sharadchauhan0504 avatar Aug 20 '20 07:08 sharadchauhan0504

I would not add all 500 at once, but even so, it should be no problem for the library. It just maintains an array of integers

mac-gallagher avatar Aug 20 '20 07:08 mac-gallagher

Great! Will use appendCards then, but of course, appending the same data in chunk.

sharadchauhan0504 avatar Aug 20 '20 07:08 sharadchauhan0504