Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android gallery no scroll on click

Tags:

android

By default it seems, when a gallery item is clicked, the gallery automatically scrolls to center the item that was clicked. How can I override this behavior? I do not want the gallery to scroll to center when clicked, I want it to stay where it is.

like image 514
drod Avatar asked Dec 22 '22 08:12

drod


1 Answers

I think this is a correct solution:

    @Override
public boolean onSingleTapUp(final MotionEvent e) {     
    boolean handled = super.onSingleTapUp(e);
    onDown(e);

    return handled;
}
like image 152
Ohgema Avatar answered Jan 02 '23 22:01

Ohgema