CardStackView icon indicating copy to clipboard operation
CardStackView copied to clipboard

How to obscure or add an overlay on top of the stack cards?

Open 4gus71n opened this issue 2 years ago • 1 comments

First of all, amazing library! 🚀 The API is super straightforward and the whole library is a pleasure to work with. I'm actually using this library to implement some modals and it has really simplified a lot of things for me. Thanks! 🙇

Question

Is there any hook function or any callback I could use to obscure the stack cards that we have behind the main card 👇 image

What I want is to display some sort of black overlay on top of those stack cards, and have it fade away as we dismiss the current card.

I was thinking about using the onCardDragging(direction: Direction?, ratio: Float) callback but I don't have any reference to the view.

Again, thanks for this library it truly saved me from some headaches! 🙇

4gus71n avatar Nov 15 '21 23:11 4gus71n

Hey @4gus71n

You can get the reference of the view by using:-

manager?.findViewByPosition(topViewPosition-1)

Where :-

  • manager - CardStackLayoutManager
  • topViewPosition - Position of the top view
    • manager?.topPosition

Let me know if this works.

gsrathoreniks avatar Nov 26 '21 10:11 gsrathoreniks