Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When card doesn't change x position onClick event is called #61

Open
qbait opened this issue Apr 20, 2015 · 4 comments
Open

When card doesn't change x position onClick event is called #61

qbait opened this issue Apr 20, 2015 · 4 comments

Comments

@qbait
Copy link

qbait commented Apr 20, 2015

When I swipe only in y position and card doesn't change its x position, onClick event is called on this card.

@jonasborggren
Copy link

Try setting the boolean in your listeners to either false or true. This should prevent the events after it happening.

@qbait
Copy link
Author

qbait commented May 7, 2015

Jonas, can you give me more details, because I don't understand you solution. Is this proper solution or workaround for bug in library?

@jonasborggren
Copy link

I don't even know if it will work,

but in your OnTouchListener for the cards there is a return false or return true just see if it helps you out by inverting the value you have now.

Edit:
As far as I know that boolean tells the remaning touchevents if its supposed to happen or not.

@qbait
Copy link
Author

qbait commented May 10, 2015

I solve this by checking translation

    swipeFlingAdapterView.setOnItemClickListener(new SwipeFlingAdapterView.OnItemClickListener() {
        @Override
        public void onItemClicked(int itemPosition, Object dataObject) {
            if(swipeFlingAdapterView.getSelectedView().getTranslationY() == 0) {
                showProduct();
            };
        }
    });

IMO anyway it's bug in library and should be repaired there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants