Mohammad Ersan
Mohammad Ersan

Reputation: 12444

Gallery Selected Position Animation

am trying to use this myGallery.setSelection(5, true); (Gallery.setSelection(Position, Animate);), which 5 is the requested position.

should this method animate the gallery till the new selected position is shown?? or just jumps to the selected position directly?

because when i use it, no animation happens !!

Upvotes: 2

Views: 2764

Answers (1)

ilango j
ilango j

Reputation: 6037

set animation for on item selected listener. The animation will call only for selected gallery item.

myGallery.setOnItemSelectedListener(new OnItemSelectedListener(){
    @Override
    public void onItemSelected(AdapterView<?> arg0, View arg1,int arg2, long arg3) {
        arg1.setAnimation(AnimationUtils.loadAnimation(this, R.anim.scale_img));
    }
});

this will help you.

Upvotes: 1

Related Questions