diogobernardino/RossDeckView

Issue with CardView

mradzinski opened this issue · 3 comments

When used with CardView, the bottom of the cards gets blended and the top card loses its bottom shadow. Any idea why this can happen?

screenshot

No, it comes with surprise as I don't recall seeing it. I'm also using CardView in the sample application so once I find the time I will try to round corners there and see it.

I ended up doing something like this in my adapter (using kotlin, but it's sort of clear enough):

        // holder is just a ViewHolder and card is the root view of the items, a CardView.
        if (position == 0) {
            holder.card?.cardElevation = 6.dp.toFloat()
        } else if (position == 1) {
            holder.card?.cardElevation = 4.dp.toFloat()
        }

I checked your "der die das" app and you seem to be doing something similar to this (when you move a card away you can see the next card elevation changing a bit). This pretty much solved up everything.

cards

I'm sorry, when I first replied I was actually referring to a different open source project.

You're correct, I'm not handling the shadow in the rossdeckview library itself, but instead in the adapter. Pretty much as you have just done.