Swipecards icon indicating copy to clipboard operation
Swipecards copied to clipboard

How can we have the cardstack effect like tinder or kikoso cardview

Open ashokslsk opened this issue 10 years ago • 15 comments

Hi How can we have the z index of the cardview having the next cards(At least stack effect of 3-4 cards) showing like the stack effect is there any solution which is already implemented please share the code snippet.

ashokslsk avatar Oct 17 '15 15:10 ashokslsk

@Diolor can you take a look at this issue.

ashokslsk avatar Oct 19 '15 02:10 ashokslsk

@alexwalterbos can you check out this issue please

ashokslsk avatar Oct 19 '15 02:10 ashokslsk

I'm working on a branch that incorporates this. I don't know when that'll be done, as I'm busy otherwise.

alexwalterbos avatar Oct 21 '15 12:10 alexwalterbos

@alexwalterbos Thanks man :+1: please get that feature asap possible and let us know thanks a ton.

ashokslsk avatar Oct 22 '15 08:10 ashokslsk

@alexwalterbos please take a look at this lib this lib dont support prior to API level 19 other than that this is good example https://github.com/wenchaojiang/AndroidSwipeableCardStack

ashokslsk avatar Oct 22 '15 16:10 ashokslsk

You do realize that this feature has no priority to me whatsoever, so I can make no promises regarding when it will be finished (even if I finish it at all)?

alexwalterbos avatar Oct 23 '15 13:10 alexwalterbos

This would actually be a very nice effect if done

silviahisham avatar Nov 26 '15 02:11 silviahisham

Stack effect would be nice!

pytel87 avatar Dec 01 '15 13:12 pytel87

I would love it too!

vanshg avatar Dec 05 '15 04:12 vanshg

Same there

JackyDuong avatar Dec 15 '15 11:12 JackyDuong

You can do something like this in your Adapter when you have set app:max_visible="3":

@Override
 public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
        final float scalingFactor;
        float translationFactor;

        switch (mCurrentPosition) {
            case 0:
                scalingFactor = 1f;
                translationFactor = v.getMeasuredHeight()*scalingFactor-v.getMeasuredHeight();
                break;
            case 1:
                scalingFactor = 0.9f;
                float topPosition = v.getTop();
                translationFactor = v.getMeasuredHeight()*scalingFactor-v.getMeasuredHeight();
                break;
            case 2:
                scalingFactor = 0.8f;
                translationFactor = v.getMeasuredHeight()*scalingFactor-v.getMeasuredHeight();
                break;
            default:
                scalingFactor = 1;
                translationFactor = 0;
        }

        v.setScaleX(scalingFactor);
        v.setScaleY(scalingFactor);
        v.setTranslationY(translationFactor);
    }

I'm still trying to figure out animations ;)

lycha avatar Dec 16 '15 11:12 lycha

If someone still need this, please check my fork: https://github.com/antonkrasov/Swipecards Demo: https://youtu.be/yi7OXnJvUXE

antonkrasov avatar Mar 27 '16 11:03 antonkrasov

@antonkrasov, Great solution, thank you!

dajver avatar Aug 01 '16 14:08 dajver

@antonkrasov Thanks a lot, How can we put the cards stack visible in bottom instead of top?

NehaDhanwani avatar Feb 03 '17 08:02 NehaDhanwani

@antonkrasov may be a noob question, but HOW do i use your fork instead of the diolor branch?

In the documentation you just copied the gradle part from diolor. Is your fork not on maven central? Or is there something I need to specify in my gradle file?

SvenSv avatar Nov 07 '18 11:11 SvenSv