0

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.

andy_spoo
  • 316
  • 1
  • 4
  • 17

2 Answers2

0

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;
    }
};
Sileria
  • 15,223
  • 4
  • 49
  • 28
0

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

molnarm
  • 9,856
  • 2
  • 42
  • 60
  • Thanks for the suggestion, but it made no difference. I Tried the lot:- g.setClickable(false); g.setLongClickable(false); g.setFocusable(false); g.setFocusableInTouchMode(false); – andy_spoo Jul 27 '10 at 17:48
  • Anyone else got any suggestions? I tried putting a transparent view over the top, but that didn't work either! – andy_spoo Jul 29 '10 at 17:40