Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

After fling support --- Issue in flipping #20

Closed
naththeprince opened this issue Dec 11, 2012 · 12 comments
Closed

After fling support --- Issue in flipping #20

naththeprince opened this issue Dec 11, 2012 · 12 comments
Assignees
Labels
Milestone

Comments

@naththeprince
Copy link

  1. Fling works just fine.
  2. But i see an issue very often, when we move the page above 90 angle it has to flip down, but its flipping back. Steps to reproduce just flip the cards slowly above 90 i.e., greater than width/2, Earlier it's working fine but now its flipping back, which i strongly feel a bug
    Please check the images below.
  3. png when i move the cards above 90. when i leave the finger in this posiiton it has to flip up right.. but
  4. u can see the 2.png it just flipped back..

1
2

@openaphid
Copy link
Owner

Yes. It's a bug. Thanks for reporting it.

@ghost ghost assigned openaphid Dec 11, 2012
@naththeprince
Copy link
Author

Ok. Thanks for responding quickly. Actually i was trying from past 3 days to add fling support with the old library before fling added, but i too faced the same issues when i try to change things there. When i came to know fling support is added to the library, i thought to look in to it, tested to see if it solved issues i faced.

Anyhow, is there any documentation on the library procedures/methods.

@openaphid
Copy link
Owner

I finished a small patch to work around the issue.

I'm actually not fully satisfied with the fix. I re-observed the behavior of FlipBoard, and I believe a velocity tracker is used to detect fling gesture.

@iPaulPro
Copy link

Flipboard definitely doesn't use velocity tracking. You easily see this by slowly scrolling. The problem here is related to the fact that when scrolling very slowly, its possible that the last actual touch movement was opposite of what you expect. Meaning, when you are scrolling up, and when your finger comes to a stop, it may actually slightly move down before lifting.

The best way to fix this is to check for unintended movement. The key is the line that I added:

forward = delta > 0

Now that I'm thinking about it, this should really be forward = delta >= 0 which may solve some of this issue. However, it would be best to check to see if the opposite movement was greater than the "touch slop". It appears that this is the way Flipboard avoids this issue.

@iPaulPro
Copy link

Looks like that's what you did in 138494b. Sorry, didn't notice that before commenting. :-)

@openaphid
Copy link
Owner

Thanks for your detailed explanation.

From my observation, fling behavior of Flipboard are different on IOS and android. There is no velocity detection on iOS but its android version may utilize one.

For example, I can slowly scroll a page up in Fipboard android; it goes back as long as the scrolling angle is less than 90 degree.

@iPaulPro
Copy link

For example, I can slowly scroll a page up in Fipboard android; it goes back as long as the scrolling angle is less than 90 degree.

Do you have the latest version of Flipboard on Android? This is not the case (I'm not sure that it ever was, to be honest).

I will try to make a video to prove it, when I get a chance, but I can easily get it to flip up by scrolling very slowly and not passing 90 degrees.

@naththeprince
Copy link
Author

@iPaulPro I don't think so. Even i have the latest flipboard version on my htc one v. I see when u really scroll slowly without taking out your finger, it doesn't flip up until it cross 90, i.e, width/2. At the same time when u fast swipe a little amount too, it flips up/down.

@iPaulPro
Copy link

Interesting. I just tried on the Nexus One, and the behavior is different than on the Galaxy Nexus. On the N1, it behaves the way you describe. Hm...

Edit: Referring to this library, not Flipboard.

@iPaulPro
Copy link

Okay, so I just installed Flipboard on the N1 and it also works the way this library does (at master). The behavior of Flipboars's flip changes between platforms. Considering that the current library works the same as Flipboard on 4.2 and 2.3, respectively, it may actually already be correct.

I'm going to test Flibboard and FlipView on a bunch of devices and report back soon.

@openaphid
Copy link
Owner

I'm using 1.9.10, 221

Flipview will go with your solution as using velocity tracker adds code complexity without significant UX improvement.

@naththeprince
Copy link
Author

Thanks for the fix.

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

No branches or pull requests

3 participants