CardStackView icon indicating copy to clipboard operation
CardStackView copied to clipboard

When use Scroll view then cardstack view dragging disabled. How to enable it?

Open swatiomar opened this issue 7 years ago • 7 comments

I am using your library. But In my Adapter, I am using Scroll view to scroll the items in particular card stack. When I use Scroll view then card dragging and swiping get disable. How to enable it?

swatiomar avatar May 29 '18 07:05 swatiomar

There is a method for it cardStackView.setSwipeEnabled();

but i think your problem is about scrollview and cards. I'm not sure this code can solve

emreakcan avatar Jun 02 '18 13:06 emreakcan

Have you tried basing your code on this example? from here I tested this with the newest version and it seems to work fine.

public ViewHolder(View itemView) {
            super(itemView);
            solutions = (TextView) itemView.findViewById(R.id.solutions);
            description = (TextView) itemView.findViewById(R.id.description);
            scrollable = (ScrollView) itemView.findViewById(R.id.childScroll);

            solutions.setOnTouchListener(new View.OnTouchListener() {

                public boolean onTouch(View v, MotionEvent event) {
                    // Disallow the touch request for parent scroll on touch of child view
                    v.getParent().requestDisallowInterceptTouchEvent(true);
                    return false;
                }
            });
}

kolllor33 avatar Mar 16 '19 21:03 kolllor33

@kolllor33 this will completely disable the swipes and just enable the scroll.

gaikwadChetan93 avatar Apr 05 '20 13:04 gaikwadChetan93

@yuyakaido Any solution here?

gaikwadChetan93 avatar Apr 05 '20 13:04 gaikwadChetan93

I am also facing the same problem if anybody get solution please help me

Rammohandubey1990 avatar Aug 08 '20 09:08 Rammohandubey1990

If someone still facing this issue in Aug 2020 then surely there is no improvement done in this code.

So the solution to this problem exists. I did some coding and Jugaaad thing to get rid of this problem.

But now I don't have that code right now. but I can help

You need to create an XML layout cell for the card and then in that cell, you need to add again view pager.

so what I'm saying you need a cell of view pager and attach to this library.

so now you have a view pager of this library and in for each item, you have nested view pager at each cell.

so now in nested view pager item, you have to make new XML to reflect data and add scroll view as a parent of this item cell.

This will work.

And if you found any problem or problem with my English I can explain to you again because English is not my primary language.

navneet93sharma avatar Aug 11 '20 06:08 navneet93sharma

I have same problem :))

hoangvuanh761993 avatar Apr 18 '21 05:04 hoangvuanh761993