Giter Site home page Giter Site logo

Bug swipe about cardstackview HOT 4 CLOSED

yuyakaido avatar yuyakaido commented on June 18, 2024
Bug swipe

from cardstackview.

Comments (4)

kutukoff avatar kutukoff commented on June 18, 2024

Fix: added -> containers.get(1).setDraggable(false);

private void executePreSwipeTask() {
        containers.getFirst().setContainerEventListener(null);
        containers.getFirst().setDraggable(false);
        containers.getFirst().setEnabled(false);

        containers.get(1).setContainerEventListener(containerEventListener);
        containers.get(1).setDraggable(false);
}

from cardstackview.

yuyakaido avatar yuyakaido commented on June 18, 2024

@artemkutukov Thank you for your report and solution!

The issue can reproduce on my device.
Adding your solution then the issue can't reproduce, but we can't fast swipe...

from cardstackview.

Hof4eg avatar Hof4eg commented on June 18, 2024

Thank you Yuyakaido for a nice and very helpful library

Got another bug on fast swiping on Lenovo A328
On many fast swipes caught NullPointerException at com.yuyakaido.android.cardstackview.internal.CardContainerView.onTouchEvent(CardContainerView.java:91)

Fixed it this way, works fine, but not sure it's the best way:

public boolean onTouchEvent(MotionEvent event) {
gestureDetector.onTouchEvent(event);
if (!option.isSwipeEnabled || !isDraggable) {
return true;
}
ViewParent vp1;
ViewParent vp2;
switch (MotionEventCompat.getActionMasked(event)) {
case MotionEvent.ACTION_DOWN:
handleActionDown(event);
vp1 = getParent();
if(vp1!=null){
vp2=vp1.getParent();
if(vp2!=null){
vp2.requestDisallowInterceptTouchEvent(true);
}
}
break;
case MotionEvent.ACTION_UP:
handleActionUp(event);
vp1 = getParent();
if(vp1!=null){
vp2=vp1.getParent();
if(vp2!=null){
vp2.requestDisallowInterceptTouchEvent(false);
}
}
break;
case MotionEvent.ACTION_CANCEL:
vp1 = getParent();
if(vp1!=null){
vp2=vp1.getParent();
if(vp2!=null){
vp2.requestDisallowInterceptTouchEvent(false);
}
}
break;
case MotionEvent.ACTION_MOVE:
handleActionMove(event);
break;
}

    return true;
}

from cardstackview.

yuyakaido avatar yuyakaido commented on June 18, 2024

@kutukoff @Hof4eg
Thank you for your information.
This problem has been fixed in ver. 2.0.0.

from cardstackview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.