yuyakaido / CardStackView

📱Tinder like swipeable card view for Android
Apache License 2.0
2.36k stars 448 forks source link

CardStackListener methods don't work on Fragment #300

Closed mekhti11 closed 4 years ago

mekhti11 commented 4 years ago

public class HomeFragment extends Fragment implements CardStackListener I implemented CardStackListener and override its methods but they don't work.

`@Override public void onCardDragging(Direction direction, float ratio) { Log.d("dragged", "onCardSwiped: "+direction); if (direction.equals(Direction.Left)){ like(); }else if(direction.equals(Direction.Right)){ dislike(); } } @Override public void onCardSwiped(Direction direction) { Log.d("swiped", "onCardSwiped: "+direction.name()); if (direction.equals(Direction.Left)){ like(); }else if(direction.equals(Direction.Right)){ dislike(); } }

@Override
public void onCardRewound() {

}

@Override
public void onCardCanceled() {

}

@Override
public void onCardAppeared(View view, int position) {
    Log.d(TAG, "onCardAppeared: "+position);
}

@Override
public void onCardDisappeared(View view, int position) {
    Log.d(TAG, "onCardDisappeared: "+position);
}`

They don't log anything . Did I do something wrong or it is because Fragment?

mekhti11 commented 4 years ago

my bad. it is working