Comments (10)
I'm afraid that I can't reproduce the issue. Maybe I miss the point.
During my test, the page didn't fall over automatically as long as my finger didn't leave the screen.
from android-flip.
No, what i meant is, the ability to "fling" it. (Flinging being that a animation continues at a degrading speed (or the same) after the finger is released. or something like that..)
This is the experience in the Flipboard implementation:
I fling it up or down but release it before it reaches the middle. And because of the speed/momentum it crosses the middle and falls over without my finger attached. (This is how it's perceived)
What i'm experiencing with your implementation is, if i release my finger before the page reaches the middle, it will always fall back. I need to keep my finger attached until it over the middle. In other words i need to take it over the middle with my finger and i can not fling it over the middle.
I don;t know if you have Flipboard available to have a look but you'll notice that you can give pages a very small push and that will still trigger the page to flip over by itself.
Is this not how you experience it?
from android-flip.
Now I got it.
A velocity tracker is required to detect it. We'll add the support later with the event listener too.
Thanks
from android-flip.
cool
from android-flip.
@openaphid The Flipboard component actually "snaps" to the direction that the finger last moved. Velocity does not matter, and doesn't need to be tracked.
E.g. If the last touch movement was negative (bottom to top), always flip to the next page, regardless of how the gesture started, or how fast the finger was moving.
I'd love to see this added, as it allows the user to "fling" through pages in an intuitive way. I am looking into the source now, to attempt to implement it myself. It appears that the key is to alter FlipCards.rotateBy()
and line forward = angle >= 90;
in FlipCards.handleTouchEvent()
. Any help is greatly appreciated (as it will take me time to familiarize myself).
Awesome work!
from android-flip.
So making the change I describe above is very simple. In FlipCards.handleTouchEvent()
:
In MotionEvent.ACTION_UP
remove forward = angle >= 90;
then in MotionEvent.ACTION_MOVE
add forward = delta > 0;
The only issue this causes is that the first page is no longer bound to the MAX_TIP_ANGLE
. I will make a pull request if I get that fixed.
from android-flip.
So the only other change I had to make to support the MAX_TIP_ANGLE
boundary was to add
if (frontCards.getIndex() == -1)
forward = true;
else if (backCards.getIndex() == -1)
forward = false;
where forward = angle >= 90;
used to be (in MotionEvent.ACTION_UP
).
@openaphid Let me know if there is an issue with this implementation. I have submitted a pull request: #10.
from android-flip.
@iPaulPro Thanks in advance, I just use your code to fling and it works perfectly. But I seen slightly slower while backward page, sometimes it does NOT perform flip animation. Please tell me how to make it smoother like forward page?
Hope to hear from you soon. Thank you!
from android-flip.
@iPaulPro Thanks for your contribution.
@VAdaihiep A new issue is created to address the problem you have.
from android-flip.
@VAdaihiep Please try the updated APK to see if it fixes the issue: https://github.com/openaphid/android-flip/blob/develop/FlipView/Demo/APK/Aphid-FlipView-Demo.apk
And you could follow it up in issue #17
from android-flip.
Related Issues (20)
- Fatal signal 11 (SIGSEGV) at 0x00000123 (code=1), thread 21865 (Thread-354) HOT 2
- flipImage inside flipView
- Two different Layout throw error HOT 4
- FlipViewController contain a ScrollView ,How can i scroll ScrollVeiw to bottom? HOT 1
- Dependency
- Flash imageview when page fliping HOT 7
- Navigation drawer appears below the FlipViewController HOT 3
- Flipping first to last, from right to left, is it possible?
- cannot resolved symbol static sin? HOT 2
- Flip Animation on Click Event instead of gesture HOT 1
- next and back page using buttons HOT 1
- Compression of FlipView layouts during flipping animation HOT 2
- Using .png file HOT 1
- First and Second card show the content of the card behind it as you start to flip HOT 1
- how to add pull to refresh for FlipViewController View?
- While flipping page content flash and changed by wrong index.
- Action Bar is not visible
- API24 has no method of FloatMath
- Android Flip Available for Android Studio? HOT 3
- Image/color is brigtened when flipping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-flip.