wajahatkarim3/EasyFlipView

[FEATURE REQUEST] Make it possible to have both cards share height of the higher one

GiorgioKozmani opened this issue · 1 comments

First of all - Thank you for providing us with such a great and simple library! I love it and I'm generally delighted with how it works, but there's a problem that I see no simple way of fixing.

Currently, I see no other way for cards to have them share the height of the higher one other than hardcode height of both child fragments. I think that allowing the control of whether I want the other side visibility to be changed to INVISIBLE not GONE would help many people that want to display dynamic content in their FlipView.

I just thought that it might be worth to share my workaround. Both sides of FlipCard are fragments that are held in a simple ViewGroup that extends FrameLayout and has this little hack in it.

override fun onVisibilityChanged(changedView: View, visibility: Int) {
    super.onVisibilityChanged(changedView, visibility)

    if (changedView == this && visibility == GONE) {
        setVisibility(INVISIBLE)
    }
}