Skip to content

an android widget named SwipeCardsRecyclerView which based on RecyclerView.

Notifications You must be signed in to change notification settings

yuyuyu123/SwipeCardsRecyclerView

Repository files navigation

SwipeCardsRecyclerView

an android widget named SwipeCardsRecyclerView which based on RecyclerView.

Effect:

image

How to use it? Just like a standard RecyclerView:

private void initRecyclerView() {
    mRecyclerView = (SwipeCardsRecyclerView) findViewById(R.id.id_recycler_view);
    mRecyclerView.setLayoutManager(new SwipeCardsLayoutManager());
    mAdapter = new CustomSwipeCardsAdapter(this, mList);
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.setCardsOutDuration(1000);
    mRecyclerView.setSwipeCardsAnimatorEffect(SwipeCardsAnimatorEffect.ROTATION_IN_AND_OUT);
    mRecyclerView.setOnCardsRemovedListener(this);
}

the SwipeCardsRecyclerView.OnCardsRemovedListener:

@Override public void onCardsRightRemoved(View itemView, int position) {
    Log.e(TAG, "onCardsRightRemoved:" + position);
}

@Override public void onCardsLeftRemoved(View itemView, int position) {
    Log.e(TAG, "onCardsLeftRemoved:"  + position);
}

About

an android widget named SwipeCardsRecyclerView which based on RecyclerView.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages