Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.KEYCODE_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

like image 523
Erik Avatar asked Nov 28 '10 17:11

Erik


1 Answers

Try setting the android:animationDuration to very low value e.g., 20 or 10.

like image 122
Teo Choong Ping Avatar answered Sep 20 '22 16:09

Teo Choong Ping