Meetic / Shuffle

An easy to use swiping-view for Android
886 stars 83 forks source link

Infinite shuffle #14

Closed TDepinoy closed 8 years ago

TDepinoy commented 8 years ago

It seems like it is not possible to implement a infinite shuffle.

Any workaround to do that ?

antonshkurenko commented 8 years ago

In my current project, I use this:

@Override
public void onViewExited(DraggableView draggableView, Direction direction) {
    final int position = mShuffle.getCurrentAdapterPosition();

    if (position == mAdapter.getItemCount()) {
         mShuffle.restartShuffling();
    }
    // ... other code
 }

Hope I helped

TDepinoy commented 8 years ago

Yes that's the solution I implemented, but I'm facing an issue when my amount of cards is less than the default number of displayed cards (3). In this case, the shuffle is not able to restart correctly.

antonshkurenko commented 8 years ago

Huh, seems, like you've just found a bug in my project 👍 didn't see that, thanks!

florent37 commented 8 years ago

I'll implement it ASAP, thanks :)

2016-06-14 11:14 GMT+02:00 Anton Shkurenko notifications@github.com:

Huh, seems, like you've just found a bug in my project 👍 didn't see that, thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Meetic/Shuffle/issues/14#issuecomment-225824529, or mute the thread https://github.com/notifications/unsubscribe/AFfQXOm9sYNz1_kBKLBJoxWqTwkBRGrwks5qLnD-gaJpZM4I0aly .

florent37 commented 8 years ago

I implemented it in the 1.0.8

<com.meetic.shuffle.Shuffle
     android:id="@+id/shuffle"
     android:layout_width="match_parent"
     android:layout_height="200dp"
     app:shuffle_infinite="true"
     />