Android: Disable 'bounce' effect in custom Gallery
I have a custom gallery with 'fullscreen' items and I have overridden the onFling() method of Gallery. In this overridden function, I check if the user had 'flinged' to the left or right, and act accordingly with
onKeyDown(KeyEvent.KEY开发者_运维知识库CODE_DPAD_RIGHT, event); // OR
onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, event);
This works great, but there is some sort of 'bounce' animation when I scroll. The new image comes in and moves just too far, then moves back to the final position. Because the images I use are far too big, the bounce animation looks horrible and therefor I want to disable it.
Any suggestions?
Thanks a lot!
Erik
Try setting the android:animationDuration to very low value e.g., 20 or 10.
精彩评论