Question

OK, I know this questions sounds weird at first, as GALLERY is designed to be user interactive, but, I like the Gallery functionality, as it suits a lot of my needs. i.e. I can give it a number of pictures, move the whole of them from right to left, or left to right and get them an animate (in my case, zoom) when one of them is selected. So all good.

I just need to do the selection programatically, which I currently have working. I just don't want the user to be able to fling, scroll, select, longpress, etc. by themselves. So no user interaction is required.

So, how can I prevent a user from doing theses things, without writting a gallery function myself (and without chopping a users fingers off!).

Thanks.

Was it helpful?

Solution

Try setting the clickable and focusable properties of your Gallery View to false.

OTHER TIPS

Following worked for me:

Gallery gallery = new Gallery( ctx ) {
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return true;
    }
};

If some interaction is still left you can also try:

Gallery dotList = new Gallery( ctx ) {
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return true;
    }

    @Override
    public boolean onSingleTapUp(MotionEvent e) {
        return true;
    }

    @Override
    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
        return true;
    }
};
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top