Closed mekhti11 closed 4 years ago
public class HomeFragment extends Fragment implements CardStackListener I implemented CardStackListener and override its methods but they don't work.
public class HomeFragment extends Fragment implements CardStackListener
`@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?
my bad. it is working
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(); } }
They don't log anything . Did I do something wrong or it is because Fragment?